NEWTON
Asked
26 days ago
26
views
0
why does keccak256 replace sha256 in warp transpiler? I want to know: are they technically identical or different?
I am asking because I haven't the support of sha256 on Github
vargastartup
asked
26 days ago
0
Accepted answer
No their results are different, we recommend using keccak256 because the Cairo standard library has an implementation for it so Warp can support it. There is no sha256 implementation in the Cairo standard library yet. Since both of them output a 256 bit key in most cases you can replace sha256 with keccak256, there might other considerations to make depending on your protocol, example if there is an off-chain sha256 being checked on chain then you'll need to change the off-chain component. Additionally in real world solidity codebases we did not observe sha256 being used a lot, so its lower on our priority list compared to other features.
0x25f2...C58830
answered
26 days ago
What hashing functions are available in Cairo? How are they secure?
How to modify keccak.cairo and/or packed_keccak.cairo to compute a 512bits keccak hash instead of 256 bits?
Cairo: How to reassign Uint256 in a conditional
How can I change solc compiler version in warp?
Is there a Cairo equivalent to Keccak256(abi.encode(parameters))?
Nethermind's warp error: JavaScript heap out of memory
How to transpile multiple contracts at once using warp?
What libraries are secure to use in Cairo?
How to submit a StarkNet contract?
Is it possible to import local python files into hints?
ApeWorX: How do I fund newly created accounts from the ape console?
Checking result of an L1 -> L2 message/invoke in Starknet
Declaring a StarkNet contract on DevNet with Account(), but I get GatewayError in StarkNetJS
How do you optimize gas in Cairo with Uint256/felt?