#message-authentication #aes-gcm #universal-hashing #aes-gcm-siv #crypto #ghash

no-std polyval

POLYVAL is a GHASH-like universal hash over GF(2^128) useful for constructing a Message Authentication Code (MAC)

26 releases

0.7.0-pre.0 Mar 8, 2024
0.6.1 Jun 16, 2023
0.6.0 Jul 31, 2022
0.5.3 Aug 27, 2021
0.3.1 Nov 14, 2019

#2080 in Cryptography

Download history 155983/week @ 2023-12-24 252637/week @ 2023-12-31 325262/week @ 2024-01-07 352359/week @ 2024-01-14 374705/week @ 2024-01-21 369667/week @ 2024-01-28 356377/week @ 2024-02-04 406533/week @ 2024-02-11 413021/week @ 2024-02-18 405098/week @ 2024-02-25 394757/week @ 2024-03-03 389833/week @ 2024-03-10 411812/week @ 2024-03-17 384599/week @ 2024-03-24 464962/week @ 2024-03-31 319406/week @ 2024-04-07

1,599,480 downloads per month
Used in 1,782 crates (3 directly)

Apache-2.0 OR MIT

924 lines

RustCrypto: POLYVAL

crate Docs Build Status Apache2/MIT licensed Rust Version HAZMAT

POLYVAL (RFC 8452) is a universal hash function which operates over GF(2^128) and can be used for constructing a Message Authentication Code (MAC).

Its primary intended use is for implementing AES-GCM-SIV, however it is closely related to GHASH and therefore can also be used to implement AES-GCM at no cost to performance on little endian architectures.



⚠️ Warning: Hazmat!

Universal hash functions have subtle security properties and using them correctly is difficult. See the toplevel README.md for more information.



This crate has received one security audit by NCC Group, with no significant findings. We would like to thank MobileCoin for funding the audit.

All implementations contained in the crate are designed to execute in constant time, either by relying on hardware intrinsics (i.e. AVX2 on x86/x86_64), or using a portable implementation which is only constant time on processors which implement constant-time multiplication.

It is not suitable for use on processors with a variable-time multiplication operation (e.g. short circuit on multiply-by-zero / multiply-by-one, such as certain 32-bit PowerPC CPUs and some non-ARM microcontrollers).


Licensed under either of:

at your option.


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.