expose poly1305 digester

This commit is contained in:
Jeff Becker 2018-11-24 10:07:17 -05:00
parent d148898ad7
commit f385c624c7
No known key found for this signature in database
GPG key ID: F357B3B42F6F9B05
3 changed files with 244 additions and 244 deletions

View file

@ -1126,13 +1126,13 @@ namespace crypto
if (encrypt)
{
// calculate Poly1305 tag and write in after encrypted data
Poly1305HMAC ((uint32_t *)(buf + msgLen), (uint32_t *)polyKey, polyMsg.data (), offset);
Poly1305HMAC ((uint64_t *)(buf + msgLen), (uint64_t *)polyKey, polyMsg.data (), offset);
}
else
{
uint32_t tag[8];
uint64_t tag[4];
// calculate Poly1305 tag
Poly1305HMAC (tag, (uint32_t *)polyKey, polyMsg.data (), offset);
Poly1305HMAC (tag, (uint64_t *)polyKey, polyMsg.data (), offset);
if (memcmp (tag, msg + msgLen, 16)) ret = false; // compare with provided
}
#else