Constify, add missing private include

This commit is contained in:
Frank Denis 2018-12-26 18:32:39 +01:00
parent 0a6e10f75f
commit 52ff9c8980
4 changed files with 41 additions and 39 deletions

View File

@ -158,7 +158,7 @@ escrypt_r(escrypt_local_t *local, const uint8_t *passwd, size_t passwdlen,
prefixlen = src - setting; prefixlen = src - setting;
salt = src; salt = src;
src = (const uint8_t *) strrchr((char *) salt, '$'); src = (const uint8_t *) strrchr((const char *) salt, '$');
if (src) { if (src) {
saltlen = src - salt; saltlen = src - salt;
} else { } else {

View File

@ -1,5 +1,6 @@
#include "crypto_stream_chacha20.h" #include "crypto_stream_chacha20.h"
#include "core.h" #include "core.h"
#include "private/chacha20_ietf_ext.h"
#include "private/common.h" #include "private/common.h"
#include "private/implementations.h" #include "private/implementations.h"
#include "randombytes.h" #include "randombytes.h"

View File

@ -172,10 +172,10 @@ while (bytes >= 64) {
diag1 = _mm_shuffle_epi32(diag1, 0x39); \ diag1 = _mm_shuffle_epi32(diag1, 0x39); \
diag2 = _mm_shuffle_epi32(diag2, 0x39); \ diag2 = _mm_shuffle_epi32(diag2, 0x39); \
diag3 = _mm_shuffle_epi32(diag3, 0x39); \ diag3 = _mm_shuffle_epi32(diag3, 0x39); \
in##A ^= *(uint32_t *) (m + (A * 4)); \ in##A ^= *(const uint32_t *) (m + (A * 4)); \
in##B ^= *(uint32_t *) (m + (B * 4)); \ in##B ^= *(const uint32_t *) (m + (B * 4)); \
in##C ^= *(uint32_t *) (m + (C * 4)); \ in##C ^= *(const uint32_t *) (m + (C * 4)); \
in##D ^= *(uint32_t *) (m + (D * 4)); \ in##D ^= *(const uint32_t *) (m + (D * 4)); \
*(uint32_t *) (c + (A * 4)) = in##A; \ *(uint32_t *) (c + (A * 4)) = in##A; \
*(uint32_t *) (c + (B * 4)) = in##B; \ *(uint32_t *) (c + (B * 4)) = in##B; \
*(uint32_t *) (c + (C * 4)) = in##C; \ *(uint32_t *) (c + (C * 4)) = in##C; \

View File

@ -432,7 +432,8 @@ if (bytes >= 512) {
y##C2 = _mm256_permute2x128_si256(z##C, z##C2, 0x31); \ y##C2 = _mm256_permute2x128_si256(z##C, z##C2, 0x31); \
y##D = _mm256_permute2x128_si256(z##D, z##D2, 0x20); \ y##D = _mm256_permute2x128_si256(z##D, z##D2, 0x20); \
y##D2 = _mm256_permute2x128_si256(z##D, z##D2, 0x31); \ y##D2 = _mm256_permute2x128_si256(z##D, z##D2, 0x31); \
y##A = _mm256_xor_si256(y##A, _mm256_loadu_si256((__m256i*) (m + 0))); \ y##A = _mm256_xor_si256(y##A, \
_mm256_loadu_si256((const __m256i*) (m + 0))); \
y##B = _mm256_xor_si256( \ y##B = _mm256_xor_si256( \
y##B, _mm256_loadu_si256((const __m256i*) (m + 64))); \ y##B, _mm256_loadu_si256((const __m256i*) (m + 64))); \
y##C = _mm256_xor_si256( \ y##C = _mm256_xor_si256( \