Merge branch 'master' of github.com:jedisct1/libsodium
* 'master' of github.com:jedisct1/libsodium: Invert (1-y) just before the multiplication by (1+y) for readability Nits
This commit is contained in:
commit
922e4dcd9e
@ -67,7 +67,7 @@ store_block(void *output, const block *src)
|
|||||||
* @param m_cost number of blocks to allocate in the memory
|
* @param m_cost number of blocks to allocate in the memory
|
||||||
* @return ARGON2_OK if @memory is a valid pointer and memory is allocated
|
* @return ARGON2_OK if @memory is a valid pointer and memory is allocated
|
||||||
*/
|
*/
|
||||||
static int allocate_memory(block_region **memory, uint32_t m_cost);
|
static int allocate_memory(block_region **region, uint32_t m_cost);
|
||||||
|
|
||||||
static int
|
static int
|
||||||
allocate_memory(block_region **region, uint32_t m_cost)
|
allocate_memory(block_region **region, uint32_t m_cost)
|
||||||
@ -153,7 +153,7 @@ clear_memory(argon2_instance_t *instance, int clear)
|
|||||||
/* Deallocates memory
|
/* Deallocates memory
|
||||||
* @param memory pointer to the blocks
|
* @param memory pointer to the blocks
|
||||||
*/
|
*/
|
||||||
static void free_memory(block_region *memory);
|
static void free_memory(block_region *region);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
free_memory(block_region *region)
|
free_memory(block_region *region)
|
||||||
|
@ -163,8 +163,9 @@ salsa20_8(uint32_t B[16])
|
|||||||
x[15] ^= R(x[14] + x[13], 18);
|
x[15] ^= R(x[14] + x[13], 18);
|
||||||
#undef R
|
#undef R
|
||||||
}
|
}
|
||||||
for (i = 0; i < 16; i++)
|
for (i = 0; i < 16; i++) {
|
||||||
B[i] += x[i];
|
B[i] += x[i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -55,9 +55,9 @@ alloc_region(escrypt_region_t *region, size_t size)
|
|||||||
aligned = base;
|
aligned = base;
|
||||||
#else
|
#else
|
||||||
base = aligned = NULL;
|
base = aligned = NULL;
|
||||||
if (size + 63 < size)
|
if (size + 63 < size) {
|
||||||
errno = ENOMEM;
|
errno = ENOMEM;
|
||||||
else if ((base = (uint8_t *) malloc(size + 63)) != NULL) {
|
} else if ((base = (uint8_t *) malloc(size + 63)) != NULL) {
|
||||||
aligned = base + 63;
|
aligned = base + 63;
|
||||||
aligned -= (uintptr_t) aligned & 63;
|
aligned -= (uintptr_t) aligned & 63;
|
||||||
}
|
}
|
||||||
|
@ -61,9 +61,9 @@ crypto_sign_ed25519_pk_to_curve25519(unsigned char *curve25519_pk,
|
|||||||
}
|
}
|
||||||
fe25519_1(one_minus_y);
|
fe25519_1(one_minus_y);
|
||||||
fe25519_sub(one_minus_y, one_minus_y, A.Y);
|
fe25519_sub(one_minus_y, one_minus_y, A.Y);
|
||||||
fe25519_invert(one_minus_y, one_minus_y);
|
|
||||||
fe25519_1(x);
|
fe25519_1(x);
|
||||||
fe25519_add(x, x, A.Y);
|
fe25519_add(x, x, A.Y);
|
||||||
|
fe25519_invert(one_minus_y, one_minus_y);
|
||||||
fe25519_mul(x, x, one_minus_y);
|
fe25519_mul(x, x, one_minus_y);
|
||||||
fe25519_tobytes(curve25519_pk, x);
|
fe25519_tobytes(curve25519_pk, x);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user