File indexing completed on 2025-01-18 10:02:15
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034 #ifndef NETTLE_PBKDF2_H_INCLUDED
0035 #define NETTLE_PBKDF2_H_INCLUDED
0036
0037 #include "nettle-meta.h"
0038
0039 #ifdef __cplusplus
0040 extern "C"
0041 {
0042 #endif
0043
0044
0045 #define pbkdf2 nettle_pbkdf2
0046 #define pbkdf2_hmac_sha1 nettle_pbkdf2_hmac_sha1
0047 #define pbkdf2_hmac_sha256 nettle_pbkdf2_hmac_sha256
0048 #define pbkdf2_hmac_sha384 nettle_pbkdf2_hmac_sha384
0049 #define pbkdf2_hmac_sha512 nettle_pbkdf2_hmac_sha512
0050 #define pbkdf2_hmac_gosthash94cp nettle_pbkdf2_hmac_gosthash94cp
0051
0052 void
0053 pbkdf2 (void *mac_ctx,
0054 nettle_hash_update_func *update,
0055 nettle_hash_digest_func *digest,
0056 size_t digest_size, unsigned iterations,
0057 size_t salt_length, const uint8_t *salt,
0058 size_t length, uint8_t *dst);
0059
0060 #define PBKDF2(ctx, update, digest, digest_size, \
0061 iterations, salt_length, salt, length, dst) \
0062 (0 ? ((update)((ctx), 0, (uint8_t *) 0), \
0063 (digest)((ctx), 0, (uint8_t *) 0)) \
0064 : pbkdf2 ((ctx), \
0065 (nettle_hash_update_func *)(update), \
0066 (nettle_hash_digest_func *)(digest), \
0067 (digest_size), (iterations), \
0068 (salt_length), (salt), (length), (dst)))
0069
0070
0071
0072 void
0073 pbkdf2_hmac_sha1 (size_t key_length, const uint8_t *key,
0074 unsigned iterations,
0075 size_t salt_length, const uint8_t *salt,
0076 size_t length, uint8_t *dst);
0077
0078 void
0079 pbkdf2_hmac_sha256 (size_t key_length, const uint8_t *key,
0080 unsigned iterations,
0081 size_t salt_length, const uint8_t *salt,
0082 size_t length, uint8_t *dst);
0083
0084 void
0085 pbkdf2_hmac_sha384 (size_t key_length, const uint8_t *key,
0086 unsigned iterations,
0087 size_t salt_length, const uint8_t *salt,
0088 size_t length, uint8_t *dst);
0089
0090 void
0091 pbkdf2_hmac_sha512 (size_t key_length, const uint8_t *key,
0092 unsigned iterations,
0093 size_t salt_length, const uint8_t *salt,
0094 size_t length, uint8_t *dst);
0095
0096 void
0097 pbkdf2_hmac_gosthash94cp (size_t key_length, const uint8_t *key,
0098 unsigned iterations,
0099 size_t salt_length, const uint8_t *salt,
0100 size_t length, uint8_t *dst);
0101
0102 #ifdef __cplusplus
0103 }
0104 #endif
0105
0106 #endif