bcgit / pc-dart

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

Keccak processed data length bugfix #147

Closed YuriiBaryshev closed 2 years ago

YuriiBaryshev commented 2 years ago

Changes to updateByte function of Keccak.

Despite being stated as databitlen as a name of the third input of _doUpdate function, it appeared to be len (i.e. length in bytes) according to the way this input is processed in further absorbRange function. Therefore the bug appears, when updateByte function is called (by HMAC computation, for instance, see here the aforementioned calling).

Therefore this pull request fixes the bug and refactors the variable's name.

mwcw commented 2 years ago

Thanks a lot for submitting this.

This has been merged and will be synched shortly.

MW