diff options
Diffstat (limited to 'crypto/src/math/ec/custom/sec/SecP256R1Curve.cs')
-rw-r--r-- | crypto/src/math/ec/custom/sec/SecP256R1Curve.cs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/crypto/src/math/ec/custom/sec/SecP256R1Curve.cs b/crypto/src/math/ec/custom/sec/SecP256R1Curve.cs index 7cc456b2d..b90f5d048 100644 --- a/crypto/src/math/ec/custom/sec/SecP256R1Curve.cs +++ b/crypto/src/math/ec/custom/sec/SecP256R1Curve.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Math.Raw; +using Org.BouncyCastle.Security; using Org.BouncyCastle.Utilities.Encoders; namespace Org.BouncyCastle.Math.EC.Custom.Sec @@ -92,6 +93,20 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec return new SecP256R1LookupTable(this, table, len); } + public override ECFieldElement RandomFieldElement(SecureRandom r) + { + uint[] x = Nat256.Create(); + SecP256R1Field.Random(r, x); + return new SecP256R1FieldElement(x); + } + + public override ECFieldElement RandomFieldElementMult(SecureRandom r) + { + uint[] x = Nat256.Create(); + SecP256R1Field.RandomMult(r, x); + return new SecP256R1FieldElement(x); + } + private class SecP256R1LookupTable : AbstractECLookupTable { |