Post
Topic
Board Development & Technical Discussion
Merits 1 from 1 user
Re: Valid 256-bit Private Keys (Not All of Them Are)
by
d34thkn3ll
on 22/07/2018, 10:45:03 UTC
⭐ Merited by butka (1)
Excuse me, but why are you treating it as a decimal number rather than a binary?
It doesn't matter how you treat it or what numeral system (decimal, binary, hexadecimal,...) your code uses, as long as it is the same number.
Why is it the same number?

I added the 0b preffix to the number and got "Generator point has x or y out of range." quod erat demonstrandum.
Quick digging into the code shows that in the multiplication operator there is a modulo operation:
Code:
if self.__order: e = e % self.__order
so it doesn't matter how big number you use, the operation will be done with its modulus (which is no bigger than 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 by the definition)