Skip to content

Commit d3a926b

Browse files
fix(kyberlib): 🐛 fix derive declarations
1 parent b90bb2b commit d3a926b

4 files changed

Lines changed: 18 additions & 13 deletions

File tree

Cargo.toml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ repository = "https://github.com/sebastienrousseau/kyberlib"
3333
version = "0.0.5"
3434

3535
[dependencies]
36+
# Dependencies for the library
3637
aes = { version = "0.8.4", optional = true }
3738
ctr = { version = "0.9.2", optional = true }
3839
pqc_core = { version = "0.3.0", features = ["zero"]}
@@ -45,18 +46,20 @@ wasm-bindgen = "0.2.92"
4546
zeroize = { version = "1.7.0", features = ["derive"] }
4647

4748
[dev-dependencies]
49+
# Dependencies for testing
4850
criterion = "0.5.1"
49-
rand = "0.8.5"
5051
wasm-bindgen-test = "0.3.42"
5152

5253
# benchmarking = ["criterion"]
5354

5455
[build-dependencies]
56+
# Dependencies for the build script
5557
cc = {version = "1.0.97", optional = true }
5658
nasm-rs = {version = "0.3.0", optional = true }
5759

5860
[lib]
59-
crate-type = ["cdylib", "rlib"]
61+
# Metadata about the library
62+
crate-type = ["cdylib", "rlib", "staticlib"]
6063
name = "kyberlib"
6164
path = "src/lib.rs"
6265

@@ -110,12 +113,12 @@ std = []
110113

111114
## Warn
112115
# box_pointers = "warn"
113-
# missing_copy_implementations = "warn"
114-
# missing_docs = "warn"
115-
# unstable_features = "warn"
116+
missing_copy_implementations = "warn"
117+
missing_docs = "warn"
118+
unstable_features = "warn"
116119
# unused_crate_dependencies = "warn"
117120
# unused_extern_crates = "warn"
118-
# unused_results = "warn"
121+
unused_results = "warn"
119122

120123
## Allow
121124
bare_trait_objects = "allow"

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ cargo run --example uake
244244

245245
### Platform support
246246

247-
`kyberlib` is supported and tested on MacOS, Linux, and Windows. The [GitHub Actions][10] shows the platforms in which the `kyberlib` library tests are run.
247+
`kyberlib` supports a variety of CPU architectures. It is supported and tested on MacOS, Linux, and Windows.
248248

249249
### Documentation
250250

@@ -258,8 +258,10 @@ backward compatibility, `kyberlib` follows [semantic versioning][06].
258258

259259
## License 📝
260260

261-
The project is licensed under the terms of Apache License, Version 2.0 and the
262-
MIT license.
261+
KyberLib is distributed under the terms of both the MIT license and the
262+
Apache License (Version 2.0).
263+
264+
See [LICENSE-APACHE][01] and [LICENSE-MIT][02] for details.
263265

264266
## Contribution 🤝
265267

@@ -289,15 +291,15 @@ A special thank you goes to the [Rust Reddit][12] community for
289291
providing a lot of useful suggestions on how to improve this project.
290292

291293
[00]: https://kyberlib.com/ "KyberLib, A Robust Rust Library for CRYSTALS-Kyber Post-Quantum Cryptography"
292-
[02]: http://opensource.org/licenses/MIT "KyberLib license"
294+
[01]: http://opensource.org/licenses/Apache-2.0 "Apache License, Version 2.0"
295+
[02]: http://opensource.org/licenses/MIT "MIT License"
293296
[03]: https://github.com/sebastienrousseau/kyberlib/kyberlib/issues "KyberLib Issues"
294297
[04]: https://github.com/sebastienrousseau/kyberlib/kyberlib/blob/main/CONTRIBUTING.md "KyberLib Contributing Guidelines"
295298
[05]: https://github.com/sebastienrousseau/kyberlib/kyberlib/graphs/contributors "KyberLib Contributors"
296299
[06]: http://semver.org/ "SemVer"
297300
[07]: https://crates.io/crates/kyberlib "KyberLib on Crates.io"
298301
[08]: https://docs.rs/kyberlib "KyberLib on Docs.rs"
299302
[09]: https://lib.rs/crates/kyberlib "KyberLib on Lib.rs"
300-
[10]: https://github.com/sebastienrousseau/kyberlib/kyberlib/actions "KyberLib on GitHub Actions"
301303
[11]: https://www.rust-lang.org/policies/code-of-conduct "KyberLib Code of Conduct"
302304
[12]: https://www.reddit.com/r/rust/ "Reddit"
303305
[13]: https://www.rust-lang.org/learn/get-started "Rust"

src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// SPDX-License-Identifier: Apache-2.0 OR MIT
33

44
/// Error types for the failure modes in Kyber key exchange.
5-
#[derive(Debug, PartialEq)]
5+
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)]
66
pub enum KyberLibError {
77
/// One or more inputs to a function are incorrectly sized. A likely cause of this is
88
/// two parties using different security levels while trying to negotiate a key exchange.

src/wasm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ impl Kex {
184184

185185
/// Represents Kyber parameters.
186186
#[wasm_bindgen]
187-
#[derive(Debug)]
187+
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)]
188188
pub struct Params {
189189
/// The size of public key bytes.
190190
#[wasm_bindgen(readonly)]

0 commit comments

Comments
 (0)