Closed
Description
See here: https://github.com/clearmatics/zeth/blob/develop/src/circuits/joinsplit.tcc#L269
HashT::get_digest_len()
returns asize_t
(https://github.com/clearmatics/zeth/blob/develop/src/circuits/blake2s/blake2s_comp.hpp#L105)FieldT:: capacity()
returns asize_t
(https://github.com/scipr-lab/libff/blob/master/libff/algebra/fields/fp.hpp#L115)
As such, the difference: https://github.com/clearmatics/zeth/blob/develop/src/circuits/joinsplit.tcc#L269 is a dangerous operation since it corresponds to a difference of unsigned integers (size_t is unsigned, see: https://en.cppreference.com/w/cpp/types/size_t). As such unexpected behavior will arise if FieldT:: capacity()
> HashT::get_digest_len()