-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Aloha!

Niels Möller wrote:
> int mem_equal (const void *ap, const void *bp, size_t n) { volatile
> const unsigned char *a = ap; volatile const unsigned char *b = bp 
> volatile unsigned char d; size_t i; for (i = d = 0; i < n; i++) d |=
> a[i] ^ b[i]; return d == 0; }
> 
> should do (even if maybe volatile const is an unusual combination of 
> qualifiers). Is this a good name?

Yes, and a good function to add. One could think/hope that the OS
provided side channel silent memory functions. But since that is not
always (rarely) the case, providing one in nettle is a good thing.

AFAIK (browsing the docs) there aren't any specific functions for
comparing digests. Instead the user has to implement thing themselves.
Would it be an advantage to have mappings to either create a generic
digest compare or specific for the different digests and MACs?

uint8_t compare_digests(uint8_t *digest0, uint8_t *digest1, uint8_t
*DIGEST_SIZE);

or

uint8_t compare_md5_digests(uint8_t *digest0, uint8_t *digest1);

Or something like that. for MD5, SHA-digests, UMAC etc.

- -- 
Med vänlig hälsning, Yours

Joachim Strömbergson - Alltid i harmonisk svängning.
========================================================================
 Joachim Strömbergson          Secworks AB          [email protected]
========================================================================
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.22 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBCAAGBQJTXfl6AAoJEF3cfFQkIuyNoTkP/0giwtCGAKprnqHeRpxDR3ey
dvaoMhA87SFUyeoSrIASmBWxNVmvf025EoJ/t330ZUA4MWeT6Uv+C6s4BGSM/cV1
EXdnYfizFcOSLMs4u/nhLIFiR3nLatmawuaYtrPOZCChWOzNMjWOIUkK8AtWENoX
ygGo0iJKrBSGHnO5AHFRWwPv6QmrMPj8B1wQ4UoZ3lXoJFga99yk/jrhv+hmT1/9
yq959TCWrKfS5ly1QCyIpFFMgHr1ybX1YhiKe7BKkwp+NW8MSi0SoGNO1z/Aovgr
Nr5YMzybzo2AjpOtSLBsXeWjDnddV+BO3U9fRYkAsd5uqqKSaKQOrKIy1GARe6tC
wR9aYmJlHJkfF/TK1/M7xGeeJX/0QN9lm9Tc0t/qH4uHmo/bPA/0klGw7JAvdtwx
8PTUGuqMDc2Ts9/IOJLk0jlx22d50/Czibm07MbDyxFwLtwes8eeBn7jyEscmJwN
3Nlu7Wcpyu9w/zyQN0Tr4XYr1A+R1ocyxGDvUwwpR7W4hKKTA6KG45z2pz3tOkIj
570PIs5DaUeHMdmNFKaoTLHGJfaZ7UrfFXUy+rmlXgIB2HbJt8nEp5xFgwzeeHO/
J0IVOydNWB6q5mBh24JOKQDJE7wgDQq5aepvk1zNZl05KWn/uqwJJMSmZdD2B0qX
1W23wLJL4iRi3Ff/f1Sj
=yVqu
-----END PGP SIGNATURE-----
_______________________________________________
nettle-bugs mailing list
[email protected]
http://lists.lysator.liu.se/mailman/listinfo/nettle-bugs

Reply via email to