poseidonBn254Hash method
circomlib-compatible Poseidon over BN254 Fr (Sui zkLogin / Aptos
keyless). inputs is concatenated 32-byte LE Fr elements (1..64);
returns the 32-byte LE digest. Native backends built without the Rust
poseidon-bn254 feature throw unsupported.
Implementation
@override
BuBytes poseidonBn254Hash(List<int> inputs) {
if (inputs.length % 32 != 0) {
throw CoreErrors.invalidOperationArguments(
'poseidonBn254Hash',
name: 'inputs',
reason: 'Expected concatenated 32-byte elements.',
);
}
final n = inputs.length ~/ 32;
if (n < 1 || n > 64) {
throw CoreErrors.invalidOperationArguments(
'poseidonBn254Hash',
name: 'inputs',
reason: 'Expected 1..64 field elements, got $n.',
);
}
return inner.poseidonBn254Hash(inputs);
}