Skip to main content

Crate hiae

Crate hiae 

Source
Expand description

§HiAE - High-throughput Authenticated Encryption

This crate provides an implementation of the HiAE (High-throughput Authenticated Encryption) algorithm as specified in the IETF Internet-Draft.

HiAE is designed for high-performance authenticated encryption with cross-platform efficiency, particularly optimized for both ARM NEON and x86-64 AES-NI architectures.

§Features

  • High Performance: Leverages platform-specific SIMD instructions (ARM NEON, x86-64 AES-NI)
  • Security: 256-bit keys, 128-bit nonces and tags
  • Cross-Platform: Optimized for both ARM and x86 architectures
  • No-std Compatible: Can be used in embedded environments

On the hardware-accelerated backends, processing is constant time. The portable fallback used on other targets relies on table lookups and is not constant time.

§Usage

use hiae::{encrypt, decrypt};

let key = [0u8; 32];      // 256-bit key
let nonce = [0u8; 16];    // 128-bit nonce
let plaintext = b"Hello, world!";
let aad = b"additional data";

// Encrypt
let (ciphertext, tag) = encrypt(plaintext, aad, &key, &nonce)?;

// Decrypt
let decrypted = decrypt(&ciphertext, &tag, aad, &key, &nonce)?;
assert_eq!(decrypted, plaintext);

Enums§

Error
Errors that can occur during HiAE operations.

Functions§

decrypt
Decrypts ciphertext and verifies the authentication tag.
decrypt_into
Decrypts ciphertext into a caller-provided buffer, avoiding allocation.
encrypt
Encrypts plaintext with associated data using HiAE.
encrypt_into
Encrypts plaintext into a caller-provided buffer, avoiding allocation.

Type Aliases§

Result
Result type alias for HiAE operations.