ec suite_b: Make oneRR_mod_n private.
This commit is contained in:
parent
f55712e909
commit
ed2b1d7054
@ -156,10 +156,7 @@ impl EcdsaKeyPair {
|
||||
) -> Result<Self, error::KeyRejected> {
|
||||
let (seed, public_key) = key_pair.split();
|
||||
let d = private_key::private_key_as_scalar(alg.private_key_ops, &seed);
|
||||
let d = alg
|
||||
.private_scalar_ops
|
||||
.scalar_ops
|
||||
.scalar_product(&d, &alg.private_scalar_ops.oneRR_mod_n);
|
||||
let d = alg.private_scalar_ops.to_mont(&d);
|
||||
|
||||
let nonce_key = NonceRandomKey::new(alg, &seed, rng)?;
|
||||
Ok(Self {
|
||||
|
@ -321,7 +321,13 @@ impl PublicScalarOps {
|
||||
pub struct PrivateScalarOps {
|
||||
pub scalar_ops: &'static ScalarOps,
|
||||
|
||||
pub oneRR_mod_n: Scalar<RR>, // 1 * R**2 (mod n). TOOD: Use One<RR>.
|
||||
oneRR_mod_n: Scalar<RR>, // 1 * R**2 (mod n). TOOD: Use One<RR>.
|
||||
}
|
||||
|
||||
impl PrivateScalarOps {
|
||||
pub fn to_mont(&self, s: &Scalar<Unencoded>) -> Scalar<R> {
|
||||
self.scalar_ops.scalar_product(s, &self.oneRR_mod_n)
|
||||
}
|
||||
}
|
||||
|
||||
// XXX: Inefficient and unnecessarily depends on `PrivateKeyOps`. TODO: implement interleaved wNAF
|
||||
|
Loading…
x
Reference in New Issue
Block a user