Commit Graph

19 Commits

Author SHA1 Message Date
Michael Rosenberg
b5dc40bedf Make verify_batch deterministic (#256)
Also removed `batch_deterministic` feature
2023-01-14 21:26:39 -05:00
Michael Rosenberg
e2ed3133a6 Fix batch build (#220)
* Fixed bench when `batch` feature is not present

* Added bench build regression test to CI

* Fixed batch build more generally

* Simplified batch cfg gates in benches

* Updated criterion

* Made CI batch-nondeterministic test use nostd

* Fix batch_deterministic build

* Removed bad compile error when batch and batch_deterministic are selected
2023-01-02 00:59:19 -05:00
Tony Arcieri
52da7353b8 Rename Keypair => SigningKey; PublicKey => VerifyingKey (#242)
* Rename `signing` and `verifying` modules

Renames the following modules:

- `keypair` => `signing`
- `public` => `verifying`

Renaming these in an individual commit preserves the commit history.

This is in anticipation of renaming the following per #225:

- `Keypair` => `SigningKey`
- `PublicKey` => `VerifyingKey`

* Rename `Keypair` => `SigningKey`; `PublicKey` => `VerifyingKey`

As proposed in #225, renames key types after their roles:

- `SigningKey` produces signatures
- `VerifyingKey` verifies signatures

The `SecretKey` type is changed to a type alias for `[u8; 32]`, which
matches the RFC8032 definition:

https://www.rfc-editor.org/rfc/rfc8032#section-5.1.5

> The private key is 32 octets (256 bits, corresponding to b) of
> cryptographically secure random data.
2022-12-18 01:24:58 -05:00
Tony Arcieri
01ad6305f2 Edition fixups: remove extern crate, add idioms lint (#231)
Rust editions 2018+ do not require `extern crate` except for linking
`alloc` and `std`.
2022-12-08 02:39:48 -05:00
Tony Arcieri
ae4bd2c81e Fix warnings and add -D warnings check in CI (#226) 2022-11-20 22:28:09 -05:00
Michael Rosenberg
8319adbff4 Bumped MSRV to 1.56.1 and added some documentation about semver (#218)
Also fixed benchmark build
2022-10-16 18:51:26 -04:00
Alex Xiong
9638ab40a5 Made ExpandedSecretKey private to avoid signing key oracle (#205)
This fix eliminates a scenario where a user misuses the `ExpandedSecretKey` API
in a way that leaks the user's secret key. In short, if a user sends
`ExpandedSecretKey::sign(sk, msg, pk1)` followed by
`ExpandedSecretKey::sign(sk, msg, pk2)`, where `pk1 != pk2`, a passive
adversary [can easily][0] derive `sk`. To mitigate this, we remove the API
entirely.

[0]: https://github.com/MystenLabs/ed25519-unsafe-libs
2022-10-15 15:04:03 -04:00
Isis Lovecruft
3a9435df94 Fixup serde and ed25519 trait errors in tests/benches. 2020-07-13 23:16:30 +00:00
Isis Lovecruft
28eed1cba0 Add PublicKey::verify_strict() and Keypair::verify_strict() methods. 2019-10-04 02:54:13 +00:00
Isis Lovecruft
dc4b77b551 Fix bad import and feature specification in benchmarks. 2019-10-03 23:15:50 +00:00
Isis Lovecruft
ae8764fbef Update copyright year to 2019 and destroy capitalism. 2019-01-18 04:59:12 +00:00
Isis Lovecruft
82cdcb9cc9 Fix benchmarks after merging #64. 2018-12-30 04:26:22 +00:00
Isis Lovecruft
80ae5d0683 Cleanup RNG usage after merging #57. 2018-12-22 12:20:59 +00:00
Isis Lovecruft
c700a2b5e4 This is what happens when you have separate machines for benchmarks and
committing code.
2018-07-27 19:17:03 +00:00
Isis Lovecruft
1b702a3fe1 Add more batch sizes to benchmarks. 2018-07-27 18:28:17 +00:00
Isis Lovecruft
468acd8f1f Fix batch benchmarks to use new function signature. 2018-07-27 18:28:06 +00:00
Isis Lovecruft
ce46a12d92 Implement batch verification.
The API for this isn't the greatest and I apologise for that.  Suggestions for
improvement welcome.  One thing which @hdevalence and I considered was to
change the function signature to:

    pub fn verify_batch<D, C, M, S, K>(messages: M,
                                       signatures: S,
                                       public_keys: K,
                                       csprng: &mut C) -> Result<(), SignatureError>
        where D: Digest<OutputSize = U64> + Default,
              C: Rng + CryptoRng,
              M: IntoIterator<Item = &[u8]>,
              S: IntoIterator,
              S::Item: Borrow<Signature>,
              K: IntoIterator,
              K::Item: Borrow<Signature>,

The other improvement which could be made is to implement 128-bit scalars for
the randomnesses.

 * CLOSES #27
2018-07-17 19:03:46 +00:00
Isis Lovecruft
bda9bba9d5 Remove ZeroRng from benchmarks. 2018-07-12 20:19:42 +00:00
Isis Lovecruft
164303eeac Switch to using criterion for benchmarks. 2018-07-11 22:46:32 +00:00