1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-23 20:15:19 -07:00
This commit is contained in:
Frank Denis 2020-08-14 08:37:39 +02:00
parent d8c67b7f45
commit 679f448d38
2 changed files with 12 additions and 12 deletions

View File

@ -48,9 +48,9 @@ crypto_kdf_hkdf_sha256_expand(unsigned char *out, size_t out_len,
i += crypto_auth_hmacsha256_BYTES) {
crypto_auth_hmacsha256_init(&st, prk, crypto_kdf_hkdf_sha256_KEYBYTES);
if (i != (size_t) 0U) {
crypto_auth_hmacsha256_update(
&st, &out[i - crypto_auth_hmacsha256_BYTES],
crypto_auth_hmacsha256_BYTES);
crypto_auth_hmacsha256_update(&st,
&out[i - crypto_auth_hmacsha256_BYTES],
crypto_auth_hmacsha256_BYTES);
}
crypto_auth_hmacsha256_update(&st,
(const unsigned char *) ctx, ctx_len);
@ -61,9 +61,9 @@ crypto_kdf_hkdf_sha256_expand(unsigned char *out, size_t out_len,
if ((left = out_len & (crypto_auth_hmacsha256_BYTES - 1U)) != (size_t) 0U) {
crypto_auth_hmacsha256_init(&st, prk, crypto_kdf_hkdf_sha256_KEYBYTES);
if (i != (size_t) 0U) {
crypto_auth_hmacsha256_update(
&st, &out[i - crypto_auth_hmacsha256_BYTES],
crypto_auth_hmacsha256_BYTES);
crypto_auth_hmacsha256_update(&st,
&out[i - crypto_auth_hmacsha256_BYTES],
crypto_auth_hmacsha256_BYTES);
}
crypto_auth_hmacsha256_update(&st,
(const unsigned char *) ctx, ctx_len);

View File

@ -48,9 +48,9 @@ crypto_kdf_hkdf_sha512_expand(unsigned char *out, size_t out_len,
i += crypto_auth_hmacsha512_BYTES) {
crypto_auth_hmacsha512_init(&st, prk, crypto_kdf_hkdf_sha512_KEYBYTES);
if (i != (size_t) 0U) {
crypto_auth_hmacsha512_update(
&st, &out[i - crypto_auth_hmacsha512_BYTES],
crypto_auth_hmacsha512_BYTES);
crypto_auth_hmacsha512_update(&st,
&out[i - crypto_auth_hmacsha512_BYTES],
crypto_auth_hmacsha512_BYTES);
}
crypto_auth_hmacsha512_update(&st,
(const unsigned char *) ctx, ctx_len);
@ -61,9 +61,9 @@ crypto_kdf_hkdf_sha512_expand(unsigned char *out, size_t out_len,
if ((left = out_len & (crypto_auth_hmacsha512_BYTES - 1U)) != (size_t) 0U) {
crypto_auth_hmacsha512_init(&st, prk, crypto_kdf_hkdf_sha512_KEYBYTES);
if (i != (size_t) 0U) {
crypto_auth_hmacsha512_update(
&st, &out[i - crypto_auth_hmacsha512_BYTES],
crypto_auth_hmacsha512_BYTES);
crypto_auth_hmacsha512_update(&st,
&out[i - crypto_auth_hmacsha512_BYTES],
crypto_auth_hmacsha512_BYTES);
}
crypto_auth_hmacsha512_update(&st,
(const unsigned char *) ctx, ctx_len);