Crate BlueHash

Crate BlueHash 

Source
Expand description

BlueHash: A cryptographic hash function with quantum-resistant features. This library implements the BlueHash algorithm, designed to resist quantum attacks while maintaining high security. It includes state manipulation, constant generation, and noise-based perturbations inspired by lattice-based cryptography.

Full details and source code: https://github.com/blueokanna/BlueHash.

§BlueHash Usage Example (BlueHash128)

use BlueHash::DigestSize;
use std::fmt::Write;
use BlueHash::Digest;
use BlueHash::BlueHashCore;

fn main() {
let test_data = b"Hello, world! This is a test message for BlueHash";
    let mut hasher128 = BlueHashCore::new(DigestSize::Bit128);
    hasher128.update(test_data);
    let result128 = hasher128.finalize();
    println!("BlueHash128 Result: {}", to_hex_string(&result128));
}

// Helper function to convert bytes to a hexadecimal string
fn to_hex_string(bytes: &[u8]) -> String {
    let mut hex = String::new();
    for byte in bytes {
        write!(&mut hex, "{:02x}", byte).unwrap();
    }
    hex
}

You may also refer to the BlueHash readme for more information.

BlueHash: A cryptographic hash function with quantum-resistant features.

This library implements the BlueHash algorithm, designed to resist quantum attacks while maintaining high security. It includes state manipulation, constant generation, and noise-based perturbations inspired by lattice-based cryptography.

Structs§

BlueHashCore
Core structure for the BlueHash algorithm.

Enums§

DigestSize
Represents the available digest sizes for BlueHash.

Traits§

Digest
Trait defining a cryptographic hash function.

Functions§

generate_constants
Generate constant functions, support generics and high safety
generate_lwe_noise
Generic safe LWE noise generator
permute_core
Helper function to perform the common permutation logic Optimized permutation using SIMD when available
to_u64
Converts a slice of bytes into a 64-bit unsigned integer.