James-E-A / mentalDarkChess

trustless implementation of Dark Chess
0 stars 0 forks source link

better validation of candidate public keys #13

Closed James-E-A closed 2 years ago

James-E-A commented 2 years ago

current process is simply trash: 662d46a:src/criptogrvfy.py#L6

does pyca/cryptography have this functionality? I already checked, but the OpenSSL source code is friggin inscrutable

James-E-A commented 2 years ago

While that test is perfectly suitable as it removes only invalid keys, and removes half of all bitstrings on average, there appear to be elegant alternatives to rejection sampling already extant.

James-E-A commented 2 years ago

perfectly suitable

Well, at least, I thought so… I could be hallucinating, but I thought I saw the warning introduced in 462f4c394f5b2cbf6d5c43713a37457b21ec8d9a go off once.

TODO: print the rejected private key when that codepath is activated

James-E-A commented 2 years ago

Fixed in de3edaf152c1ba5d5ce7335fb3a70a0ccee1b252