From c87d9f38f8eef3bc65e2f00e061d471622979fac Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Tue, 1 Jul 2014 19:27:34 +0000 Subject: [PATCH] Having dead code in the tree is sad, but keeps the diff with the reference implementation to a minimum. --- .../crypto_generichash/blake2/ref/blake2b-ref.c | 11 ++++++----- .../crypto_generichash/blake2/ref/blake2s-ref.c | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/libsodium/crypto_generichash/blake2/ref/blake2b-ref.c b/src/libsodium/crypto_generichash/blake2/ref/blake2b-ref.c index 1ae6b926..9cc7ede5 100644 --- a/src/libsodium/crypto_generichash/blake2/ref/blake2b-ref.c +++ b/src/libsodium/crypto_generichash/blake2/ref/blake2b-ref.c @@ -48,13 +48,13 @@ static inline int blake2b_set_lastnode( blake2b_state *S ) S->f[1] = ~0ULL; return 0; } - +#if 0 static inline int blake2b_clear_lastnode( blake2b_state *S ) { S->f[1] = 0ULL; return 0; } - +#endif /* Some helper functions, not necessarily useful */ static inline int blake2b_set_lastblock( blake2b_state *S ) { @@ -63,7 +63,7 @@ static inline int blake2b_set_lastblock( blake2b_state *S ) S->f[0] = ~0ULL; return 0; } - +#if 0 static inline int blake2b_clear_lastblock( blake2b_state *S ) { if( S->last_node ) blake2b_clear_lastnode( S ); @@ -71,7 +71,7 @@ static inline int blake2b_clear_lastblock( blake2b_state *S ) S->f[0] = 0ULL; return 0; } - +#endif static inline int blake2b_increment_counter( blake2b_state *S, const uint64_t inc ) { S->t[0] += inc; @@ -82,6 +82,7 @@ static inline int blake2b_increment_counter( blake2b_state *S, const uint64_t in // Parameter-related functions +#if 0 static inline int blake2b_param_set_digest_length( blake2b_param *P, const uint8_t digest_length ) { P->digest_length = digest_length; @@ -123,7 +124,7 @@ static inline int blake2b_param_set_inner_length( blake2b_param *P, const uint8_ P->inner_length = inner_length; return 0; } - +#endif static inline int blake2b_param_set_salt( blake2b_param *P, const uint8_t salt[BLAKE2B_SALTBYTES] ) { memcpy( P->salt, salt, BLAKE2B_SALTBYTES ); diff --git a/src/libsodium/crypto_generichash/blake2/ref/blake2s-ref.c b/src/libsodium/crypto_generichash/blake2/ref/blake2s-ref.c index 3103c31c..0e79aa52 100644 --- a/src/libsodium/crypto_generichash/blake2/ref/blake2s-ref.c +++ b/src/libsodium/crypto_generichash/blake2/ref/blake2s-ref.c @@ -44,13 +44,13 @@ static inline int blake2s_set_lastnode( blake2s_state *S ) S->f[1] = ~0U; return 0; } - +#if 0 static inline int blake2s_clear_lastnode( blake2s_state *S ) { S->f[1] = 0U; return 0; } - +#endif /* Some helper functions, not necessarily useful */ static inline int blake2s_set_lastblock( blake2s_state *S ) { @@ -59,7 +59,7 @@ static inline int blake2s_set_lastblock( blake2s_state *S ) S->f[0] = ~0U; return 0; } - +#if 0 static inline int blake2s_clear_lastblock( blake2s_state *S ) { if( S->last_node ) blake2s_clear_lastnode( S ); @@ -67,7 +67,7 @@ static inline int blake2s_clear_lastblock( blake2s_state *S ) S->f[0] = 0U; return 0; } - +#endif static inline int blake2s_increment_counter( blake2s_state *S, const uint32_t inc ) { S->t[0] += inc; @@ -76,6 +76,7 @@ static inline int blake2s_increment_counter( blake2s_state *S, const uint32_t in } // Parameter-related functions +#if 0 static inline int blake2s_param_set_digest_length( blake2s_param *P, const uint8_t digest_length ) { P->digest_length = digest_length; @@ -117,7 +118,7 @@ static inline int blake2s_param_set_inner_length( blake2s_param *P, const uint8_ P->inner_length = inner_length; return 0; } - +#endif static inline int blake2s_param_set_salt( blake2s_param *P, const uint8_t salt[BLAKE2S_SALTBYTES] ) { memcpy( P->salt, salt, BLAKE2S_SALTBYTES );