Post
Topic
Board Development & Technical Discussion
Merits 2 from 2 users
Re: Bitcoin brainwallet implementation in Rust
by
pooya87
on 06/11/2021, 04:10:58 UTC
⭐ Merited by PrimeNumber7 (1) ,ETFbitcoin (1)
Do you have a test case which creates this error?
No because as I said this is highly unlikely. You are basically looking for an input (seed variable) that could produce a SHA256 hash that is between N and 2256 and that range is very small in comparison to 1 to N range.

What you could do for this test is to split the "create_key_pair" method into two parts, one computes the hash and the other creates the key pair. Now you can feed any hash result you want to the second method like 2256 and see how it fails.