Daira Hopwood
a7a1e5b217
Use rejection sampling to implement `random` for `Fp` and `Scalar`.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-05-09 12:41:18 +08:00
therealyingtong
72cae20b61
Add Orchard commitments
...
HomomorphicPedersenCommit -> ValueCommit
SinsemillaCommit -> NoteCommit
SinsemillaShortCommit -> CommitIvk
2021-05-09 12:41:18 +08:00
ying tong
bd7c367590
Apply suggestions from code review
...
Co-authored-by: str4d <jack@z.cash>
2021-05-09 12:41:18 +08:00
therealyingtong
43de24d88c
Add Orchard generators
2021-05-09 12:41:18 +08:00
str4d
03157edaf2
Merge pull request #27 from zcash-hackworks/poseidon
...
Poseidon implementation
2021-05-08 19:54:01 +01:00
str4d
deee246420
Add numpy dependency to README
2021-05-09 06:53:31 +12:00
str4d
cb9348e7a9
Apply suggestions from code review
2021-05-08 19:51:33 +01:00
ying tong
bb16eca2c0
Only return first state element from Poseidon hash
...
Co-authored-by: str4d <jack@z.cash>
2021-05-07 12:59:38 +08:00
therealyingtong
25f5ccd445
Generate Poseidon hash test vectors
2021-05-07 12:58:33 +08:00
therealyingtong
6184981ccd
Generate Poseidon perm test vectors
2021-05-07 12:58:33 +08:00
therealyingtong
99feaed0f4
Render array of bytearrays in tv_output
2021-05-07 12:58:33 +08:00
therealyingtong
48fca9ad62
Add Poseidon implementation
2021-05-07 12:58:33 +08:00
ying tong
b2c074a8d1
Merge pull request #21 from zcash-hackworks/orchard-merkle-crh
...
Add Orchard MerkleCRH
2021-05-07 01:38:32 +08:00
Daira Hopwood
5a820ad113
Fix length of layer prefix in orchard_merkle_tree.py.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-05-06 16:14:28 +01:00
therealyingtong
c73aabd641
Add Orchard MerkleCRH
2021-04-30 12:20:37 +08:00
str4d
0cc31479cf
Merge pull request #17 from zcash-hackworks/sinsemilla-test-vectors
...
Add iso-Pallas, SWU hash-to-curve, and Sinsemilla
2021-04-29 02:20:39 +01:00
Daira Hopwood
f8008a01fd
Apply suggestions from code review
...
Comments and a minor refactor for consistency.
2021-04-29 02:07:46 +01:00
Jack Grigg
9cb9e0f9bc
Generate random test vectors for MapToCurve, GroupHash, Sinsemilla
2021-04-29 12:59:16 +12:00
Jack Grigg
c6cd47a5dd
Fix Rand.u8() to return unsigned integers
...
Existing test vector generators are adjusted to use Rand.i8() so they
generate the same test vectors. We should evaluate these later to
determine whether they should actually use Rand.u8() (and update the
test vectors across the ecosystem).
2021-04-29 12:57:40 +12:00
Jack Grigg
10bdd6c5f8
Split apart MapToCurveSimpleSWU and GroupHash test vectors
...
The test vector generators in this repository are meant to output data
that can be copy-pasted or piped to a file. Generating multiple sets of
test vectors from a single file interferes with this.
2021-04-29 12:29:31 +12:00
Daira Hopwood
e981001efc
orchard_group_hash: add test vectors for map_to_curve_simple_swu.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-04-27 14:28:48 +01:00
Daira Hopwood
634c599fc6
orchard_group_hash: minor refactoring.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-04-27 14:28:08 +01:00
Daira Hopwood
322aff1777
orchard_group_hash.py: don't apply iso_map as part of map_to_curve_simple_swu.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-04-27 14:26:12 +01:00
Taylor Hornby
86c2796de8
Fix broken incomplete addition case check
...
Co-authored-by: str4d <jack@z.cash>
2021-04-26 23:35:30 -06:00
Jack Grigg
4052b6404b
Add rendering logic to Orchard GroupHash and Sinsemilla
2021-04-27 15:41:19 +12:00
Jack Grigg
943aa69e66
Remove bitstring dependency
...
Instead we just allow an iterable of bit-like elements.
2021-04-27 15:14:12 +12:00
Taylor Hornby
0c6c988e2e
Call iso_map in map_to_curve_simple_swu
2021-04-26 18:34:31 -06:00
Taylor Hornby
027b362773
Some cleanup and move group_hash into its own file
2021-04-26 18:29:39 -06:00
Taylor Hornby
a2bf6c5a04
Check for incomplete addition exceptional cases in Sinsemilla
2021-04-26 18:21:01 -06:00
Taylor Hornby
fb45bda972
Document bitstring dependency in the README
2021-04-26 18:06:04 -06:00
Taylor Hornby
756abfbb9c
Delete sinsemilla_hash_bytes which was unused and not guaranteed to have correct endianness
2021-04-22 14:36:38 -06:00
Taylor Hornby
9f02018465
Clarify index-vs-exponent variable naming
...
Co-authored-by: str4d <jack@z.cash>
2021-04-22 14:34:47 -06:00
Taylor Hornby
e141b76203
Fix missing divide-by-Z
...
Co-authored-by: str4d <jack@z.cash>
2021-04-22 14:31:55 -06:00
Taylor Hornby
d9750457b9
Update orchard_sinsemilla.py
...
Co-authored-by: str4d <jack@z.cash>
2021-04-22 14:31:31 -06:00
Taylor Hornby
4e70886918
Document the fact that the iso-Pallas generator is arbitrary
2021-04-22 14:30:45 -06:00
Taylor Hornby
b8dccde4c4
Update orchard_sinsemilla.py
...
Co-authored-by: str4d <jack@z.cash>
2021-04-22 14:17:21 -06:00
Taylor Hornby
8c2275a4b5
Update orchard_sinsemilla.py
...
Co-authored-by: str4d <jack@z.cash>
2021-04-22 14:17:12 -06:00
Taylor Hornby
75ce7b22be
Update orchard_sinsemilla.py
...
Co-authored-by: str4d <jack@z.cash>
2021-04-22 14:17:02 -06:00
Taylor Hornby
a5579bab84
Update orchard_sinsemilla.py
...
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-04-22 14:16:44 -06:00
str4d
88788d5476
Merge pull request #19 from zcash-hackworks/doc-fix
...
Fix doc comment
2021-04-22 12:57:17 +01:00
Jack Grigg
efa8a9ac2f
Fix doc comment
...
Too much Rust :P
2021-04-22 23:56:37 +12:00
str4d
c3b4e454b3
Merge pull request #14 from zcash-hackworks/orchard
...
Implementation of Pallas
2021-04-21 01:09:52 +01:00
str4d
3b868bb182
Add comment documenting ROOT_OF_UNITY
...
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-04-21 00:01:57 +01:00
Daira Hopwood
57c2894522
Update orchard_pallas.py
...
Replace 0 with Fp.ZERO in `extract`.
Co-authored-by: Taylor Hornby <taylor@defuse.ca>
2021-04-06 22:51:29 +01:00
Daira Hopwood
28370d5fe9
orchard_sinsemilla.py: corrections, and add test vector for SinsemillaHash.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-04-02 17:57:29 +01:00
Daira Hopwood
9184c78c0f
Remove trailing spaces, and make orchard_iso_pallas.py and orchard_sinsemilla.py executable.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-04-02 17:56:14 +01:00
Daira Hopwood
816cfa0059
Apply suggestions from code review
2021-04-01 23:14:28 +01:00
Taylor Hornby
c3a70e269b
Add iso-Pallas, SWU hash-to-curve, and Sinsemilla
...
Co-authored-by: Kris Nuttycombe <kris.nuttycombe@gmail.com>
2021-03-30 11:03:55 -06:00
Jack Grigg
65ed28c661
Add implementation of Pallas
2021-02-25 14:52:13 +00:00
str4d
0db0553a93
Merge pull request #12 from str4d/8-license
...
Add license information
2020-07-01 11:09:28 +12:00