crypto-primitives icon indicating copy to clipboard operation
crypto-primitives copied to clipboard

Inconsistencies in the Blake2s implementation

Open ii-cruz opened this issue 1 year ago • 1 comments

On #103 the parameters function was removed from the Blake2sWithParameterBlock. However, for prf::blake2s::constraints::evaluate_blake2s_with_parameters, we need the parameters formatted as [u32; 8] as an argument, which would be exposed by calling the removed function.

Additionally, the non-constraint evaluate function now only runs in Mac mode. Even if no key is provided, a full 0-padded block is prefixed. This is different from the constraint behavior.

ii-cruz avatar Feb 17 '23 10:02 ii-cruz

Moreover, the change in the Blake2sWithParameterBlock struct removed the possibility to run the Blake2X algorithm for an extensible-output function.

To be fair, it seems that the blake2 crate doesn't support XOFs anymore. The constraint implementation technically still supports it with a custom parameter block.

paberr avatar Feb 17 '23 11:02 paberr