some performance improvements

This commit is contained in:
orignal 2018-11-25 10:33:48 -05:00
parent 72c8fd257c
commit cf0fc3a4a9
2 changed files with 45 additions and 39 deletions

View file

@ -1130,9 +1130,8 @@ namespace crypto
}
// adLen and msgLen
htole64buf (padding, adLen);
polyHash.Update (padding, 8);
htole64buf (padding, msgLen);
polyHash.Update (padding, 8);
htole64buf (padding + 8, msgLen);
polyHash.Update (padding, 16);
if (encrypt)
// calculate Poly1305 tag and write in after encrypted data