a little bit more inlining...

This commit is contained in:
Balazs Komuves 2026-01-23 13:19:03 +01:00
parent e3c83cbcad
commit 8dbb8fe359
No known key found for this signature in database
GPG Key ID: F63B7AEF18435562
2 changed files with 4 additions and 0 deletions

View File

@ -147,6 +147,7 @@ fn main() {
let elapsed = now.elapsed();
println!("Elapsed: {:.3?}", elapsed);
/*
println!("");
println!("sanity checking comparison with the prime");
let one : Big = BigInt::from_u32(1);
@ -160,6 +161,7 @@ fn main() {
BigInt::is_lt_prime(&a) ,
BigInt::is_lt_prime(&b) ,
BigInt::is_lt_prime(&c) );
*/
//----------------------------------------------------------------------------

View File

@ -11,12 +11,14 @@ pub type MontTriple = (Mont,Mont,Mont);
//------------------------------------------------------------------------------
#[inline(always)]
fn sbox(x: Mont) -> Mont {
let x2 = Mont::sqr(&x );
let x4 = Mont::sqr(&x2);
Mont::mul(&x,&x4)
}
#[inline(always)]
fn add3(x: Mont, y: Mont, z: Mont) -> Mont {
Mont::add(&Mont::add(&x,&y),&z)
}