Commit Graph

17 Commits

Author SHA1 Message Date
Jack Grigg 97c27e3d5a Use complete addition in SinsemillaCommit
This is necessary because the blinding factor r can be zero with greater
than negligible probability in an adversarial case, which with incomplete
addition would cause the circuit to compute a commitment that is not on
the curve.
2021-09-28 13:13:25 -06:00
str4d 4e33fe7aec Use correct symbol for incomplete addition
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-08-12 21:34:35 +01:00
str4d 459e68b71e
Fix clippy lint
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-08-12 21:32:14 +01:00
Jack Grigg 9f3c9a7e60 Use mixed addition for Sinsemilla bases
Performance improvements:
- MerkleCRH:  ~5%
- Commit^ivk: ~1%
- NoteCommit: ~3%
2021-08-12 15:45:00 +01:00
therealyingtong 92a7e20d30 Remove sinsemilla_s_generators() function.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-08-12 20:54:51 +08:00
therealyingtong a9e96eb0a4 sinsemilla_s: Add documentation. 2021-08-12 16:15:24 +08:00
therealyingtong 74e617b46d chip::generator_table.rs: Load Sinsemilla generator lookup table.
The 2^K table of generators used in the Sinsemilla hash. These
are loaded into a lookup table.
2021-06-19 18:14:22 +08:00
therealyingtong 60861b7245 sinsemilla::constants.rs: Add INV_TWO_POW_K = 1 / 2^K constant. 2021-06-15 00:18:38 +08:00
therealyingtong 077f809df7 Cleanups from code review
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-05-13 10:48:10 +08:00
therealyingtong 380ed377de Fix bug in Sinsemilla S generators and add test
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-05-04 03:24:11 +08:00
therealyingtong de75c9538b Update constants after hash_to_field fix (zcash/pasta_curves@a119467) 2021-04-28 20:53:14 +08:00
therealyingtong 4f1f32dab0 Add Sinsemilla constants 2021-04-28 20:53:14 +08:00
Jack Grigg bdaf9d06cc clippy: Allow binary operators in IncompletePoint addition
It's not suspicious, it's constant time! :D
2021-04-22 12:09:32 +12:00
Jack Grigg 09e70cb6e3 Improve performance of IncompletePoint addition
We only need to track the occurrence of any edge cases, and we can do so
without expensive inversions at every addition step, by instead
performing the checks on the projective form directly.
2021-04-22 12:01:59 +12:00
Jack Grigg 907ff46078 Simulate incomplete addition
Sinsemilla will use incomplete addition inside the circuit for
efficiency, but the pasta_curves crate uses complete addition.
2021-04-20 10:04:44 +12:00
therealyingtong 9c75839e62 Minor changes
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-03-24 12:25:28 +08:00
therealyingtong ee969a64a8 Add Sinsemilla constants 2021-03-24 12:09:11 +08:00