Function cryptonight::cryptonight[][src]

pub fn cryptonight(data: &[u8], size: usize, variant: i32) -> Vec<u8>

Computes the hash of (which consists of bytes), returning the hash (32 bytes).

Arguments

Example

struct Test {
    input: Vec<u8>,
    output: Vec<u8>,
    variant: i32,
}
let test = Test{
input:"38274c97c45a172cfc97679870422e3a1ab0784960c60514d81627141\
5c306ee3a3ed1a77e31f6a885c3cb".from_hex().unwrap(),
output:"ed082e49dbd5bbe34a3726a0d1dad981146062b39d36d62c71eb1ed8\
ab49459b".from_hex().unwrap(),
variant:1
};
let out = cryptonight(&test.input[..], test.input.len(), test.variant);
assert_eq!(out, test.output);

Reference

https://cryptonote.org/cns/cns008.txt