talaia-labs / rust-teos

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

teos-common: Fixes cryptography tests utils #245

Closed sr-gi closed 8 months ago

sr-gi commented 1 year 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.