Merge branch 'master' of github.com:jedisct1/libsodium

* 'master' of github.com:jedisct1/libsodium:
  Shave a few lines in the ChangeLog file
  Use unsigned constants for all sizes
  Use unsigned types for sizes in tests.
  Having dead code in the tree is sad, but keeps the diff with the reference implementation to a minimum.
This commit is contained in:
Frank Denis
2014-07-03 00:31:40 -07:00
7 changed files with 26 additions and 26 deletions
+4 -6
View File
@@ -1,7 +1,6 @@
* Version 0.6.0
- The ChaCha20 stream cipher has been added, as
crypto_stream_chacha20_*
- The ChaCha20 stream cipher has been added, as crypto_stream_chacha20_*
- The ChaCha20Poly1305 AEAD construction has been implemented, as
crypto_aead_chacha20poly1305_*
- The _easy API does not require any heap allocations any more and
@@ -17,15 +16,14 @@ allows setting individual parameters of the scrypt function.
- New macros and functions for recommended crypto_pwhash_* parameters
have been added.
- Similarly to crypto_sign_seed_keypair(), crypto_box_seed_keypair()
has been introduced to deterministically generate a key pair from a
seed.
has been introduced to deterministically generate a key pair from a seed.
- crypto_onetimeauth() now provides a streaming interface.
- crypto_stream_chacha20_xor_ic() and crypto_stream_salsa20_xor_ic()
have been added to use a non-zero initial block counter.
- On Windows, CryptGenRandom() was replaced by RtlGenRandom(), which
doesn't require the Crypt API.
- The high bit in curve25519 is masked instead of processing the
key as a 256-bit value.
- The high bit in curve25519 is masked instead of processing the key as
a 256-bit value.
- The curve25519 ref implementation was replaced by the latest ref10
implementation from Supercop.
- sodium_mlock() now prevents memory from being included in coredumps
@@ -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 );
@@ -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 );
@@ -12,27 +12,27 @@
extern "C" {
#endif
#define crypto_pwhash_scryptsalsa208sha256_SALTBYTES 32
#define crypto_pwhash_scryptsalsa208sha256_SALTBYTES 32U
SODIUM_EXPORT
size_t crypto_pwhash_scryptsalsa208sha256_saltbytes(void);
#define crypto_pwhash_scryptsalsa208sha256_STRBYTES 102
#define crypto_pwhash_scryptsalsa208sha256_STRBYTES 102U
SODIUM_EXPORT
size_t crypto_pwhash_scryptsalsa208sha256_strbytes(void);
#define crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_INTERACTIVE 524288
#define crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_INTERACTIVE 524288ULL
SODIUM_EXPORT
size_t crypto_pwhash_scryptsalsa208sha256_opslimit_interactive(void);
#define crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_INTERACTIVE 16777216
#define crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_INTERACTIVE 16777216ULL
SODIUM_EXPORT
size_t crypto_pwhash_scryptsalsa208sha256_memlimit_interactive(void);
#define crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_SENSITIVE 33554432
#define crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_SENSITIVE 33554432ULL
SODIUM_EXPORT
size_t crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive(void);
#define crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_SENSITIVE 1073741824
#define crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_SENSITIVE 1073741824ULL
SODIUM_EXPORT
size_t crypto_pwhash_scryptsalsa208sha256_memlimit_sensitive(void);
@@ -9,11 +9,11 @@
extern "C" {
#endif
#define crypto_scalarmult_curve25519_BYTES 32
#define crypto_scalarmult_curve25519_BYTES 32U
SODIUM_EXPORT
size_t crypto_scalarmult_curve25519_bytes(void);
#define crypto_scalarmult_curve25519_SCALARBYTES 32
#define crypto_scalarmult_curve25519_SCALARBYTES 32U
SODIUM_EXPORT
size_t crypto_scalarmult_curve25519_scalarbytes(void);
+1 -1
View File
@@ -47,7 +47,7 @@ unsigned char c[147 + crypto_box_MACBYTES];
int main(void)
{
int i;
size_t i;
crypto_box_easy(c, m, 131, nonce, bobpk, alicesk);
for (i = 0; i < 131 + crypto_box_MACBYTES; ++i) {
+1 -1
View File
@@ -41,7 +41,7 @@ unsigned char mac[crypto_secretbox_MACBYTES];
int main(void)
{
int i;
size_t i;
crypto_secretbox_easy(c, m, 131, nonce, firstkey);
for (i = 0;i < 131 + crypto_secretbox_MACBYTES; ++i) {