Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why next_address function Argument is not 64bit of Little endian ? #374

Open
watason opened this issue May 30, 2024 · 0 comments
Open

why next_address function Argument is not 64bit of Little endian ? #374

watason opened this issue May 30, 2024 · 0 comments

Comments

@watason
Copy link

watason commented May 30, 2024

Why is the argument of the next_address function not 64-bit little endian?
Right now I am implementing Argon2 for my study.
I was referring to RFCs and papers, but one question occurred to me.
When the RFC requires 32bit little endian, it is implemented as a LE byte array using store32.

However, the input_block input to the next_address function is 64bit and not converted to LE64.
The RFC states the following and also on page 6 of the paper

Z= ( LE64(r) || LE64(l) || LE64(sl) || LE64(m') ||
     LE64(t) || LE64(y) )

Even if the subsequent calculation is optimized according to the calculator, the compression function G process itself is not changed, so the output value would be different.
In other words.

    if (data_independent_addressing) {
        init_block_value(&input_block, 0);

        input_block.v[0] = position.pass;
        input_block.v[1] = position.lane;
        input_block.v[2] = position.slice;
        input_block.v[3] = instance->memory_blocks;
        input_block.v[4] = instance->passes; instance->passes; instance->passes
        input_block.v[5] = instance->type; instance->type; }
    }

This is.

    if (data_independent_addressing) {
        init_block_value(&input_block, 0);

        input_block.v[0] = store64(position.pass);
...
    }

If I don't do this, won't the Argon2i index be different from what is supposed to be?
Thank you in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant