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

Rust wrappers for hash and merkle API #614

Merged
merged 25 commits into from
Sep 24, 2024
Merged

Rust wrappers for hash and merkle API #614

merged 25 commits into from
Sep 24, 2024

Conversation

yshekel
Copy link
Collaborator

@yshekel yshekel commented Sep 18, 2024

No description provided.


Hash create_sha3_256_hash(uint64_t input_chunk_size)
{
std::shared_ptr<HashBackend> backend;
ICICLE_CHECK(Keccak256Dispatcher::execute(input_chunk_size, backend));
ICICLE_CHECK(Sha3_256Dispatcher::execute(input_chunk_size, backend));
Hash keccak{backend};
return keccak;
}

// Keccak 512
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// Sha3 512

// TODO implement
ICICLE_LOG_DEBUG << "Keccak/sha3 CPU hash() called, batch=" << config.batch
<< ", single_output_size=" << output_size();
// TODO implement real logic
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefer to add asserion

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it's just that it will fail in CI. Aviad has a PR for that already.

None, // No padding, assume input is correctly sized.
ZeroPadding, // Pad the input with zeroes to fit the expected input size.
LastValue, // Pad the input by repeating the last value.
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need other padding policies, such as Random Padding, Repeat Padding, etc.?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably yes but we will have to implement them separately

@yshekel yshekel merged commit e1a5665 into main Sep 24, 2024
28 checks passed
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

Successfully merging this pull request may close these issues.

4 participants