summaryrefslogtreecommitdiffstats
path: root/src/lib-otp/otp-hash.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib-otp/otp-hash.h')
-rw-r--r--src/lib-otp/otp-hash.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/lib-otp/otp-hash.h b/src/lib-otp/otp-hash.h
new file mode 100644
index 0000000..152f28e
--- /dev/null
+++ b/src/lib-otp/otp-hash.h
@@ -0,0 +1,26 @@
+#ifndef OTP_HASH_H
+#define OTP_HASH_H
+
+struct digest_context;
+
+enum {
+ OTP_HASH_MD4,
+ OTP_HASH_MD5,
+ OTP_HASH_SHA1,
+};
+
+int digest_find(const char *name);
+void digest_init(struct digest_context *ctx, const unsigned int algo);
+void digest_update(struct digest_context *ctx, const void *data,
+ const size_t size);
+void digest_final(struct digest_context *ctx, unsigned char *result);
+void digest_otp_final(struct digest_context *ctx, unsigned char *result);
+const char *digest_name(unsigned int algo);
+
+void otp_hash(unsigned int algo, const char *seed, const char *passphrase,
+ unsigned int step, unsigned char *result);
+
+void otp_next_hash(unsigned int algo, const unsigned char *prev,
+ unsigned char *result);
+
+#endif