INNER CODE UNIT · Rust

load_block

brndnmtthws/dryoc · src/argon2/mod.rs:761

fn load_block(block: &mut Block, input: &[u8]) {
    let (words, _) = input.as_chunks::<8>();
    for (word, bytes) in block.v.iter_mut().zip(words) {
        *word = u64::from_le_bytes(*bytes);
    }
}

fn store_block(output: &mut [u8], block: &Block) {
    let (words, _) = output.as_chunks_mut::<8>();
    for (bytes, word) in words.iter_mut().zip(block.v.iter()) {
        *bytes = word.to_le_bytes();
    }
}

#[cfg(test)]
mod tests {
    #[cfg(feature = "nightly")]
    extern crate test;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…