Skip to main content

stretch

Function stretch 

Source
pub fn stretch(hashes: [[u32; 4]; 16], additional_hashes: u32) -> [[u32; 4]; 16]
Expand description

multiversion! MD5 key stretching implementation.

For example, passing 2 will return hash(to_hex(hash(to_hex(hash)))) for each lane.

ยงExamples

For array128 with four lanes:

let hashes = array128::hash(b"hwafeobglrchlldiodej");
assert_eq!(
    array128::stretch(hashes, 2),
    hashes.map(|hash| md5::hash(&md5::to_hex(md5::hash(&md5::to_hex(hash))))),
);