diff options
author | Damien Miller <djm@mindrot.org> | 2013-07-29 13:54:17 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2013-07-29 13:54:17 +1000 |
commit | b710e4986ec3b7d01213919cb66ecfaac201e7aa (patch) | |
tree | 2049ad49746fd83816f624315b2082ca8696250a /bcrypt/pybc_blf.h | |
parent | e72cf0d46a6afb7b3a38d629ee5968c5e5cf2f3d (diff) | |
download | py-bcrypt-b710e4986ec3b7d01213919cb66ecfaac201e7aa.tar.gz |
bcrypt-based key derivation function support, from OpenBSD libutil
Diffstat (limited to 'bcrypt/pybc_blf.h')
-rw-r--r-- | bcrypt/pybc_blf.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/bcrypt/pybc_blf.h b/bcrypt/pybc_blf.h index 55ac12c..e18f7b6 100644 --- a/bcrypt/pybc_blf.h +++ b/bcrypt/pybc_blf.h @@ -38,6 +38,13 @@ typedef unsigned __int8 u_int8_t; typedef unsigned __int16 u_int16_t; typedef unsigned __int32 u_int32_t; +typedef unsigned __int64 u_int64_t; +#elif __STDC_VERSION__ >= 199901L /* C99 or later */ +include <stdint.h> +typedef uint8_t u_int8_t; +typedef uint16_t u_int16_t; +typedef uint32_t u_int32_t; +typedef uint64_t u_int64_t; #endif /* Schneier specifies a maximum key length of 56 bytes. @@ -74,4 +81,9 @@ void pybc_blf_enc(pybc_blf_ctx *, u_int32_t *, u_int16_t); /* Converts u_int8_t to u_int32_t */ u_int32_t pybc_Blowfish_stream2word(const u_int8_t *, u_int16_t, u_int16_t *); +/* KDF interface */ +int bcrypt_pbkdf(const char *pass, size_t passlen, + const u_int8_t *salt, size_t saltlen, + u_int8_t *key, size_t keylen, unsigned int rounds); + #endif |