-
Notifications
You must be signed in to change notification settings - Fork 704
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ec suite_b: Define scalar_mul_mont wrappers in Rust.
Take a step towards eliminating `prefixed_export!` by eliminating one C user of `bn_mul_mont`.
- Loading branch information
1 parent
40e147d
commit 751f76e
Showing
9 changed files
with
87 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
macro_rules! mul_mont { | ||
{ $visibility:vis $name:ident(n0: $n0:expr; modulus: $modulus:expr) } => { | ||
$visibility unsafe extern "C" fn $name( | ||
r: *mut crate::limb::Limb, // [COMMON_OPS.num_limbs] | ||
a: *const crate::limb::Limb, // [COMMON_OPS.num_limbs] | ||
b: *const crate::limb::Limb, // [COMMON_OPS.num_limbs] | ||
) { | ||
use crate::arithmetic::montgomery::{bn_mul_mont, N0}; | ||
static N_N0: N0 = N0::precalculated($n0); | ||
bn_mul_mont( | ||
r, | ||
a, | ||
b, | ||
$modulus.limbs.as_ptr(), | ||
&N_N0, | ||
COMMON_OPS.num_limbs, | ||
) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters