talaia-labs / rust-teos

The Eye of Satoshi - Lightning Watchtower
https://talaia-labs.github.io/talaia.watch/
MIT License
134 stars 63 forks source link

teos-common: Fixes cryptography tests utils #245

Closed sr-gi closed 5 months ago

sr-gi commented 11 months ago

I recently realized that teos-common::cryptography::get_random_keypair was potentially incorrect.

The bytes used to generate the SecretKey were created outside the testing loop, meaning that if they didn't yield a valid secret key for whatever reason, the function would loop forever. I don't think this can really be the case, but this patch is certainly more correct than the older approach.