jarys
0ec7f97c97
Add `#![no_std]` support for zcash_note_encryption ( #450 )
...
Co-authored-by: str4d <thestr4d@gmail.com>
2021-11-24 13:58:52 +00:00
Jack Grigg
35e7542065
zcash_note_encryption: Move domain batch APIs into a BatchDomain trait
...
These are the only allocating APIs; this change makes it possible to
make the crate no-std compatible.
2021-11-17 12:14:26 +00:00
Jack Grigg
65e1d32774
ff 0.11, group 0.11, etc.
2021-09-09 18:20:37 +01:00
Kris Nuttycombe
5541552453
Fix a couple of broken doc links.
2021-09-01 14:01:47 -06:00
str4d
edcde252de
Merge pull request #428 from nuttycom/public_compact_size
...
Move the CompactSize, Vector, Array and Option encodings to a new zcash_encoding crate.
2021-09-01 20:45:28 +01:00
Kris Nuttycombe
fa092da456
Fix stray clippy complaints.
2021-08-31 13:19:24 -06:00
Jack Grigg
f03f05f251
zcash_note_encryption: Switch to chacha20poly1305 crate
2021-08-30 15:03:39 +01:00
Jack Grigg
4b4dd2ea55
zcash_note_encryption: Add support for batch-parsing `ephemeral_key`
...
This is useful when the underlying curve requires an inversion to parse
an encoded point (such as for Jubjub).
2021-08-10 02:57:11 +01:00
Jack Grigg
8a615c4393
zcash_note_encryption: Add batched trial decryption APIs
2021-08-10 02:17:10 +01:00
Jack Grigg
279a8b6bb6
Use `EphemeralKeyBytes` type in place of `[u8; 32]`
2021-08-09 21:28:42 +01:00
Jack Grigg
0f15743200
Disable default benchmark harness for all workspace crates
...
This is necessary in order to provide criterion-specific arguments to
`cargo bench`, such as `--profile-time`.
2021-08-05 22:39:36 +01:00
Jack Grigg
c7c79d266e
zcash_note_encryption: Add `ShieldedOutput::ephemeral_key() -> EphemeralKeyBytes`
...
This replaces the `ShieldedOutput::epk() -> &Domain::EphemeralPublicKey`
which could not be satisfied by output types that did not parse epk.
2021-06-10 18:35:19 +01:00
Jack Grigg
1222391dd7
Migrate to bitvec 0.22, ff 0.10, etc.
...
Requires patching three dependencies:
- bellman is pending a new release.
- nom is part of the funty breakage; we are blocking on a new release.
- orchard is in development.
2021-06-04 22:02:48 +01:00
Jack Grigg
eba6f417fe
zcash_note_encryption: Doc fixes
2021-05-29 00:15:25 +01:00
Jack Grigg
362838c3fa
zcash_note_encryption: Fix array size in Domain::extract_{esk, pk_d}
...
Decrypted output size is `OUT_PLAINTEXT_BYTES`, which the decryptor
can always provide (either by decrypting into the correct size array
as now, or truncating the buffer before passing it to the domain).
2021-05-28 23:48:03 +01:00
Jack Grigg
f6705f23c3
zcash_note_encryption: Add ovk recovery API
2021-05-28 23:45:23 +01:00
Jack Grigg
ae43e6c074
zcash_note_encryption: Pass cmstar_bytes to Domain::derive_ock
...
PRF^ock in the spec takes cm* as a byte array.
2021-05-28 23:41:13 +01:00
Jack Grigg
ee2b96c82d
zcash_note_encryption: s/TryFrom/From on ExtractedCommitmentBytes bound
...
This was left over from an earlier refactor where we could call a domain
API to extract cmstar from a note commitment (which could fail for
Orchard). This part of extraction was subsequently refactored into the
domain logic (and is rejected earlier for Orchard). The resulting bound
is wrong because it's always possible to serialize a scalar.
2021-05-28 22:57:48 +01:00
Jack Grigg
16627b4569
zcash_note_encryption: Enforce ZIP 212 check on esk from outPlaintext
...
It needs to equal the esk derived from the note (for v2 note plaintexts).
2021-05-28 22:33:00 +01:00
Jack Grigg
5623e02a7c
Migrate to ff 0.9 et al.
2021-05-19 18:29:37 +01:00
Jack Grigg
28a45028ab
cargo fmt
2021-04-16 14:03:55 +12:00
Daira Hopwood
dc0f6e7115
Update comment about which case is covered by example code
2021-04-16 00:10:05 +01:00
Kris Nuttycombe
b2b3efd4c2
Fix naming cmstar -> cmstar_bytes and cm -> cmstar
2021-04-15 15:24:45 -06:00
Kris Nuttycombe
00d04de547
Make cmstar check follow the spec more closely.
2021-04-14 15:38:58 -06:00
Kris Nuttycombe
389e6ca6a3
Minor comment on epk canonicity.
2021-04-12 18:43:21 -06:00
Kris Nuttycombe
f34e87884a
Update documentation for note encryption traits.
2021-04-12 17:41:06 -06:00
Kris Nuttycombe
6fc1d1d1c0
Use ephemeral_key bytes instead of the epk abstract point where specified.
2021-04-12 16:19:50 -06:00
Kris Nuttycombe
324fc36521
Use ShieldedOutput trait for note encryption/decryption.
...
This change modifies note encryption and decryption functions
to treat a shielded output as a single value instead of handling
the parts of an output as independent arguments.
2021-04-12 12:59:06 -06:00
Kris Nuttycombe
4f22f1d578
Apply suggestions from code review
...
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-04-12 09:18:51 -06:00
Kris Nuttycombe
e654cc4ce6
Use constant-time equality for EphemeralKeyBytes.
...
Fixes #370
2021-04-12 09:13:04 -06:00
Kris Nuttycombe
cfdbafe2e3
Add myself to crate contributors.
2021-04-08 10:13:04 -06:00
Kris Nuttycombe
24e62d3a7b
Update comments describing COMPACT_NOTE_SIZE components.
...
Co-authored-by: ebfull <ewillbefull@gmail.com>
2021-04-08 10:08:58 -06:00
Kris Nuttycombe
a560101bb2
Remove spurious mut references.
2021-04-08 10:08:00 -06:00
Kris Nuttycombe
879eea863a
Apply suggestions from code review
...
Co-authored-by: str4d <jack@electriccoin.co>
2021-04-08 08:20:23 -06:00
Kris Nuttycombe
dad8663c55
Fix zcash_note_encryption doctests.
2021-04-08 08:20:23 -06:00
Kris Nuttycombe
213cd6cce9
Fix Clippy complaints.
2021-04-08 08:20:23 -06:00
Kris Nuttycombe
be225daabf
Update zcash_primitives dev dependency for zcash_note_encryption
2021-04-08 08:20:23 -06:00
Kris Nuttycombe
5b13bb3a1e
Add try_output_recovery_with_ovk to shared note encryption code.
2021-04-08 08:20:23 -06:00
Kris Nuttycombe
266285b536
Move generalized note encryption functionality to zcash_note_encryption crate.
2021-04-08 08:20:21 -06:00
Jack Grigg
56b577b31e
clippy: Fix small lints
2021-03-27 19:01:03 +13:00
Jack Grigg
b7c31e3f54
Empty zcash_note_encryption crate
2021-03-20 09:56:20 +13:00