hyperledger-archives / ursa

Hyperledger Ursa (a shared cryptographic library) has moved to end-of-life status, with the components of Ursa still in use moved to their relevant Hyperledger projects (AnonCreds, Indy, Aries and Iroha).
https://wiki.hyperledger.org/display/ursa
Apache License 2.0
321 stars 142 forks source link

Check for zero byte and points at infinity keys #142

Closed mikelodder7 closed 4 years ago

mikelodder7 commented 4 years ago

This PR checks for exceptional behavior in keys and values that could potentially lead to disastrous results like validating every signature even though I don't think this formally breaks the security of the scheme.

This could occur if the secret key is zero bytes which would result in a public key equal to the identity point.

The problem with allowing the identity point as a public key is that every signature under this public key is also the identity point, which means that a signer falsifies the message they signed.

It also checks makes sure random values are never zero.