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

no-std ghash

Universal hash over GF(2^128) useful for constructing a Message Authentication Code (MAC), as in the AES-GCM authenticated encryption cipher

19 releases

0.6.0-pre.0 Mar 8, 2024
0.5.0 Jul 31, 2022
0.4.4 Aug 28, 2021
0.4.3 Jul 20, 2021
0.0.0 Oct 6, 2016

#2290 in Cryptography

Download history 329633/week @ 2023-12-05 300826/week @ 2023-12-12 254132/week @ 2023-12-19 136728/week @ 2023-12-26 254022/week @ 2024-01-02 283232/week @ 2024-01-09 327666/week @ 2024-01-16 328194/week @ 2024-01-23 328377/week @ 2024-01-30 332140/week @ 2024-02-06 361290/week @ 2024-02-13 384298/week @ 2024-02-20 352339/week @ 2024-02-27 356413/week @ 2024-03-05 343986/week @ 2024-03-12 303785/week @ 2024-03-19

1,427,533 downloads per month
Used in 1,021 crates (8 directly)

Apache-2.0 OR MIT

58KB
1K SLoC

RustCrypto: GHASH

crate Docs Apache2/MIT licensed Rust Version Build Status HAZMAT

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

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

~275–445KB