mirror of
https://github.com/veracrypt/VeraCrypt
synced 2024-11-27 21:43:29 +01:00
parent
bd4566fe1f
commit
c446773823
@ -287,7 +287,7 @@ static mode(32t) gf_poly64[2] = { 0, 0xd8000000 };
|
|||||||
|
|
||||||
/* This function multiples a field element x, in the polynomial */
|
/* This function multiples a field element x, in the polynomial */
|
||||||
/* field representation. It uses 32-bit word operations to gain */
|
/* field representation. It uses 32-bit word operations to gain */
|
||||||
/* speed but compensates for machine endianess and hence works */
|
/* speed but compensates for machine endianness and hence works */
|
||||||
/* correctly on both styles of machine */
|
/* correctly on both styles of machine */
|
||||||
|
|
||||||
in_line void mul_x(mode(32t) x[4])
|
in_line void mul_x(mode(32t) x[4])
|
||||||
@ -333,7 +333,7 @@ in_line void mul_x64(mode(32t) x[2])
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Multiply of a GF128 field element by x^8 using 32-bit words */
|
/* Multiply of a GF128 field element by x^8 using 32-bit words */
|
||||||
/* for speed - machine endianess matters here */
|
/* for speed - machine endianness matters here */
|
||||||
|
|
||||||
#if (PLATFORM_BYTE_ORDER == BRG_LITTLE_ENDIAN)
|
#if (PLATFORM_BYTE_ORDER == BRG_LITTLE_ENDIAN)
|
||||||
|
|
||||||
@ -380,7 +380,7 @@ in_line void mul_bex8_64(mode(32t) x[2]) /* mutiply with long words */
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* hence choose the correct version for the machine endianess */
|
/* hence choose the correct version for the machine endianness */
|
||||||
|
|
||||||
#if PLATFORM_BYTE_ORDER == BRG_BIG_ENDIAN
|
#if PLATFORM_BYTE_ORDER == BRG_BIG_ENDIAN
|
||||||
#define mul_x8 mul_bex8
|
#define mul_x8 mul_bex8
|
||||||
|
@ -894,7 +894,7 @@ static uint64 HashMultipleBlocks(WHIRLPOOL_CTX * const ctx, const uint64 *input,
|
|||||||
#if BYTE_ORDER == BIG_ENDIAN
|
#if BYTE_ORDER == BIG_ENDIAN
|
||||||
WhirlpoolTransform(ctx->state, input);
|
WhirlpoolTransform(ctx->state, input);
|
||||||
#else
|
#else
|
||||||
CorrectEndianess(dataBuf, input, 64);
|
CorrectEndianness(dataBuf, input, 64);
|
||||||
WhirlpoolTransform(ctx->state, dataBuf);
|
WhirlpoolTransform(ctx->state, dataBuf);
|
||||||
#endif
|
#endif
|
||||||
input += 8;
|
input += 8;
|
||||||
@ -1008,7 +1008,7 @@ void WHIRLPOOL_finalize(WHIRLPOOL_CTX * const ctx,
|
|||||||
memset(data, 0, 32);
|
memset(data, 0, 32);
|
||||||
}
|
}
|
||||||
#if BYTE_ORDER == LITTLE_ENDIAN
|
#if BYTE_ORDER == LITTLE_ENDIAN
|
||||||
CorrectEndianess(dataBuf, dataBuf, 32);
|
CorrectEndianness(dataBuf, dataBuf, 32);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
dataBuf[4] = 0;
|
dataBuf[4] = 0;
|
||||||
@ -1018,7 +1018,7 @@ void WHIRLPOOL_finalize(WHIRLPOOL_CTX * const ctx,
|
|||||||
|
|
||||||
WhirlpoolTransform(stateBuf, dataBuf);
|
WhirlpoolTransform(stateBuf, dataBuf);
|
||||||
#if BYTE_ORDER == LITTLE_ENDIAN
|
#if BYTE_ORDER == LITTLE_ENDIAN
|
||||||
CorrectEndianess(stateBuf, stateBuf, 64);
|
CorrectEndianness(stateBuf, stateBuf, 64);
|
||||||
#endif
|
#endif
|
||||||
memcpy(result, stateBuf, 64);
|
memcpy(result, stateBuf, 64);
|
||||||
}
|
}
|
||||||
|
@ -151,7 +151,7 @@ VC_INLINE uint64 ByteReverseWord64(uint64 value)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
VC_INLINE void CorrectEndianess(uint64 *out, const uint64 *in, size_t byteCount)
|
VC_INLINE void CorrectEndianness(uint64 *out, const uint64 *in, size_t byteCount)
|
||||||
|
|
||||||
{
|
{
|
||||||
size_t i, count = byteCount/sizeof(uint64);
|
size_t i, count = byteCount/sizeof(uint64);
|
||||||
|
Loading…
Reference in New Issue
Block a user