Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/weijiekoh/poseidon_bug
https://github.com/weijiekoh/poseidon_bug
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/weijiekoh/poseidon_bug
- Owner: weijiekoh
- Created: 2020-02-22T07:02:24.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-24T01:27:09.000Z (almost 2 years ago)
- Last Synced: 2023-03-05T18:05:41.356Z (almost 2 years ago)
- Language: TypeScript
- Size: 644 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
There seems to be a bug with the Poseidon hash function bytecode generator in
`circomlib` 0.0.20.To demonstrate this bug, clone this repository, install dependencies, and
compile the source code:```bash
git clone https://github.com/weijiekoh/poseidon_bug.git && \
cd poseidon_bug && \
npm i && npm run build
```In a separate terminal, run:
```bash
npm run ganache
```Next, run:
```bash
node build/index.js
```If the output is:
```
21334876322667183667165053088102559857160636052568525182000620475434027971580
21334876322667183667165053088102559857160636052568525182000620475434027971580
```then there is a bug with the Poseidon hash contract bytecode generator.
The bug occurs when the `t` value is set to anything other than 6:
```js
poseidonGenContract.createCode(3, 8, 57, POSEIDON_SEED)
```It returns the same value for any input, which should not be the case.
If set to 6, the contract's `poseidon()` function will return different hash
values for different inputs.