Commit graph

11 commits

Author SHA1 Message Date
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
55620dcde5
PKCS#8 support (#224)
Adds optional integration with `ed25519::pkcs8` with support for
decoding/encoding `Keypair` from/to PKCS#8-encoded documents as well as
`PublicKey` from/to SPKI-encoded documents.

Includes test vectors generated for the `ed25519` crate from:
https://github.com/RustCrypto/signatures/tree/master/ed25519/tests/examples
2022-12-13 18:19:31 -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
Cheng XU
69eccda444
Fix serde implementation for serde_json
We use the [serde_bytes](https://github.com/serde-rs/bytes) crate for
serialization implementations, which simplifies codes and fixes issues
for serde_json.
2020-09-21 18:26:59 -07:00
Isis Lovecruft
1c97dac4dc
Update to curve25519-dalek version 3. 2020-08-20 21:19:21 +00:00
Tony Arcieri
6e0667d429 Use ed25519 + signature interop crates
The `signature` crate provides `Signer` and `Verifier` traits generic
over signature types:

https://github.com/RustCrypto/traits/tree/master/signature

There's presently an open call to stabilize the parts of its API needed
by Ed25519 signatures and release a 1.0 version:

https://github.com/RustCrypto/traits/issues/78

The `ed25519` crate, based on the `signature` crate, provides an
`ed25519::Signature` type which can be shared across multiple Ed25519
crates (e.g. it is also used by the `yubihsm` crate):

https://github.com/RustCrypto/signatures/tree/master/ed25519

This commit integrates the `ed25519::Signature` type, and changes the
existing `sign` and `verify` methods (where applicable) to use the
`Signer` and `Verifier` traits from the `signature` crate. Additionally,
it replaces `SignatureError` with the `signature` crate's error type.

This has the drawback of requiring the `Signer` and/or `Verifier` traits
are in scope in order to create and/or verify signatures, but with the
benefit of supporting interoperability with other Ed25519 crates which
also make use of these traits.
2020-04-20 09:15:10 -07:00
Isis Lovecruft
15d0a6596f
Document batch verification on docs.rs and fix false autolinking. 2019-11-14 22:01:34 +00:00
Isis Lovecruft
28eed1cba0
Add PublicKey::verify_strict() and Keypair::verify_strict() methods. 2019-10-04 02:54:13 +00:00
Isis Lovecruft
ae8764fbef
Update copyright year to 2019 and destroy capitalism. 2019-01-18 04:59:12 +00:00
Isis Lovecruft
d853856c36
Run rustfmt on src/public.rs. 2018-12-30 04:07:50 +00:00
Isis Lovecruft
e6528bd683
Create new module for public key code. 2018-12-30 03:53:42 +00:00