Skip to content

ericlagergren/polyval

Folders and files

NameName
Last commit message
Last commit date

Latest commit

18692a1 · Aug 5, 2023

History

27 Commits
Aug 5, 2023
Apr 10, 2022
May 7, 2022
Jan 30, 2022
Apr 11, 2022
Jan 30, 2022
Feb 6, 2022
Apr 18, 2022
Aug 5, 2023
Aug 5, 2023
May 7, 2022
Apr 11, 2022
Apr 10, 2022
Apr 18, 2022
Apr 11, 2022
Apr 18, 2022
Apr 18, 2022
Apr 18, 2022
Apr 10, 2022
Aug 5, 2023
Feb 6, 2022
Apr 10, 2022

Repository files navigation

polyval

Go Reference

This module implements POLYVAL per RFC 8452.

The universal hash function POLYVAL is the byte-wise reverse of GHASH.

Installation

go get github.com/ericlagergren/polyval@latest

Performance

The x86-64 and ARMv8 assembly backends run at about 0.25 cycles per byte. The x86-64 implementation requires SSE2 and PCLMULQDQ instructions. The ARMv8 implementation requires NEON and PMULL.

The default Go implementation will be selected if the CPU does not support either assembly implementation. (This implementation can also be selected with the purego build tag.) It is much slower at around 9 cycles per byte.

Security

Disclosure

This project uses full disclosure. If you find a security bug in an implementation, please e-mail me or create a GitHub issue.

Disclaimer

You should only use cryptography libraries that have been reviewed by cryptographers or cryptography engineers. While I am a cryptography engineer, I'm not your cryptography engineer, and I have not had this project reviewed by any other cryptographers.