Questions tagged [keccak]
keccak is a cryptographic family which is used in ethereum and nowerdays provides the standards for sha-3
206 questions
3 votes
0 answers
37 views
Any shake128, XOF, or Fiat-Shamir transcript implementation?
Are there any optimized shake128 implementations in solidity? Is it even possible to get much optimization from the keccak stuff supported by solidity? If not, are there any "nice" ...
2 votes
0 answers
48 views
Signature validation works only for contract owner, fails for other accounts
I’m working on a ICO claimTokens function that uses ECDSA signature verification, and I’ve run into a strange issue: everything works correctly when the contract owner calls the claim and tokens goes ...
1 vote
2 answers
141 views
help in understanding how contract ABI maps to transaction method / functions
I am trying to understand how ABI keccak-256 hash of the function gets mapped back. But I have trouble understanding this example. from this example transaction, which corresponds to this contract, ...
0 votes
1 answer
107 views
Get all event hashes for ABI
I have a smart contract ABI. What's the easiest way to compute the keccak256 hashes for the events in the contract?
0 votes
1 answer
112 views
Problem recovering public-key from signature using secp256k1 module
When i try to recover the pubklic key using : const publicKey = signature.recoverPublicKey(message_hash); It return a point Point { px: ...
1 vote
2 answers
69 views
web3.js Keccak256 giving different answer
Minimum reproducible example : hash1 = "be516d52220ea58966754101dd7ee25be73a695febd2bca54145681e2cc72fe9" hash2 = "edede15ad23aba32fd2613ffee105278e322b2d81314bcb66eb4c453ad072bd4" ...
2 votes
1 answer
102 views
C code to sign a message compatible (such that can be verified) with Metamask, mycrypto, etc
I am on macOS and trying to put together the code to sign (and once I succeed to verify) a message with an Ethereum private key. So, the private key (just used to test, no funds there lol) is: ...
1 vote
1 answer
115 views
Is the sum of hashes cryptographically secure for a set of addresses?
In a smart contract, I want to maintain a set of addresses independent of the order. Would the sum of the hashes for each of the addresses be a cryptographically secure approach? If I do: root = ...
0 votes
2 answers
106 views
How do I get the correct 4bytes?
I'm using this tool to get the keccak 256 hash: https://emn178.github.io/online-tools/keccak_256.html However I'm trying to the 4bytes for executeOrder. The executeOrder function signature is this: ...
1 vote
1 answer
382 views
Getting incorrect signer address on verifying the signature with the generated hash of the signed message in solidity
Basically on verifying the signature with the generated hash of the signed message, I'm getting the correct signer on JS, but not on Solidity. JS Code (According to Keir Finlow-Bates' suggestion): ...
0 votes
1 answer
71 views
Cannot verify signature
I have been trying to do it but it always return me false, tried a lot of ways but I don't know. Here is the smart contract function _verify( bytes32 hashedMessage, bytes memory ...
0 votes
1 answer
101 views
How to change the offset of calldata value?
Suppose I have a contract below: contract Hack { Switch private target; constructor(address _target) { target = Switch(_target); } function test() external pure returns (...
0 votes
2 answers
77 views
Hashes don't seem to match even though created with the same params
I have a function in Solidity that is supposed to check if the recovery hash committed by the Email recovery service matches the hash generated through the token and nonce sent by the user (He ...
0 votes
1 answer
251 views
How do I manually find the storage slot for a string greater than 32 bytes?
This is my contract: SPDX-License-Identifier: MIT pragma solidity 0.8.22; contract StringStorage { string short_string = "ABCD"; string long_string = "...
1 vote
0 answers
89 views
Merkle Tree Verification Consistently Fails in Solidity Smart Contract Tests
I am working on a Solidity smart contract for a lottery system using Merkle trees to verify winners. However, I consistently encounter an issue where the verify method of the Merkle Tree returns false ...