INNER CODE UNIT · Rust

memory_blocks

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

    let memory_blocks = segment_length * (parallelism * ARGON2_SYNC_POINTS);

    let mut instance =
        Argon2Instance::new(memory_blocks, segment_length, type_, t_cost, parallelism)?;

    // 2. Initial hashing
    // H_0 + 8 extra bytes to produce the first blocks
    // Hashing all inputs
    let blockhash = argon2_initial_hash(&context, type_)?;
    // Zeroing 8 extra bytes

    // 3. Creating first blocks, we always have at least two blocks in a
    // slice
    argon2_fill_first_blocks(blockhash, &mut instance)?;

    for pass in 0..instance.passes {
        argon2_fill_memory_blocks(&mut instance, pass);
    }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…