Skip to content

Commit

Permalink
0.16.1 (#247)
Browse files Browse the repository at this point in the history
* Bump version and add CHANGELOG entry

* doc: Add missing rendering of serde feature badges (see #240)

* Update 0.16.1 date TBD
  • Loading branch information
brycx authored Nov 3, 2021
1 parent 71744b8 commit ae33cae
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 23 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 <brycx@protonmail.com>"]
description = "Usable, easy and safe pure-Rust crypto"
keywords = [ "cryptography", "crypto", "aead", "hash", "mac" ]
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
45 changes: 24 additions & 21 deletions src/typedefs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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<u8>` would. If it succeeds, the digest
/// will be built using `Self::from_slice`.
///
Expand All @@ -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.
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit ae33cae

Please sign in to comment.