Files
libsodium/src/libsodium/crypto_auth/hmacsha512256/cp/verify_hmacsha512256.c
T
Frank Denis f61e179d8e (p1 - p2 == 0) => (p1 == p2)
No binary changes on supported platforms except on gcc/armv7l where
the control flow remains identical but permutative statements get switched.
2015-01-31 12:18:51 +01:00

13 lines
377 B
C

#include "api.h"
#include "crypto_verify_32.h"
#include "utils.h"
int crypto_auth_verify(const unsigned char *h, const unsigned char *in,
unsigned long long inlen, const unsigned char *k)
{
unsigned char correct[32];
crypto_auth(correct,in,inlen,k);
return crypto_verify_32(h,correct) | (-(h == correct)) |
sodium_memcmp(correct,h,32);
}