From: Loup Vaillant Date: Sun, 3 Feb 2019 10:59:02 +0000 (+0100) Subject: Wrong array size in function argument X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=063306c695e0722fb3dbac1a4e184bc48c49d8b0;p=Monocypher.git Wrong array size in function argument Fixes #114 Most proably harmless, but nevertheless ugly. --- diff --git a/src/monocypher.c b/src/monocypher.c index 4e44836..b216c26 100644 --- a/src/monocypher.c +++ b/src/monocypher.c @@ -82,7 +82,7 @@ static u64 x16(const u8 a[16], const u8 b[16]) return (load64_le(a + 0) ^ load64_le(b + 0)) | (load64_le(a + 8) ^ load64_le(b + 8)); } -static u64 x32(const u8 a[16],const u8 b[16]){return x16(a,b)| x16(a+16, b+16);} +static u64 x32(const u8 a[32],const u8 b[32]){return x16(a,b)| x16(a+16, b+16);} static u64 x64(const u8 a[64],const u8 b[64]){return x32(a,b)| x32(a+32, b+32);} int crypto_verify16(const u8 a[16], const u8 b[16]){ return neq0(x16(a, b)); } int crypto_verify32(const u8 a[32], const u8 b[32]){ return neq0(x32(a, b)); }