firoorg / firo

The privacy-focused cryptocurrency
https://firo.org
MIT License
720 stars 354 forks source link

Check for diversifier overflow #1371

Closed AaronFeickert closed 11 months ago

AaronFeickert commented 12 months ago

PR intention

Checks for overflow during diversifier decryption.

Closes #1370.

Code changes brief

When a diversifier is decrypted, it is truncated if its length exceeds uint64_t bounds. This would only occur due to a malicious sender and should be rejected.

This PR checks the decrypted diversifier length. If it does not precisely match that of an encoded uint64_t, it throws an error.