crypto_verify_16.h revision 1.2
1/* This overwrites dist/src/libsodium/include/sodium/crypto_verify_16.h */ 2 3#include <lib/libkern/libkern.h> 4 5static inline int 6crypto_verify_16(const unsigned char *x, const unsigned char *y) 7{ 8 9 /* 10 * crypto_verify_16 must return 0 if equal, -1 if not. 11 * 12 * consttime_memequal returns 1 if equal, 0 if not. 13 * 14 * Hence we simply subtract one. 15 */ 16 return consttime_memequal(x, y, 16) - 1; 17} 18