crypto::poly1305 +linux +x86_64

This module provides the poly1305 MAC as defined in RFC 8439.

This is a low-level module which implements cryptographic primitives. Direct use of cryptographic primitives is not recommended for non-experts, as incorrect use of these primitives can easily lead to the introduction of security vulnerabilities. Non-experts are advised to use the high-level operations available in the top-level crypto module.

Be advised that Hare's cryptography implementations have not been audited.



type key;

// Undocumented types:
type state;


const BLOCKSIZE: size;
const SIZE: size;


fn init(*state, *key) void;
fn poly1305() state;


type key[link]

type key = [32]u8;

Poly1305 key.

type state[link]

Show undocumented member
type state = struct {
	r: [4]u32,
	h: [5]u32,
	c: [16]u8,
	pad: [4]u32,
	cidx: size,


def BLOCKSIZE[link]

def BLOCKSIZE: size;

Internal block size in bytes.

def SIZE[link]

def SIZE: size;

Length of the resulting MAC in bytes.


fn init[link]

fn init(p: *state, key: *key) void;

Initialises the MAC with given one time key.

fn poly1305[link]

fn poly1305() state;

Creates a crypto::mac::mac that computes the poly1305 MAC. It needs to be initialised using init. Like the other MACs it needs to be finished using crypto::mac::finish after use.