bcgit / pc-dart

Pointy Castle - Dart Derived Bouncy Castle APIs
MIT License
237 stars 122 forks source link

[SEVERE] Blake2bDigest: fix wrong buffer passed to`_compress` when `_digestLength` < 64 #108

Closed gmpassos closed 3 years ago

gmpassos commented 3 years ago

The correct variable to be passed to _compress is _buffer, that was populated 3 lines above, not the method parameter inp.

To test this changed line you should create a Blake2bDigest with digestSize = 32.

See equivalent Java implementation line as reference: https://github.com/bcgit/bc-java/blob/master/core/src/main/java/org/bouncycastle/crypto/digests/Blake2bDigest.java#L353

mwcw commented 3 years ago

Hi, Thanks for reporting this!

It has been merged and will be synced shortly along with a new release.

MW