{"id":15622764,"url":"https://github.com/nbaztec/repro-keccak-asm-issue","last_synced_at":"2025-08-01T06:43:28.214Z","repository":{"id":253807760,"uuid":"844587281","full_name":"nbaztec/repro-keccak-asm-issue","owner":"nbaztec","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-20T11:24:00.000Z","size":51,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-04T17:28:20.396Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nbaztec.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-19T15:02:24.000Z","updated_at":"2024-08-19T15:33:03.000Z","dependencies_parsed_at":"2024-10-22T21:33:53.555Z","dependency_job_id":null,"html_url":"https://github.com/nbaztec/repro-keccak-asm-issue","commit_stats":null,"previous_names":["nbaztec/repro-keccak-asm-issue"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbaztec%2Frepro-keccak-asm-issue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbaztec%2Frepro-keccak-asm-issue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbaztec%2Frepro-keccak-asm-issue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbaztec%2Frepro-keccak-asm-issue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nbaztec","download_url":"https://codeload.github.com/nbaztec/repro-keccak-asm-issue/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246210802,"owners_count":20741233,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T09:55:08.224Z","updated_at":"2025-03-29T16:27:54.955Z","avatar_url":"https://github.com/nbaztec.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Summary\n\nWhen compiling this application with `--features asm-keccak`, the following test fails under Ubuntu and Arch (x86_64), but passes on Mac:\n\n```rust\nfn test_foo_fails() {\n    let a = alloy_primitives::keccak256(\"testFoo()\");   // want: 0x79adbd5094e60c1bc2b963678ff44695d1430b8ccff0b1cd57c03a7f63567822\n                                                        // got : 0xae33576402a61ff3a4a241b4a91d20ce98b70aa7bf0f388fb857111ec83aef73\n    let b = alloy_primitives::keccak256(\"test_Foo()\");\n    println!(\"testFoo() : {:?}\", a);\n    println!(\"test_Foo(): {:?}\", b);\n    assert_eq!(format!(\"{a:?}\"), String::from(\"0x79adbd5094e60c1bc2b963678ff44695d1430b8ccff0b1cd57c03a7f63567822\"));\n    assert_eq!(format!(\"{b:?}\"), String::from(\"0x45c48c2bd4afc6adc7884fe296b9af10e234ddbc44f2f99f40cfb8b6391e9798\"));   // this is always correct\n}\n```\n\n```bash\ntestFoo() : 0xae33576402a61ff3a4a241b4a91d20ce98b70aa7bf0f388fb857111ec83aef73\ntest_Foo(): 0x45c48c2bd4afc6adc7884fe296b9af10e234ddbc44f2f99f40cfb8b6391e9798\nthread 'tests::test_foo_fails' panicked at src/main.rs:19:9:\nassertion `left == right` failed\n  left: \"0xae33576402a61ff3a4a241b4a91d20ce98b70aa7bf0f388fb857111ec83aef73\"\n right: \"0x79adbd5094e60c1bc2b963678ff44695d1430b8ccff0b1cd57c03a7f63567822\"\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\n\n\nfailures:\n    tests::test_foo_fails\n\ntest result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s\n```\n\nThe issue seems to be that the keccak256 hash is incorrectly calculated on linux.\n\nThe example has been minimized from a foundry-zksync repository, where these collection of dependencies and their respective imports cause this issue to occur. \nIf any one of the deps or their imports is removed, then the issue goes away. \n\n```bash\n# Running on linux-x86_64 arch\n\nmake test           # fails\nmake test-native    # passee\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnbaztec%2Frepro-keccak-asm-issue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnbaztec%2Frepro-keccak-asm-issue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnbaztec%2Frepro-keccak-asm-issue/lists"}