Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Brian Smith
nettle
Commits
95ce5d75
Commit
95ce5d75
authored
Apr 26, 2013
by
Niels Möller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use size_t for pbkdf2.
parent
c15a79d4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
19 deletions
+19
-19
pbkdf2-hmac-sha1.c
pbkdf2-hmac-sha1.c
+3
-3
pbkdf2-hmac-sha256.c
pbkdf2-hmac-sha256.c
+4
-4
pbkdf2.c
pbkdf2.c
+3
-3
pbkdf2.h
pbkdf2.h
+9
-9
No files found.
pbkdf2-hmac-sha1.c
View file @
95ce5d75
...
...
@@ -32,10 +32,10 @@
#include "hmac.h"
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
salt_length
,
const
uint8_t
*
salt
,
unsigned
length
,
uint8_t
*
dst
)
size_t
salt_length
,
const
uint8_t
*
salt
,
size_t
length
,
uint8_t
*
dst
)
{
struct
hmac_sha1_ctx
sha1ctx
;
...
...
pbkdf2-hmac-sha256.c
View file @
95ce5d75
...
...
@@ -32,10 +32,10 @@
#include "hmac.h"
void
pbkdf2_hmac_sha256
(
unsigned
key_length
,
const
uint8_t
*
key
,
unsigned
iterations
,
unsigned
salt_length
,
const
uint8_t
*
salt
,
unsigned
length
,
uint8_t
*
dst
)
pbkdf2_hmac_sha256
(
size_t
key_length
,
const
uint8_t
*
key
,
unsigned
iterations
,
size_t
salt_length
,
const
uint8_t
*
salt
,
size_t
length
,
uint8_t
*
dst
)
{
struct
hmac_sha256_ctx
sha256ctx
;
...
...
pbkdf2.c
View file @
95ce5d75
...
...
@@ -41,9 +41,9 @@ void
pbkdf2
(
void
*
mac_ctx
,
nettle_hash_update_func
*
update
,
nettle_hash_digest_func
*
digest
,
unsigned
digest_size
,
unsigned
iterations
,
unsigned
salt_length
,
const
uint8_t
*
salt
,
unsigned
length
,
uint8_t
*
dst
)
size_t
digest_size
,
unsigned
iterations
,
size_t
salt_length
,
const
uint8_t
*
salt
,
size_t
length
,
uint8_t
*
dst
)
{
TMP_DECL
(
U
,
uint8_t
,
NETTLE_MAX_HASH_DIGEST_SIZE
);
TMP_DECL
(
T
,
uint8_t
,
NETTLE_MAX_HASH_DIGEST_SIZE
);
...
...
pbkdf2.h
View file @
95ce5d75
...
...
@@ -42,9 +42,9 @@ void
pbkdf2
(
void
*
mac_ctx
,
nettle_hash_update_func
*
update
,
nettle_hash_digest_func
*
digest
,
unsigned
digest_size
,
unsigned
iterations
,
unsigned
salt_length
,
const
uint8_t
*
salt
,
unsigned
length
,
uint8_t
*
dst
);
size_t
digest_size
,
unsigned
iterations
,
size_t
salt_length
,
const
uint8_t
*
salt
,
size_t
length
,
uint8_t
*
dst
);
#define PBKDF2(ctx, update, digest, digest_size, \
iterations, salt_length, salt, length, dst) \
...
...
@@ -59,16 +59,16 @@ pbkdf2 (void *mac_ctx,
/* PBKDF2 with specific PRFs. */
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
salt_length
,
const
uint8_t
*
salt
,
unsigned
length
,
uint8_t
*
dst
);
size_t
salt_length
,
const
uint8_t
*
salt
,
size_t
length
,
uint8_t
*
dst
);
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
salt_length
,
const
uint8_t
*
salt
,
unsigned
length
,
uint8_t
*
dst
);
size_t
salt_length
,
const
uint8_t
*
salt
,
size_t
length
,
uint8_t
*
dst
);
#ifdef __cplusplus
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment