-
Notifications
You must be signed in to change notification settings - Fork 1
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
Prime factorization example #17
base: main
Are you sure you want to change the base?
Conversation
} | ||
} | ||
|
||
pub fn check_prime_factorization(x: u32, ys: Vec<u32>) -> bool { |
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.
NIT: &[u32]
or impl AsRef<[u32]>
is more idiomatic.
# Fibonacci: A template project for Valida | ||
|
||
This is a simple program that calculates the n-th fibonacci number and proves the execution of the computation in Valida. You can use this as a template for your projects which create Valida proofs of execution of Rust code. | ||
|
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.
This is out of date
let mut z = 1; | ||
for y in ys { | ||
z *= y; | ||
} | ||
z == x |
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.
This is just a factorization check, we are not checking if each y is prime.
@@ -0,0 +1,201 @@ | |||
Apache License |
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.
do we need another license for each crate? There's one in the main directory.
|
||
pub fn main() { | ||
valida_rs::io::println("Please enter a 32-bit number:"); | ||
// Read a line from stdin and parse it as an u8. |
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.
u32 instead of u8
No description provided.