From 7e5d64834c657f75c5d8f2d981986bbfedbde72b Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Sun, 19 Feb 2017 21:17:42 +0100 Subject: [PATCH] untab --- src/libsodium/crypto_kdf/blake2b/kdf_blake2b.c | 2 +- src/libsodium/include/sodium/crypto_kdf.h | 2 +- test/default/kdf.c | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/libsodium/crypto_kdf/blake2b/kdf_blake2b.c b/src/libsodium/crypto_kdf/blake2b/kdf_blake2b.c index 060c9368..2a690c9a 100644 --- a/src/libsodium/crypto_kdf/blake2b/kdf_blake2b.c +++ b/src/libsodium/crypto_kdf/blake2b/kdf_blake2b.c @@ -39,7 +39,7 @@ int crypto_kdf_blake2b_derive_from_key(unsigned char *subkey, size_t subkey_len, memcpy(ctx_padded, ctx, crypto_kdf_blake2b_CONTEXTBYTES); memset(ctx_padded + crypto_kdf_blake2b_CONTEXTBYTES, 0, sizeof ctx_padded - crypto_kdf_blake2b_CONTEXTBYTES); STORE64_LE(salt, subkey_id); - memset(salt + 8, 0, (sizeof salt) - 8); + memset(salt + 8, 0, (sizeof salt) - 8); if (subkey_len < crypto_kdf_blake2b_BYTES_MIN || subkey_len > crypto_kdf_blake2b_BYTES_MAX) { errno = EINVAL; diff --git a/src/libsodium/include/sodium/crypto_kdf.h b/src/libsodium/include/sodium/crypto_kdf.h index abfdd177..9b0ac5b5 100644 --- a/src/libsodium/include/sodium/crypto_kdf.h +++ b/src/libsodium/include/sodium/crypto_kdf.h @@ -26,7 +26,7 @@ size_t crypto_kdf_bytes_max(void); SODIUM_EXPORT size_t crypto_kdf_contextbytes(void); -#define crypto_kdf_KEYBYTES crypto_kdf_blake2b_KEYBYTES +#define crypto_kdf_KEYBYTES crypto_kdf_blake2b_KEYBYTES SODIUM_EXPORT size_t crypto_kdf_keybytes(void); diff --git a/test/default/kdf.c b/test/default/kdf.c index 7a277d45..664d1c32 100644 --- a/test/default/kdf.c +++ b/test/default/kdf.c @@ -12,8 +12,8 @@ tv_kdf(void) uint64_t i; context = (char *) sodium_malloc(crypto_kdf_CONTEXTBYTES); - memcpy(context, "KDF test", strlen("KDF test")); - master_key = (unsigned char *) sodium_malloc(crypto_kdf_KEYBYTES); + memcpy(context, "KDF test", strlen("KDF test")); + master_key = (unsigned char *) sodium_malloc(crypto_kdf_KEYBYTES); for (i = 0; i < crypto_kdf_KEYBYTES; i++) { master_key[i] = i; } @@ -27,7 +27,7 @@ tv_kdf(void) sodium_free(subkey); for (i = 0; i < crypto_kdf_BYTES_MAX + 2; i++) { - subkey = (unsigned char *) sodium_malloc(crypto_kdf_BYTES_MAX); + subkey = (unsigned char *) sodium_malloc(crypto_kdf_BYTES_MAX); if (crypto_kdf_blake2b_derive_from_key(subkey, (size_t) i, i, context, master_key) == 0) { sodium_bin2hex(hex, sizeof hex, subkey, (size_t) i); @@ -36,9 +36,9 @@ tv_kdf(void) printf("Failure -- probably expected for output length=%u\n", (unsigned int) i); } - sodium_free(subkey); + sodium_free(subkey); } - printf("tv_kdf: ok\n"); + printf("tv_kdf: ok\n"); } int