mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-02-21 22:33:09 +00:00
No functional changes here. The biggest change was moving certain files into new directories like `plonk` and `iop` (for things like `Challenger` that could be used in STARKs or other IOPs). I also split a few files, renames, etc, but again nothing functional, so I don't think a careful review is necessary (just a sanity check).
28 lines
562 B
Rust
28 lines
562 B
Rust
//! Performs a single exponentiation.
|
|
|
|
use std::time::Instant;
|
|
|
|
use plonky2::field::crandall_field::CrandallField;
|
|
use plonky2::field::field_types::Field;
|
|
|
|
type F = CrandallField;
|
|
|
|
const EXPONENT: usize = 1000000000;
|
|
|
|
fn main() {
|
|
let base = F::rand();
|
|
let mut state = F::ONE;
|
|
|
|
let start = Instant::now();
|
|
for _ in 0..EXPONENT {
|
|
state *= base;
|
|
}
|
|
let duration = start.elapsed();
|
|
|
|
println!("Result: {:?}", state);
|
|
println!(
|
|
"Average field mul: {:?}ns",
|
|
duration.as_secs_f64() * 1e9 / EXPONENT as f64
|
|
);
|
|
}
|