annotate src/lib-otp/otp-hash.h @ 9266:cd29b745c8dd HEAD

configure: clock_gettime()'s -lrt adding dropped everything else from $LIBS.
author Timo Sirainen <tss@iki.fi>
date Mon, 27 Jul 2009 06:32:42 -0400
parents e4eb71ae8e96
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6410
e4eb71ae8e96 Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents: 4798
diff changeset
1 #ifndef OTP_HASH_H
e4eb71ae8e96 Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents: 4798
diff changeset
2 #define OTP_HASH_H
4798
c04189d77a59 Added OTP and S/KEY authentication mechanisms. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
3
c04189d77a59 Added OTP and S/KEY authentication mechanisms. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
4 struct digest_context;
c04189d77a59 Added OTP and S/KEY authentication mechanisms. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
5
c04189d77a59 Added OTP and S/KEY authentication mechanisms. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
6 enum {
c04189d77a59 Added OTP and S/KEY authentication mechanisms. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
7 OTP_HASH_MD4,
c04189d77a59 Added OTP and S/KEY authentication mechanisms. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
8 OTP_HASH_MD5,
c04189d77a59 Added OTP and S/KEY authentication mechanisms. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
9 OTP_HASH_SHA1,
c04189d77a59 Added OTP and S/KEY authentication mechanisms. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
10 };
c04189d77a59 Added OTP and S/KEY authentication mechanisms. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
11
c04189d77a59 Added OTP and S/KEY authentication mechanisms. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
12 int digest_find(const char *name);
c04189d77a59 Added OTP and S/KEY authentication mechanisms. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
13 int digest_init(struct digest_context *ctx, const unsigned int algo);
c04189d77a59 Added OTP and S/KEY authentication mechanisms. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
14 void digest_update(struct digest_context *ctx, const void *data,
c04189d77a59 Added OTP and S/KEY authentication mechanisms. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
15 const size_t size);
c04189d77a59 Added OTP and S/KEY authentication mechanisms. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
16 void digest_final(struct digest_context *ctx, unsigned char *result);
c04189d77a59 Added OTP and S/KEY authentication mechanisms. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
17 void digest_otp_final(struct digest_context *ctx, unsigned char *result);
c04189d77a59 Added OTP and S/KEY authentication mechanisms. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
18 const char *digest_name(unsigned int algo);
c04189d77a59 Added OTP and S/KEY authentication mechanisms. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
19
c04189d77a59 Added OTP and S/KEY authentication mechanisms. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
20 void otp_hash(unsigned int algo, const char *seed, const char *passphrase,
c04189d77a59 Added OTP and S/KEY authentication mechanisms. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
21 unsigned int step, unsigned char *result);
c04189d77a59 Added OTP and S/KEY authentication mechanisms. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
22
c04189d77a59 Added OTP and S/KEY authentication mechanisms. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
23 void otp_next_hash(unsigned int algo, const unsigned char *prev,
c04189d77a59 Added OTP and S/KEY authentication mechanisms. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
24 unsigned char *result);
c04189d77a59 Added OTP and S/KEY authentication mechanisms. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
25
6410
e4eb71ae8e96 Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents: 4798
diff changeset
26 #endif