Commit Graph

35 Commits

Author SHA1 Message Date
arnaucube
8a260d66d3 Add goff ff.Element to babyjubjub
WIP, at this moment still does not bring much optimization
2020-03-09 11:51:41 +01:00
Eduard S
ee467c6215 Merge pull request #16 from iden3/feature/mimc7-goff
Feature/mimc7 goff
v0.0.3
2020-03-06 16:27:36 +01:00
arnaucube
4750e9c83c Remove field package which is no longer used 2020-03-06 16:24:41 +01:00
arnaucube
16a8a18a6d Optimize MiMC7 migrating from *big.Int to goff
Optimize MiMC7 migrating from *big.Int to goff generated finite field
operations.

There is still a lot of room for optimization for MiMC7 in the way that is done internally, but will be done in the future.

Benchmarks:
Tested on a Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz, with 16GB of RAM.

- Before:
```
BenchmarkMIMC7-4   	    1026	   1160298 ns/op
```

- After this commit:
```
BenchmarkMIMC7-4   	   19263	     61651 ns/op
```
2020-03-05 17:35:25 +01:00
arnau
e8be761ec7 Merge pull request #15 from iden3/feature/poseidon-opt-goff
Feature/poseidon opt goff
2020-03-04 18:34:17 +01:00
arnaucube
2a3f0d9ed5 Adapt babyjub/eddsa to new Poseidon methods 2020-03-04 12:57:20 +01:00
Eduard S
5d88f7c4cd Merge pull request #13 from iden3/feature/update-bbjj-sig
Update BabyJubJub signature with Poseidon
2020-03-03 17:57:27 +01:00
arnaucube
b45d8a582b Optimize Poseidon migrating from *big.Int to goff
Optimize Poseidon migrating from *big.Int to goff generated finite field
operations.

Benchmarks:
Tested on a Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz, with 16GB of RAM.

- Before the optimizations:
```
BenchmarkPoseidon-4                  470           2489678 ns/op
BenchmarkPoseidonLarge-4             476           2530568 ns/op
```

- With the optimizations of #12:
```
BenchmarkPoseidon-4                  766           1550013 ns/op
BenchmarkPoseidonLarge-4             782           1547572 ns/op
```

- With the changes of this PR, where uses goff generated code instead of *big.Int:
```
BenchmarkPoseidon-4                 9638            121651 ns/op
BenchmarkPoseidonLarge-4            9781            119921 ns/op
```
2020-03-03 16:31:40 +01:00
arnaucube
83f87bfa46 Resolve #4 2020-03-03 16:31:09 +01:00
arnaucube
17bad75853 Add goff generated finite field arithmetic code for used field 2020-03-03 16:30:00 +01:00
arnaucube
97c76ce614 Update BabyJubJub signature with Poseidon 2020-03-03 12:42:18 +01:00
arnau
937500b203 Merge pull request #12 from iden3/feature/optimizeposeidon
Optimize Poseidon
2019-12-22 20:40:00 +01:00
Eduard S
c0c4ff2dd7 Optimize Poseidon 2019-12-18 11:46:17 +01:00
Eduard S
8d5a7a7ccb Merge pull request #11 from iden3/fix/issue-9
Fix/issue #9
2019-12-18 11:03:37 +01:00
arnaucube
c754d01ce0 poseidon consistent use of T 2019-12-17 18:15:22 +01:00
arnaucube
fcb586591a fix #9 2019-12-17 18:04:49 +01:00
Eduard S
7c6170453e Add test that breaks poseidion due to padding 2019-12-16 17:24:22 +01:00
Eduard S
27ec5b26df Add test that breaks poseidon due to a security issue 2019-12-16 16:48:38 +01:00
Eduard S
53b9050d0a Add babujub eddsa benchmarks 2019-12-16 13:36:43 +01:00
Eduard S
a5b6afcb16 Add poseidon and babyjub benchmarks 2019-12-16 13:08:34 +01:00
arnau
4356f44a3d Merge pull request #6 from iden3/feature/testBJPKField
Test that babyjub pk is always < Q
2019-12-09 15:59:10 +01:00
Eduard S
5ade04e079 Test that babyjub pk is always < Q 2019-12-09 12:30:50 +01:00
Eduard S
eb7d86c5b3 Merge pull request #5 from iden3/decompress-modsqrt
return error if no ModSqrt(x, q) exist in babyjubjub decompress point
2019-09-10 10:48:18 +02:00
arnaucube
a60e154d86 return error if no ModSqrt(x, q) exist in babyjubjub decompress point 2019-09-10 00:36:54 +02:00
arnaucube
c95c95b7b1 add Poseidon multihash ([]*big.Int), add HashBytes for MiMC7 & Poseidon 2019-08-31 20:07:03 +02:00
arnaucube
2b1935299c MiMC7 finite field over R comprovation moved inside hash, same approach as Poseidon impl v0.0.2 2019-08-30 11:58:10 +02:00
arnaucube
0bac1c84ba add babyjub-eddsa Poseidon sign & verify 2019-08-29 17:52:30 +02:00
arnaucube
c4b3b7a09c update babyjub B8, clean unused funcs & errs in mimc7, small update in mimc7 tests 2019-08-03 20:55:08 +02:00
Eduard S
16423cc315 Merge pull request #1 from iden3/feature/poseidon
add Poseidon
v0.0.1
2019-07-01 12:54:18 +02:00
Eduard S
5b79ded540 Move constants and utils to package, apply small fixes 2019-07-01 12:51:34 +02:00
arnaucube
09c29da99e add Poseidon 2019-06-30 18:06:58 +02:00
arnaucube
7b219e15ec add travis, add go.mod go.sum, update babyjub hex encoders to avoid
importing go-iden3
2019-06-25 15:46:45 +02:00
arnaucube
e92a15d3b0 add mimc7 & fields 2019-06-25 15:01:38 +02:00
Eduard S
0f93c8ce38 Add babyjub from go-iden3/crypto/babyjub 2019-06-25 14:53:16 +02:00
arnau
eea757956c Initial commit 2019-06-25 14:50:17 +02:00