diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2020-07-07 19:17:41 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2020-07-07 19:17:41 +0700 |
commit | c43f275ac1aca8af3010dd4d94efa1511ca18f42 (patch) | |
tree | 9ebad3642950a439b0bbdd70229bc895f4730b48 /crypto/src/math/ec/custom/sec/SecP256K1Field.cs | |
parent | EC updates from bc-java (diff) | |
download | BouncyCastle.NET-ed25519-c43f275ac1aca8af3010dd4d94efa1511ca18f42.tar.xz |
Fermat inversion for all custom curves
- also customized random FE gen
Diffstat (limited to 'crypto/src/math/ec/custom/sec/SecP256K1Field.cs')
-rw-r--r-- | crypto/src/math/ec/custom/sec/SecP256K1Field.cs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/src/math/ec/custom/sec/SecP256K1Field.cs b/crypto/src/math/ec/custom/sec/SecP256K1Field.cs index 1f11c9c78..2193c94e6 100644 --- a/crypto/src/math/ec/custom/sec/SecP256K1Field.cs +++ b/crypto/src/math/ec/custom/sec/SecP256K1Field.cs @@ -10,13 +10,13 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec internal class SecP256K1Field { // 2^256 - 2^32 - 2^9 - 2^8 - 2^7 - 2^6 - 2^4 - 1 - private static readonly uint[] P = new uint[]{ 0xFFFFFC2F, 0xFFFFFFFE, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, - 0xFFFFFFFF, 0xFFFFFFFF }; + internal static readonly uint[] P = new uint[]{ 0xFFFFFC2F, 0xFFFFFFFE, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; private static readonly uint[] PExt = new uint[]{ 0x000E90A1, 0x000007A2, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFFF85E, 0xFFFFFFFD, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; - private static readonly uint[] PExtInv = new uint[]{ 0xFFF16F5F, 0xFFFFF85D, 0xFFFFFFFE, 0xFFFFFFFF, 0xFFFFFFFF, - 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x000007A1, 0x00000002 }; + private static readonly uint[] PExtInv = new uint[]{ 0xFFF16F5F, 0xFFFFF85D, 0xFFFFFFFE, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x000007A1, 0x00000002 }; private const uint P7 = 0xFFFFFFFF; private const uint PExt15 = 0xFFFFFFFF; private const uint PInv33 = 0x3D1; |