1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-19 18:15:18 -07:00

MSVC compat

This commit is contained in:
Frank Denis 2022-12-09 21:29:33 +01:00
parent 1ced838f70
commit 15cceaad90
2 changed files with 12 additions and 12 deletions

View File

@ -48,11 +48,11 @@ static const uint32_t LUT[256] = {
static SoftAesBlock static SoftAesBlock
_encrypt(const uint8_t ix0[4], const uint8_t ix1[4], const uint8_t ix2[4], const uint8_t ix3[4]) _encrypt(const uint8_t ix0[4], const uint8_t ix1[4], const uint8_t ix2[4], const uint8_t ix3[4])
{ {
CRYPTO_ALIGN(64) uint32_t t[4][4][256 / SOFTAES_STRIDE]; CRYPTO_ALIGN(64) uint32_t t[4][4][256 / SOFTAES_STRIDE];
CRYPTO_ALIGN(64) uint8_t of[4][4]; CRYPTO_ALIGN(64) uint8_t of[4][4];
SoftAesBlock out; CRYPTO_ALIGN(64) SoftAesBlock out;
size_t i; size_t i;
size_t j; size_t j;
for (j = 0; j < 4; j++) { for (j = 0; j < 4; j++) {
of[j][0] = ix0[j] % SOFTAES_STRIDE; of[j][0] = ix0[j] % SOFTAES_STRIDE;
@ -99,12 +99,12 @@ _encrypt(const uint8_t ix0[4], const uint8_t ix1[4], const uint8_t ix2[4], const
SoftAesBlock SoftAesBlock
softaes_block_encrypt(const SoftAesBlock block, const SoftAesBlock rk) softaes_block_encrypt(const SoftAesBlock block, const SoftAesBlock rk)
{ {
SoftAesBlock out; CRYPTO_ALIGN(64) SoftAesBlock out;
CRYPTO_ALIGN(64) uint8_t ix0[4], ix1[4], ix2[4], ix3[4]; CRYPTO_ALIGN(64) uint8_t ix0[4], ix1[4], ix2[4], ix3[4];
const uint32_t s0 = block.w0; const uint32_t s0 = block.w0;
const uint32_t s1 = block.w1; const uint32_t s1 = block.w1;
const uint32_t s2 = block.w2; const uint32_t s2 = block.w2;
const uint32_t s3 = block.w3; const uint32_t s3 = block.w3;
ix0[0] = (uint8_t) s0; ix0[0] = (uint8_t) s0;
ix0[1] = (uint8_t) s1; ix0[1] = (uint8_t) s1;

View File

@ -5,7 +5,7 @@
#include "private/common.h" #include "private/common.h"
typedef struct CRYPTO_ALIGN(64) SoftAesBlock { typedef struct SoftAesBlock {
uint32_t w0; uint32_t w0;
uint32_t w1; uint32_t w1;
uint32_t w2; uint32_t w2;