MCPcopy Create free account
hub / github.com/ElementsProject/elements / timingsafe_bcmp

Function timingsafe_bcmp

src/crypto/chacha_poly_aead.cpp:18–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16#ifndef HAVE_TIMINGSAFE_BCMP
17
18int timingsafe_bcmp(const unsigned char* b1, const unsigned char* b2, size_t n)
19{
20 const unsigned char *p1 = b1, *p2 = b2;
21 int ret = 0;
22
23 for (; n > 0; n--)
24 ret |= *p1++ ^ *p2++;
25 return (ret != 0);
26}
27
28#endif // TIMINGSAFE_BCMP
29

Callers 1

CryptMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected