-
Notifications
You must be signed in to change notification settings - Fork 96
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
CPU poseidon hash #611
base: main
Are you sure you want to change the base?
CPU poseidon hash #611
Conversation
… CI passing like that
Default on is necessary when loading a pre-built backend to avoid link errors.
const unsigned int nof_partial_rounds, | ||
const unsigned int nof_upper_full_rounds, | ||
const unsigned int nof_end_full_rounds, | ||
const S* rounds_constants, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you provide 4 arrays, why do you need the struct PoseidonConstants?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You wanted to put all matrices and round consts in a structure
const unsigned int m_nof_partial_rounds; ///< Partial number of rounds of this Poseidon hash. | ||
const unsigned int m_nof_upper_full_rounds; ///< Number of full rounds at the beginning of this Poseidon hash. | ||
const unsigned int m_nof_end_full_rounds; ///< Number of full rounds at the end of this Poseidon hash. | ||
PoseidonConstants<S> m_poseidon_constants; ///< Structure that holds Poseidon hash round constants and MDS matrix values. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it going to be more comfortable to just save the 4 vectors instead of this class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean? What class?
tmp_col_res[col_idx] = tmp_col_res[col_idx] + vec_in[row_idx] * matrix_in[row_idx * arity + col_idx]; | ||
} | ||
} | ||
for (int col_idx = 0; col_idx < arity; col_idx++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can avoid this copy
comment |
Describe the changes
This PR for CPU Poseidon hash (single hash and multiple hashes).
Linked Issues
Resolves #