Commit Graph

9 Commits

Author SHA1 Message Date
Deirdre Connolly 79085903a0
Zeroize full signingkey (#73)
* Zeroize full signingkey

Includes Default and DefaultIsZeroes impl for VerificationKey.

Resolves #72

* derive Zeroize for SigningKey
2023-03-15 11:04:32 -03:00
Conrado Gouvea e8e58e37a1 fix documentation about batching 2023-03-14 15:50:28 -04:00
Conrado Gouvea c079b0e507 update curve25519-dalek to 4.0.0-pre.5; sha2 to 0.10 2023-01-17 15:59:35 -05:00
Christian Poveda 15e028616c
add `no_std` support (#57) 2022-05-05 10:40:29 -03:00
Alexis Sellier a03df3776f Add *Ord instances to VerificationKeyBytes 2020-09-25 11:09:35 -07:00
Henry de Valence a62038f8f9
Add batch::Item::verify_single and Item: Clone + Debug. (#27)
* Add batch::Item::verify_single and Item: Clone + Debug.

This closes a gap in the API where it was impossible to retry items in a failed
batch, because the opaque Item type could not be verified individually.
2020-07-15 12:25:46 -07:00
Henry de Valence d0a430b5e4
Implement ZIP 215 validation rules. (#24)
* Implement ZIP 215 validation rules.

These have the effect that batched and singleton verification are now
equivalent.

* Add ZIP 215 conformance tests.

This test constructs signatures on the message "Zcash" using small-order
verification keys, some with canonical and some with non-canonical encodings of
points.  All of these signatures should pass verification under the ZIP 215
rules, but most of them should fail verification under legacy rules.

These tests exercise all of the special-case behaviors from the specific
version of libsodium used by Zcashd:

* the all-zero check for the verification key;

* the excluded point encodings for the signature's R value;

* the choice to test equality of the encoded bytes of the recomputed R value
  rather than on the projective coordinates of the two points.

Running
```
cargo test -- --nocapture
```
will print a hex-formatted list of the test cases, which can also be found here:

https://gist.github.com/hdevalence/93ed42d17ecab8e42138b213812c8cc7

* Update spec links.

Thanks to @ebfull for pointing this out.

* No ... there is another.

@ebfull pointed out that two test cases were duplicates.  The cause was that I
misread the RFC8032 check was checking for the non-canonical encoding of
the identity point that NCC Group apparently brought up.  Carefully analyzing all
the cases instead of assuming reveals there is another non-canonically encoded
point (of order 2).

* Change formatting of printed test cases.
2020-07-06 19:40:20 -07:00
Henry de Valence 26a0710f98
Add impl TryFrom<&[u8]> for all types. (#25) 2020-07-06 19:05:51 -07:00
Henry de Valence 8bc82108f4
Change terminology to signing and verification keys. (#20)
These are better names than secret and public keys, because they concisely
describe the functional *role* of the key material, not just whether or not the
key is revealed.
2020-06-15 20:45:25 -07:00