Commit 95ce5d75 authored by Niels Möller's avatar Niels Möller
Browse files

Use size_t for pbkdf2.

parent c15a79d4
...@@ -32,10 +32,10 @@ ...@@ -32,10 +32,10 @@
#include "hmac.h" #include "hmac.h"
void void
pbkdf2_hmac_sha1 (unsigned key_length, const uint8_t *key, pbkdf2_hmac_sha1 (size_t key_length, const uint8_t *key,
unsigned iterations, unsigned iterations,
unsigned salt_length, const uint8_t *salt, size_t salt_length, const uint8_t *salt,
unsigned length, uint8_t *dst) size_t length, uint8_t *dst)
{ {
struct hmac_sha1_ctx sha1ctx; struct hmac_sha1_ctx sha1ctx;
......
...@@ -32,10 +32,10 @@ ...@@ -32,10 +32,10 @@
#include "hmac.h" #include "hmac.h"
void void
pbkdf2_hmac_sha256 (unsigned key_length, const uint8_t *key, pbkdf2_hmac_sha256 (size_t key_length, const uint8_t *key,
unsigned iterations, unsigned iterations,
unsigned salt_length, const uint8_t *salt, size_t salt_length, const uint8_t *salt,
unsigned length, uint8_t *dst) size_t length, uint8_t *dst)
{ {
struct hmac_sha256_ctx sha256ctx; struct hmac_sha256_ctx sha256ctx;
......
...@@ -41,9 +41,9 @@ void ...@@ -41,9 +41,9 @@ void
pbkdf2 (void *mac_ctx, pbkdf2 (void *mac_ctx,
nettle_hash_update_func *update, nettle_hash_update_func *update,
nettle_hash_digest_func *digest, nettle_hash_digest_func *digest,
unsigned digest_size, unsigned iterations, size_t digest_size, unsigned iterations,
unsigned salt_length, const uint8_t *salt, size_t salt_length, const uint8_t *salt,
unsigned length, uint8_t *dst) size_t length, uint8_t *dst)
{ {
TMP_DECL(U, uint8_t, NETTLE_MAX_HASH_DIGEST_SIZE); TMP_DECL(U, uint8_t, NETTLE_MAX_HASH_DIGEST_SIZE);
TMP_DECL(T, uint8_t, NETTLE_MAX_HASH_DIGEST_SIZE); TMP_DECL(T, uint8_t, NETTLE_MAX_HASH_DIGEST_SIZE);
......
...@@ -42,9 +42,9 @@ void ...@@ -42,9 +42,9 @@ void
pbkdf2 (void *mac_ctx, pbkdf2 (void *mac_ctx,
nettle_hash_update_func *update, nettle_hash_update_func *update,
nettle_hash_digest_func *digest, nettle_hash_digest_func *digest,
unsigned digest_size, unsigned iterations, size_t digest_size, unsigned iterations,
unsigned salt_length, const uint8_t *salt, size_t salt_length, const uint8_t *salt,
unsigned length, uint8_t *dst); size_t length, uint8_t *dst);
#define PBKDF2(ctx, update, digest, digest_size, \ #define PBKDF2(ctx, update, digest, digest_size, \
iterations, salt_length, salt, length, dst) \ iterations, salt_length, salt, length, dst) \
...@@ -59,16 +59,16 @@ pbkdf2 (void *mac_ctx, ...@@ -59,16 +59,16 @@ pbkdf2 (void *mac_ctx,
/* PBKDF2 with specific PRFs. */ /* PBKDF2 with specific PRFs. */
void void
pbkdf2_hmac_sha1 (unsigned key_length, const uint8_t *key, pbkdf2_hmac_sha1 (size_t key_length, const uint8_t *key,
unsigned iterations, unsigned iterations,
unsigned salt_length, const uint8_t *salt, size_t salt_length, const uint8_t *salt,
unsigned length, uint8_t *dst); size_t length, uint8_t *dst);
void void
pbkdf2_hmac_sha256 (unsigned key_length, const uint8_t *key, pbkdf2_hmac_sha256 (size_t key_length, const uint8_t *key,
unsigned iterations, unsigned iterations,
unsigned salt_length, const uint8_t *salt, size_t salt_length, const uint8_t *salt,
unsigned length, uint8_t *dst); size_t length, uint8_t *dst);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment