@@ -1566,28 +1566,41 @@ base64DecodeWithShimmedErrors i txt = do
1566
1566
hashDefs :: NativeModule
1567
1567
hashDefs = (" Hashes" ,)
1568
1568
[ poseidonHackAChainDef
1569
+ , poseidonHashAliasDef
1569
1570
, keccak256Def
1570
1571
]
1571
1572
1572
1573
poseidonHackAChainDef :: NativeDef
1573
1574
poseidonHackAChainDef = defGasRNative
1574
1575
" poseidon-hash-hack-a-chain"
1575
- poseidon'
1576
+ poseidonImpl
1576
1577
(funType tTyInteger [(" i" , tTyInteger), (" j" , tTyInteger), (" k" , tTyInteger), (" l" , tTyInteger), (" m" , tTyInteger), (" n" , tTyInteger), (" o" , tTyInteger), (" p" , tTyInteger)])
1577
1578
[" (poseidon-hash-hack-a-chain 1)"
1578
1579
," (poseidon-hash-hack-a-chain 1 2)"
1579
1580
," (poseidon-hash-hack-a-chain 1 2 3 4 5 6)"
1580
1581
," (poseidon-hash-hack-a-chain 1 2 3 4 5 6 7 8)"
1581
1582
]
1582
1583
" Poseidon Hash Function. Note: This is a reference version of the Poseidon hash function used by Hack-a-Chain."
1583
- where
1584
- poseidon' :: RNativeFun e
1585
- poseidon' i as
1586
- | not (null as) && length as <= 8 ,
1587
- Just intArgs <- traverse (preview _TLitInteger) as
1588
- = computeGas' i (GPoseidonHashHackAChain $ length as) $
1589
- return $ toTerm $ poseidon intArgs
1590
- | otherwise = argsError i as
1584
+
1585
+ poseidonHashAliasDef :: NativeDef
1586
+ poseidonHashAliasDef = defGasRNative
1587
+ " hash-poseidon"
1588
+ poseidonImpl
1589
+ (funType tTyInteger [(" i" , tTyInteger), (" j" , tTyInteger), (" k" , tTyInteger), (" l" , tTyInteger), (" m" , tTyInteger), (" n" , tTyInteger), (" o" , tTyInteger), (" p" , tTyInteger)])
1590
+ [" (hash-poseidon 1)"
1591
+ ," (hash-poseidon 1 2)"
1592
+ ," (hash-poseidon 1 2 3 4 5 6)"
1593
+ ," (hash-poseidon 1 2 3 4 5 6 7 8)"
1594
+ ]
1595
+ " Poseidon Hash Function. This is an alias of 'poseidon-hash-hack-a-chain'."
1596
+
1597
+ poseidonImpl :: RNativeFun e
1598
+ poseidonImpl i as
1599
+ | not (null as) && length as <= 8 ,
1600
+ Just intArgs <- traverse (preview _TLitInteger) as
1601
+ = computeGas' i (GPoseidonHashHackAChain $ length as) $
1602
+ return $ toTerm $ poseidon intArgs
1603
+ | otherwise = argsError i as
1591
1604
1592
1605
keccak256Def :: NativeDef
1593
1606
keccak256Def = defGasRNative
0 commit comments