File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44// file LICENCE or http://www.opensource.org/licenses/mit-license.php.
55
66using System ;
7+ using System . Numerics ;
78
89namespace FinderOuter . Backend
910{
@@ -71,5 +72,10 @@ public struct ConstantsFO
7172 [ 'X' , 'x' ] ,
7273 [ 'Z' , 'z' ] ,
7374 ] ;
75+
76+ /// <summary>
77+ /// N = FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141
78+ /// </summary>
79+ public static readonly BigInteger CurveOrder = BigInteger . Parse ( "115792089237316195423570985008687907852837564279074904382605163141518161494337" ) ;
7480 }
7581}
Original file line number Diff line number Diff line change 44// file LICENCE or http://www.opensource.org/licenses/mit-license.php.
55
66using Autarkysoft . Bitcoin ;
7- using Autarkysoft . Bitcoin . Cryptography . Asymmetric . EllipticCurve ;
87using Autarkysoft . Bitcoin . Cryptography . EllipticCurve ;
98using Autarkysoft . Bitcoin . Cryptography . EllipticCurve . Primitives ;
109using FinderOuter . Backend ;
@@ -37,7 +36,6 @@ public ArmoryService(IReport rep)
3736 private int [ ] missingIndexes ;
3837 private bool hasChainCode ;
3938 private byte [ ] chainCode ;
40- private readonly BigInteger N = new SecP256k1 ( ) . N ;
4139
4240
4341
Original file line number Diff line number Diff line change @@ -142,8 +142,7 @@ private void WifLoopMissingEnd(bool compressed)
142142 BigInteger diff = end - start + 1 ;
143143 report . AddMessageSafe ( $ "Using an optimized method checking only { diff : n0} keys.") ;
144144
145- Autarkysoft . Bitcoin . Cryptography . Asymmetric . EllipticCurve . SecP256k1 curve = new ( ) ;
146- if ( start == 0 || end >= curve . N )
145+ if ( start == 0 || end >= ConstantsFO . CurveOrder )
147146 {
148147 report . AddMessageSafe ( "There is something wrong with the given key, it is outside of valid key range." ) ;
149148 return ;
You can’t perform that action at this time.
0 commit comments