poly1305

Crates.iopoly1305
lib.rspoly1305
version0.9.0-rc.2
created_at2016-10-06 21:34:24.248885+00
updated_at2025-09-03 03:25:11.497339+00
descriptionThe Poly1305 universal hash function and message authentication code
homepage
repositoryhttps://github.com/RustCrypto/universal-hashes
max_upload_size
id6767
size173,635
MACs (github:rustcrypto:macs)

documentation

https://docs.rs/poly1305

README

RustCrypto: Poly1305

crate Docs Build Status Apache2/MIT licensed Rust Version Project Chat HAZMAT

Poly1305 is a universal hash function which, when combined with a cipher, can be used as a Message Authentication Code (MAC).

It takes a 32-byte one-time key and an arbitrary-length message and produces a 16-byte tag, which can be used to authenticate the message.

In practice, Poly1305 is primarily combined with ciphers from the Salsa20 Family such as in ChaCha20Poly1305 and XSalsa20Poly1305 (a.k.a. NaCl crypto_secretbox).

Security

⚠️ Warning: Hazmat!

Universal hash functions have subtle security properties and are primarily intended as a building block for constructions like AEAD algorithms.

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.

NOTE: the audit predates the AVX2 backend, which has not yet been audited.

All implementations contained in the crate are designed to execute in constant time, either by relying on hardware intrinsics (e.g. 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.

Commit count: 273

cargo fmt