mirror of
https://github.com/saymrwulf/curve25519-dalek-source.git
synced 2026-09-04 20:24:10 +00:00
* [WIP] ed25519-dalek: bump `ed25519` crate dependency to v3.0.0
This has two test failures:
serialisation::serialize_deserialize_signature_json
serialisation::serialize_signature_size
These are due to a last minute change to use `serdect` for implementing
`serde` support: RustCrypto/signatures#1324.
The signature size regression from `64` to `72` is a deliberate tradeoff
we've accepted in `serdect`. First note that this test is for now the
unmaintained `bincode` crate.
The core problem is that `serde` does not actually provide fixed-size
arrays as a type within its data model (serde-rs/serde#1937) and you're
instead left faking it using `SerializeTuple` and serializing it a
byte-at-a-time as a tuple. While this gives optimal-sized results on
`bincode`, it gives less-than-optimal results on e.g. `rmp-serde` where
the bytes each end up tagged with a type prefix.
`serde` does provide portable APIs for using optimal format-specific
byte encodings, but they carry an additional length prefix, which is
unnecessary and suboptimal for something fixed-width like an Ed25519
signature, but alas as noted earlier `serde` does not actually have
fixed-width arrays in its data model.
The second test failure occurs specifically because `serdect`
introspects the format and uses `base16ct` to perform hex serialization
for human readable formats. While this is a readability improvement for
these formats (and also makes them easier to implement in constant-time,
though it's not relevant here), the drawback is it currently requires
the `alloc` feature for such formats, which is a regression:
Error("serializer is human readable, which requires the `alloc` crate feature", line: 0, column: 0)
Note that regardless these are both breaking changes to how `serde`
serialization is handled.
See also:
- RustCrypto/formats#1111
- RustCrypto/formats#1112
- dalek-cryptography/ed25519-dalek#140
* Migrate bincode -> postcard
* Bump `serdect` to v0.4.3
Includes `no_alloc` hex serialization support
---------
Co-authored-by: Michael Rosenberg <mrosenberg@cloudflare.com>
69 lines
2.1 KiB
TOML
69 lines
2.1 KiB
TOML
[package]
|
|
name = "x25519-dalek"
|
|
edition = "2024"
|
|
# Before changing this:
|
|
# - update version in README.md
|
|
# - update html_root_url
|
|
# - update CHANGELOG
|
|
# - if any changes were made to README.md, mirror them in src/lib.rs docs
|
|
version = "3.0.0-pre.6"
|
|
authors = [
|
|
"Isis Lovecruft <isis@patternsinthevoid.net>",
|
|
"DebugSteven <debugsteven@gmail.com>",
|
|
"Henry de Valence <hdevalence@hdevalence.ca>",
|
|
]
|
|
readme = "README.md"
|
|
license = "BSD-3-Clause"
|
|
repository = "https://github.com/dalek-cryptography/curve25519-dalek/tree/main/x25519-dalek"
|
|
homepage = "https://github.com/dalek-cryptography/curve25519-dalek"
|
|
documentation = "https://docs.rs/x25519-dalek"
|
|
categories = ["cryptography", "no-std"]
|
|
keywords = [
|
|
"cryptography",
|
|
"curve25519",
|
|
"key-exchange",
|
|
"x25519",
|
|
"diffie-hellman",
|
|
]
|
|
description = "X25519 elliptic curve Diffie-Hellman key exchange in pure-Rust, using curve25519-dalek."
|
|
exclude = [".gitignore", ".travis.yml", "CONTRIBUTING.md"]
|
|
rust-version = "1.85"
|
|
|
|
[badges]
|
|
travis-ci = { repository = "dalek-cryptography/x25519-dalek", branch = "master" }
|
|
|
|
[package.metadata.docs.rs]
|
|
rustdoc-args = [
|
|
"--html-in-header",
|
|
"docs/assets/rustdoc-include-katex-header.html",
|
|
"--cfg",
|
|
"docsrs",
|
|
]
|
|
all-features = true
|
|
|
|
[dependencies]
|
|
curve25519-dalek = { version = "=5.0.0-pre.6", default-features = false }
|
|
rand_core = { version = "0.10", default-features = false }
|
|
|
|
# optional dependencies
|
|
getrandom = { version = "0.4", optional = true }
|
|
serde = { version = "1", default-features = false, optional = true, features = ["derive"] }
|
|
zeroize = { version = "1", default-features = false, optional = true }
|
|
|
|
[dev-dependencies]
|
|
postcard = { version = "1", features = ["alloc"] }
|
|
criterion = "0.5"
|
|
getrandom = { version = "0.4", features = ["sys_rng"] }
|
|
|
|
[[bench]]
|
|
name = "x25519"
|
|
harness = false
|
|
|
|
[features]
|
|
default = ["precomputed-tables", "zeroize"]
|
|
getrandom = ["dep:getrandom"]
|
|
zeroize = ["dep:zeroize", "curve25519-dalek/zeroize"]
|
|
serde = ["dep:serde", "curve25519-dalek/serde"]
|
|
precomputed-tables = ["curve25519-dalek/precomputed-tables"]
|
|
reusable_secrets = []
|
|
static_secrets = []
|