diff --git a/CHANGELOG.md b/CHANGELOG.md index d9ac6af3..2c3076ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,23 @@ +### 0.16.1 + +__Date:__ November 3, 2021. + +__Changelog:__ + +- Add support for X25519 using fiat-crypto Curve25519 field arithmetic (new modules `orion::hazardous::ecc` and `orion::kex`) ([#197](https://github.com/orion-rs/orion/pull/197)). +- Implement serde `Serialize` and `Deserialize` for relevant types ([#192](https://github.com/orion-rs/orion/issues/192)) (by [Vince Mutolo](https://github.com/vlmutolo)). +- Fix incorrect documentation of SHA256 streaming state ([#196](https://github.com/orion-rs/orion/issues/196)). +- Add `is_empty()` to newtypes ([#206](https://github.com/orion-rs/orion/pull/206)). +- Add documentation for correct use of streaming AEAD API with `StreamTag::Finish` ([#139](https://github.com/orion-rs/orion/issues/139)). +- Convert uses of `assert!(a == b)` to `assert_eq!(a, b)` where possible ([#210](https://github.com/orion-rs/orion/issues/210)) (by [Emmanuel Leblond](https://github.com/touilleMan)). +- Derive `Clone` + `Copy` for `StreamTag` ([#211](https://github.com/orion-rs/orion/issues/211)) (by [24seconds](https://github.com/24seconds)). +- Harden security of GitHub Actions CI/CD ([#200](https://github.com/orion-rs/orion/issues/200)) (by [Vince Mutolo](https://github.com/vlmutolo)). +- Re-export HMAC `Tag`s used in their corresponding HKDF API ([#224](https://github.com/orion-rs/orion/issues/224)). +- Fix warnings from CI jobs and bump MSRV to `1.52.0` ([#222](https://github.com/orion-rs/orion/issues/222)) ([#223](https://github.com/orion-rs/orion/issues/223)). +- Update benchmarks ([#214](https://github.com/orion-rs/orion/issues/214)). +- Render feature badges for API on docs.rs ([#238](https://github.com/orion-rs/orion/issues/238)). +- Add new Crate Features page to wiki ([#215](https://github.com/orion-rs/orion/issues/215)). + ### 0.16.0 __Date:__ March 29, 2021. diff --git a/Cargo.toml b/Cargo.toml index 82eba138..c0572e96 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "orion" -version = "0.16.0" # Update html_root_url in lib.rs along with this. +version = "0.16.1" # Update html_root_url in lib.rs along with this. authors = ["brycx "] description = "Usable, easy and safe pure-Rust crypto" keywords = [ "cryptography", "crypto", "aead", "hash", "mac" ] diff --git a/src/lib.rs b/src/lib.rs index fca3f17b..8df0a2b8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -64,7 +64,7 @@ unused_qualifications, overflowing_literals )] -#![doc(html_root_url = "https://docs.rs/orion/0.16.0")] +#![doc(html_root_url = "https://docs.rs/orion/0.16.1")] #![cfg_attr(docsrs, feature(doc_cfg))] #[cfg(test)] diff --git a/src/typedefs.rs b/src/typedefs.rs index 7d160a3e..b2a7a017 100644 --- a/src/typedefs.rs +++ b/src/typedefs.rs @@ -88,6 +88,8 @@ macro_rules! impl_normal_debug_trait (($name:ident) => ( /// Macro that implements the `serde::{Serialize, Deserialize}` traits. #[cfg(feature = "serde")] macro_rules! impl_serde_traits (($name:ident, $bytes_function:ident) => ( + + #[cfg_attr(docsrs, doc(cfg(feature = "serde")))] /// This type tries to serialize as a `&[u8]` would. Note that the serialized /// type likely does not have the same protections that orion provides, such /// as constant-time operations. A good rule of thumb is to only serialize @@ -102,6 +104,7 @@ macro_rules! impl_serde_traits (($name:ident, $bytes_function:ident) => ( } } + #[cfg_attr(docsrs, doc(cfg(feature = "serde")))] /// This type tries to deserialize as a `Vec` would. If it succeeds, the digest /// will be built using `Self::from_slice`. /// @@ -117,27 +120,6 @@ macro_rules! impl_serde_traits (($name:ident, $bytes_function:ident) => ( } )); -#[cfg(test)] -#[cfg(feature = "serde")] -macro_rules! test_serde_impls (($name:ident, $gen_length:expr) => ( - #[test] - fn test_serde_serialized_equivalence_to_bytes_fn() { - let bytes = &[38u8; $gen_length][..]; - let orion_type = $name::from_slice(bytes).unwrap(); - let serialized_from_bytes = serde_json::to_value(bytes).unwrap(); - let serialized_from_orion_type = serde_json::to_value(&orion_type).unwrap(); - assert_eq!(serialized_from_bytes, serialized_from_orion_type); - } - - #[test] - fn test_serde_deserialized_equivalence_to_bytes_fn() { - let bytes = &[38u8; $gen_length][..]; - let serialized_from_bytes = serde_json::to_value(bytes).unwrap(); - let orion_type: $name = serde_json::from_value(serialized_from_bytes).unwrap(); - assert_eq!(orion_type, bytes); - } -)); - /// Macro that implements the `Drop` trait on a object called `$name` which has /// a field `value`. This `Drop` will zero out the field `value` when the /// objects destructor is called. @@ -309,6 +291,27 @@ macro_rules! func_generate_variable_size (($name:ident) => ( /// /// Test implementation macros +#[cfg(test)] +#[cfg(feature = "serde")] +macro_rules! test_serde_impls (($name:ident, $gen_length:expr) => ( + #[test] + fn test_serde_serialized_equivalence_to_bytes_fn() { + let bytes = &[38u8; $gen_length][..]; + let orion_type = $name::from_slice(bytes).unwrap(); + let serialized_from_bytes = serde_json::to_value(bytes).unwrap(); + let serialized_from_orion_type = serde_json::to_value(&orion_type).unwrap(); + assert_eq!(serialized_from_bytes, serialized_from_orion_type); + } + + #[test] + fn test_serde_deserialized_equivalence_to_bytes_fn() { + let bytes = &[38u8; $gen_length][..]; + let serialized_from_bytes = serde_json::to_value(bytes).unwrap(); + let orion_type: $name = serde_json::from_value(serialized_from_bytes).unwrap(); + assert_eq!(orion_type, bytes); + } +)); + #[cfg(test)] macro_rules! test_bound_parameters (($name:ident, $lower_bound:expr, $upper_bound:expr, $gen_length:expr) => ( #[test]