diff options
Diffstat (limited to 'crypto/src/math/ec/custom/sec/SecP224K1Field.cs')
-rw-r--r-- | crypto/src/math/ec/custom/sec/SecP224K1Field.cs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/crypto/src/math/ec/custom/sec/SecP224K1Field.cs b/crypto/src/math/ec/custom/sec/SecP224K1Field.cs index edc938d22..ce07eff67 100644 --- a/crypto/src/math/ec/custom/sec/SecP224K1Field.cs +++ b/crypto/src/math/ec/custom/sec/SecP224K1Field.cs @@ -98,6 +98,18 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec } } + public static void Reduce32(uint x, uint[] z) + { + uint c = Nat224.Mul33WordAdd(PInv33, x, z, 0); + + Debug.Assert(c == 0 || c == 1); + + if (c != 0 || (z[6] == P6 && Nat224.Gte(z, P))) + { + Nat224.AddDWord(PInv, z, 0); + } + } + public static void Square(uint[] x, uint[] z) { uint[] tt = Nat224.CreateExt(); |