Skip to content

Commit

Permalink
Merge branch 'main' into rm-getrandom-js
Browse files Browse the repository at this point in the history
  • Loading branch information
franziskuskiefer authored Nov 27, 2023
2 parents f066e70 + aae8d0a commit b6f1fad
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
5 changes: 4 additions & 1 deletion traits/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@ readme = "Readme.md"
repository = "https://github.com/franziskuskiefer/hpke-rs"

[dependencies]
serde = { version = "1.0", features = ["derive"] }
serde = { version = "1.0", features = ["derive"], optional = true }
rand_core = { version = "0.6.4" }

[features]
serde = ["dep:serde"]
10 changes: 7 additions & 3 deletions traits/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
//!
//! Algorithm definitions for the [`crate::HpkeCrypto`] trait.

#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};

use crate::error;

/// KEM Modes
#[derive(PartialEq, Copy, Clone, Debug, Serialize, Deserialize)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[derive(PartialEq, Copy, Clone, Debug)]
#[repr(u16)]
pub enum KemAlgorithm {
/// DH KEM on P256
Expand Down Expand Up @@ -70,7 +72,8 @@ impl KemAlgorithm {
}
}

#[derive(Debug, PartialEq, Eq, Clone, Copy, Serialize, Deserialize)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
#[repr(u16)]
/// AEAD types
pub enum AeadAlgorithm {
Expand Down Expand Up @@ -150,7 +153,8 @@ impl AeadAlgorithm {
}
}

#[derive(Debug, PartialEq, Eq, Clone, Copy, Serialize, Deserialize)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
#[repr(u16)]
/// KDF types
/// Value are taken from the HPKE RFC (not published yet)
Expand Down

0 comments on commit b6f1fad

Please sign in to comment.