Backed-off assert for input byte array

pull/157/merge
Jeffrey Walton 2016-05-28 16:01:18 -04:00
parent 3b583346ae
commit b86f3fef87
1 changed files with 2 additions and 1 deletions

View File

@ -3441,6 +3441,7 @@ static const int LANE_L64 = 0;
static void BLAKE2_NEON_Compress32(const byte* input, BLAKE2_State<word32, false>& state) static void BLAKE2_NEON_Compress32(const byte* input, BLAKE2_State<word32, false>& state)
{ {
assert(IsAlignedOn(input,GetAlignmentOf<uint8_t*>()));
assert(IsAlignedOn(&state.h[0],GetAlignmentOf<uint32x4_t>())); assert(IsAlignedOn(&state.h[0],GetAlignmentOf<uint32x4_t>()));
assert(IsAlignedOn(&state.h[4],GetAlignmentOf<uint32x4_t>())); assert(IsAlignedOn(&state.h[4],GetAlignmentOf<uint32x4_t>()));
assert(IsAlignedOn(&state.t[0],GetAlignmentOf<uint32x4_t>())); assert(IsAlignedOn(&state.t[0],GetAlignmentOf<uint32x4_t>()));
@ -3946,7 +3947,7 @@ static void BLAKE2_NEON_Compress32(const byte* input, BLAKE2_State<word32, false
static void BLAKE2_NEON_Compress64(const byte* input, BLAKE2_State<word64, true>& state) static void BLAKE2_NEON_Compress64(const byte* input, BLAKE2_State<word64, true>& state)
{ {
assert(IsAlignedOn(input,GetAlignmentOf<uint8x16_t>())); assert(IsAlignedOn(input,GetAlignmentOf<uint8_t*>()));
assert(IsAlignedOn(&state.h[0],GetAlignmentOf<uint64x2_t>())); assert(IsAlignedOn(&state.h[0],GetAlignmentOf<uint64x2_t>()));
assert(IsAlignedOn(&state.h[4],GetAlignmentOf<uint64x2_t>())); assert(IsAlignedOn(&state.h[4],GetAlignmentOf<uint64x2_t>()));
assert(IsAlignedOn(&state.t[0],GetAlignmentOf<uint64x2_t>())); assert(IsAlignedOn(&state.t[0],GetAlignmentOf<uint64x2_t>()));