INNER CODE UNIT · Rust

memory_blocks

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

    let memory_blocks = if m_cost < 2 * ARGON2_SYNC_POINTS * parallelism {
        2 * ARGON2_SYNC_POINTS * parallelism
    } else {
        m_cost
    };

    let segment_length = memory_blocks / (parallelism * ARGON2_SYNC_POINTS);
    /* Ensure that all segments have equal length */
    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

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…