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, constant-time operations
  • Cross-Platform: Optimized for both ARM and x86 architectures
  • Memory Safe: Implemented in Rust with secure memory management
  • No-std Compatible: Can be used in embedded environments

§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.
encrypt
Encrypts plaintext with associated data using HiAE.

Type Aliases§

Result
Result type alias for HiAE operations.