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

no-std polyval

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

27 releases

0.7.0-rc.0 Jul 26, 2024
0.7.0-pre.0 Mar 8, 2024
0.6.2 Mar 3, 2024
0.6.1 Jun 16, 2023
0.3.1 Nov 14, 2019

#2119 in Cryptography

Download history 414031/week @ 2024-07-20 389908/week @ 2024-07-27 421712/week @ 2024-08-03 429221/week @ 2024-08-10 417816/week @ 2024-08-17 440451/week @ 2024-08-24 422448/week @ 2024-08-31 415902/week @ 2024-09-07 385580/week @ 2024-09-14 425824/week @ 2024-09-21 426692/week @ 2024-09-28 443887/week @ 2024-10-05 445572/week @ 2024-10-12 477437/week @ 2024-10-19 436715/week @ 2024-10-26 440326/week @ 2024-11-02

1,870,132 downloads per month
Used in 2,201 crates (3 directly)

Apache-2.0 OR MIT

49KB
915 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.

Documentation

Security

⚠️ Warning: Hazmat!

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

USE AT YOUR OWN RISK!

Notes

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).

License

Licensed under either of:

at your option.

Contribution

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.

Dependencies

~285–460KB
~10K SLoC