sharplispers / ironclad

A cryptographic toolkit written in Common Lisp
BSD 3-Clause "New" or "Revised" License
166 stars 28 forks source link

Type error in sha3-finalize #62

Closed stassats closed 1 year ago

stassats commented 1 year ago

The declaration (type (integer 0 64) output-byte-length) in https://github.com/sharplispers/ironclad/blob/master/src/digests/sha3.lisp#L454

is not true for some types of state, but this is usually hidden by (safety 0).

Either removing the declaration or doing (sb-ext:restrict-compiler-policy 'safety 3) and recompiling:

3 out of 568 total tests failed: :SHAKE128, :SHAKE256, :ED448-SIGNATURE.

glv2 commented 1 year ago

Fixed in 6da010fea49a4edf075943e20f8ec7adea0d9d65. Thanks.