Commit Graph

87 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
Deirdre Connolly e47a986a22
Do not log SigningKey seed, prefix, s, as part of impl Debug (#70) 2023-03-09 11:36:09 -03: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
Conrado Gouvea 612e51af2e v3.1.0 2022-10-26 16:28:40 -04:00
Christian Poveda 15e028616c
add `no_std` support (#57) 2022-05-05 10:40:29 -03:00
dependabot[bot] 7b8447ad79 Update color-eyre requirement from 0.5 to 0.6
Updates the requirements on [color-eyre](https://github.com/yaahc/color-eyre) to permit the latest version.
- [Release notes](https://github.com/yaahc/color-eyre/releases)
- [Changelog](https://github.com/yaahc/color-eyre/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yaahc/color-eyre/compare/v0.5.2...v0.6.0)

---
updated-dependencies:
- dependency-name: color-eyre
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-19 17:06:12 -05:00
Deirdre Connolly 9dd5d07120 v3.0.0 2021-10-12 13:25:18 -04:00
Jose Daniel Hernandez 7fec3087c5 Add dependency and build status badges
Add dependency and build status badges to the README.md file.
2021-10-12 11:39:35 -04:00
Fintan Halpenny 5382ead398 dependencies: update zeroize to 1.2
There was a vulnerability reported[0] in zeroize which is patches with
versions >=1.2.0. This patch sets the bound to "1.2" in the Cargo.toml.

[0]: https://rustsec.org/advisories/RUSTSEC-2021-0115

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
2021-10-12 11:36:06 -04:00
Deirdre Connolly 2824139711 rustdoc cfg updates 2021-10-12 11:24:30 -04:00
Deirdre Connolly a3ad04778a Enable CI workflow for PRs and manual starts 2021-10-12 11:24:30 -04:00
José Daniel Hernández 68710ed83e
Add LICENSE files (#51)
Add LICENSE files to state MIT or Apache 2.0 as the licenses of this
repository.
This closes #33.
2021-10-11 09:44:57 +10:00
dependabot[bot] d351240022
Bump actions-rs/cargo from 1 to 1.0.3 (#48)
Bumps [actions-rs/cargo](https://github.com/actions-rs/cargo) from 1 to 1.0.3.
- [Release notes](https://github.com/actions-rs/cargo/releases)
- [Changelog](https://github.com/actions-rs/cargo/blob/master/CHANGELOG.md)
- [Commits](https://github.com/actions-rs/cargo/compare/v1...v1.0.3)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-14 12:52:17 +10:00
dependabot[bot] ed59300fe5
Bump actions-rs/toolchain from 1 to 1.0.7 (#47)
Bumps [actions-rs/toolchain](https://github.com/actions-rs/toolchain) from 1 to 1.0.7.
- [Release notes](https://github.com/actions-rs/toolchain/releases)
- [Changelog](https://github.com/actions-rs/toolchain/blob/master/CHANGELOG.md)
- [Commits](https://github.com/actions-rs/toolchain/compare/v1...v1.0.7)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-14 12:50:52 +10:00
Deirdre Connolly 539fad040c Update rand_core to 0.6 and rand to 0.8 2021-03-30 11:19:07 -04:00
Deirdre Connolly 9a2f706ace Revert "Update rand_core to 0.6 and rand to 0.8"
This reverts commit ae0c163b17.
2021-03-25 21:54:08 -04:00
Deirdre Connolly ae0c163b17 Update rand_core to 0.6 and rand to 0.8 2021-03-25 21:48:24 -04:00
Douglas Roark 2abe8b96b5
Add JNI code for ed25519-zebra (#37)
* Add JNI code for ed25519-zebra

Add some code allowing other languages, via JNI, to interact with ed25519-zebra. The initial commit:

- Allows users to obtain a random 32 byte signing key seed.
- Allows users to obtain a 32 byte verification key from a signing key seed.
- Allows users to sign arbitrary data.
- Allows users to verify an Ed25519 signature.
- Includes a Java file that can be used.
- Includes some Scala-based JNI tests.

* Review fixups

- Minor Rust code optimizations.
- Rust build optimizations.
- Tweak the JNI JAR prereq script to match the new outputs.

* Significant cleanup

- More build system tidying. The primary goal is to try to firewall the JNI code from everything else.
- README tidying.

* Grab bag of improvements

- Clean up the wrapper classes (streamlining, make constructors private, more mutability safety).
- private -> public for a static variable intended for public usage.
- Minor comment & build system cleanup.

* Bump JNI version to 0.0.4-DEV

Decided to bump the version to reflect earlier changes.

* Hard-code the ed25519-zebra version for ed25519jni to use

* Unify ed25519 JNI version

Also add "-JNI" to assist with tagging and otherwise distinguish the JNI code from the main library version/code.

* Add code to make VerificationKeyBytes comparison easier

Also add a test suite for VerificationKeyBytes.

* VerificationKeyBytes cleanup

- Fix hashCode() override.
- Add a test.
- Remove unneecessary semicolons.

* Add Signature to JNI

Mirror the Signature struct from Rust and add some basic tests. Also do a bit of Scala test cleanup.
2021-02-26 14:58:38 -08:00
Kim Altintop 0e7a96a267
Add Zeroize impl for SigningKey (#34)
* Add Zeroize impl for SigningKey
2020-12-03 13:10:52 -08:00
Dimitris Apostolou 014d823db6 Fix typo 2020-10-12 19:12:06 -07:00
Henry de Valence 72e1b17d86 Bump version to 2.2.0 2020-09-25 11:26:45 -07:00
Alexis Sellier a03df3776f Add *Ord instances to VerificationKeyBytes 2020-09-25 11:09:35 -07:00
Henry de Valence 2808cbd188 Bump version to 2.1.2 2020-08-17 20:09:26 -07:00
Henry de Valence 8fdd6a8d18 Update sha2 to 0.9 and curve25519-dalek to 3.0. 2020-08-17 20:07:42 -07:00
Henry de Valence a484604310 Bump version to 2.1.1 and update CHANGELOG 2020-07-30 10:20:27 -07:00
Henry de Valence 561bfa738e Test that individual and batch verification match. 2020-07-30 10:18:19 -07:00
Henry de Valence 71f276e32a Add missing mul_by_cofactor in batch verification.
This should have been added as part of the ZIP 215 work but I missed it.
2020-07-30 10:18:19 -07:00
Henry de Valence 42c308322c Merge branch 'release/2.1.0' into main 2020-07-15 12:37:15 -07:00
Henry de Valence af787e1dae Bump version to 2.1.0 2020-07-15 12:31:49 -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
dependabot[bot] 54ac8c2de3 Update color-eyre requirement from 0.4 to 0.5
Updates the requirements on [color-eyre](https://github.com/yaahc/color-eyre) to permit the latest version.
- [Release notes](https://github.com/yaahc/color-eyre/releases)
- [Commits](https://github.com/yaahc/color-eyre/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-10 15:35:12 -04:00
Henry de Valence 02521ccd9e Release 2.0.0 2020-07-06 19:43:29 -07:00
Henry de Valence e7afed68e5 Merge branch '1.x' into main 2020-07-06 19:41:12 -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 551af0690e Release 1.0.0 2020-07-06 19:37:14 -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 e07ceac55a Release 1.0.0-pre.0 2020-06-26 11:27:00 -07:00
Henry de Valence 436caa97d6 Merge branch 'release/0.4.1' into main 2020-06-17 14:29:45 -07:00
Henry de Valence f118a5bdaa Bump version to 0.4.1, fixing docs.rs 2020-06-17 14:28:12 -07:00
Henry de Valence 658bbfe46f Merge branch 'release/0.4.0' into main 2020-06-16 13:48:16 -07:00
Henry de Valence a2c6a6192b Bump version to 0.4.0 2020-06-16 13:46:29 -07:00
Henry de Valence c0091419c5
Fix batch verification API to be usable in async contexts. (#22)
It's essential to be able to separate the lifetime of the batch item from the
lifetime of associated data (in this case, the message).  The previous API did
this mixed in to the Tower implementation, but it was removed along with that
code.

Making the `queue` function take `I: Into<Item>` means that users who don't
care about lifetimes just need to wrap the function arguments in an extra
tuple.
2020-06-16 13:44:34 -07:00
Henry de Valence 930b1f1e2d Merge branch 'release/0.3.0' into main 2020-06-15 21:16:35 -07:00
Henry de Valence 3b022e3898 Update CHANGELOG for 0.3.0 2020-06-15 21:15:10 -07:00
Henry de Valence ee25267a91
Update benchmarks with recent changes. (#21) 2020-06-15 21:09:01 -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
Henry de Valence cacd50d992
Remove futures-based batch verification API. (#19)
The futures-based batch verification design is still good, but it turns out
that things like the latency bounds and control of when to flush the batch
should be common across different kinds of batchable verification.  This should
be done by the forthcoming `tower-batch` middleware currently in the Zebra
repo.
2020-06-15 18:47:49 -07:00
Henry de Valence 8a477a551f Merge branch 'release/0.2.3' into main 2020-06-15 13:35:54 -07:00
Henry de Valence 13ce317681 Update CHANGELOG for 0.2.3 2020-06-15 13:30:10 -07:00