ct/lc_ct_cmp: improve interface

Return 0xffffffff if arguments compare equal, 0 otherwise. Change all
consumers accordingly.
This commit is contained in:
Lucas Gabriel Vuotto 2024-06-06 13:49:25 +00:00
parent ad42d99e0b
commit 52ab9ca179
5 changed files with 12 additions and 9 deletions

View file

@ -162,7 +162,7 @@ chacha20_poly1305_open(const uint8_t *key, size_t keylen, const uint8_t *iv,
!poly1305_final(&pctx, tag, &olen))
return 0;
if (lc_ct_cmp(tag, tagp, LC_POLY1305_TAGLEN) != 0)
if (!lc_ct_cmp(tag, tagp, LC_POLY1305_TAGLEN))
return 0;
lc_scrub(buf, sizeof(buf));