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

Implement internal BLAKE3 hashing example #1181

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

Fumuran
Copy link
Contributor

@Fumuran Fumuran commented Dec 12, 2023

This PR introduces new internal example: sequential calculation of 1-to-1 BLAKE3 hash.
As well as the fibonacci example it could be used with example subcommand:

./target/optimized/miden example [name]

@Fumuran Fumuran requested a review from bobbinth December 12, 2023 16:27
Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

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

Thank you! Looks good! I left a few comments inline.

CHANGELOG.md Outdated Show resolved Hide resolved
docs/src/intro/usage.md Outdated Show resolved Hide resolved
miden/src/examples/mod.rs Outdated Show resolved Hide resolved
miden/Cargo.toml Outdated Show resolved Hide resolved
miden/src/examples/blake3.rs Outdated Show resolved Hide resolved
miden/src/examples/blake3.rs Outdated Show resolved Hide resolved
miden/src/examples/blake3.rs Show resolved Hide resolved
@Fumuran Fumuran requested a review from bobbinth December 13, 2023 16:04
Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you! I left a couple of nits inline - after these, we can merge.

miden/Cargo.toml Outdated
clap = { version = "4.4", features = ["derive"], optional = true }
env_logger = { version = "0.10", default-features = false, optional = true }
hex = { version = "0.4", optional = true }
log = { version = "0.4", default-features = false, optional = true }
vm-core = { package = "miden-core", path = "../core", version = "0.8", default-features = false }
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: could we put this into alphabetical order?

@@ -50,11 +51,18 @@ pub struct ExampleOptions {
//#[clap(about = "available examples")]
pub enum ExampleType {
/// Compute a Fibonacci sequence of the specified length
Fib {
Fibonacci {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I'd probably keep the old name (unless there is a good reason to change it?).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I decided to change it because this name defines what name we will use in the CLI call. So instead of
miden example fib -n 1000
we could call
miden example fibonacci -n 1000
I thought that name fib could be unclear, but it is not a big deal — I can change it back to the old name.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think fib is fine as it is easier to type :)

@Fumuran Fumuran force-pushed the andrew-blake3-internal-example branch from 1f092c4 to 7be367d Compare December 14, 2023 10:35
@Fumuran Fumuran merged commit e16f8f1 into next Dec 14, 2023
15 checks passed
@Fumuran Fumuran deleted the andrew-blake3-internal-example branch December 14, 2023 10:42
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.

2 participants