Skip to main content

libcrux_poly1305/
lib.rs

1#![no_std]
2
3/// The length of Poly1305 keys (r: 16 bytes + s: 16 bytes).
4pub const KEY_LEN: usize = 32;
5
6/// The length of Poly1305 MAC tags.
7pub const TAG_LEN: usize = 16;
8
9/// Describes the error conditions of the Poly1305 MAC.
10pub enum Error {
11    /// Indicates that the message argument is too large for the library to handle.
12    MessageTooLarge,
13
14    /// Indicates that the MAC tag is invalid for that key and message.
15    InvalidMacTag,
16}
17
18#[cfg(not(feature = "expose-hacl"))]
19mod hacl {
20    pub(crate) mod mac_poly1305;
21}
22
23#[cfg(feature = "expose-hacl")]
24pub mod hacl {
25    pub mod mac_poly1305;
26}
27
28mod impl_hacl;
29
30pub use impl_hacl::*;