pub enum HpkeError {
+HpkeError in hpke_rs - Rust pub enum HpkeError {
OpenError,
InvalidConfig,
InvalidInput,
@@ -10,7 +10,6 @@
CryptoError(String),
MessageLimitReached,
InsufficientRandomness,
- LockPoisoned,
}
Expand description
HPKE Error types.
Variants§
§OpenError
Error opening an HPKE ciphertext.
§InvalidConfig
Invalid configuration or arguments.
@@ -23,10 +22,9 @@
§CryptoError(String)
An error in the crypto library occurred.
§MessageLimitReached
The message limit for this AEAD, key, and nonce.
§InsufficientRandomness
Unable to collect enough randomness.
-§LockPoisoned
A concurrency issue with an RwLock
.
-Trait Implementations§
source§impl Error for HpkeError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl PartialEq<HpkeError> for HpkeError
Trait Implementations§
source§impl Error for HpkeError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl PartialEq<HpkeError> for HpkeError
source§impl StructuralPartialEq for HpkeError
Auto Trait Implementations§
§impl RefUnwindSafe for HpkeError
§impl Send for HpkeError
§impl Sync for HpkeError
§impl Unpin for HpkeError
§impl UnwindSafe for HpkeError
Blanket Implementations§
source§impl StructuralPartialEq for HpkeError
Auto Trait Implementations§
§impl RefUnwindSafe for HpkeError
§impl Send for HpkeError
§impl Sync for HpkeError
§impl Unpin for HpkeError
§impl UnwindSafe for HpkeError
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moresource§impl<T> From<T> for T
source§fn from(t: T) -> T
Returns the argument unchanged.
diff --git a/hpke_rs/enum.Mode.html b/hpke_rs/enum.Mode.html
index 97c29d8..ae7db6c 100644
--- a/hpke_rs/enum.Mode.html
+++ b/hpke_rs/enum.Mode.html
@@ -1,4 +1,4 @@
-Mode in hpke_rs - Rust #[repr(u8)]pub enum Mode {
+Mode in hpke_rs - Rust §Psk
HPKE with PSK.
§Auth
Authenticated HPKE.
§AuthPsk
Authenticated HPKE with PSK.
-
Trait Implementations§
source§impl<'de> Deserialize<'de> for Mode
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl PartialEq<Mode> for Mode
Trait Implementations§
source§impl<'de> Deserialize<'de> for Mode
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl PartialEq<Mode> for Mode
source§impl Copy for Mode
source§impl StructuralPartialEq for Mode
Auto Trait Implementations§
§impl RefUnwindSafe for Mode
§impl Send for Mode
§impl Sync for Mode
§impl Unpin for Mode
§impl UnwindSafe for Mode
Blanket Implementations§
source§impl Copy for Mode
source§impl StructuralPartialEq for Mode
Auto Trait Implementations§
§impl RefUnwindSafe for Mode
§impl Send for Mode
§impl Sync for Mode
§impl Unpin for Mode
§impl UnwindSafe for Mode
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moresource§impl<T> From<T> for T
source§fn from(t: T) -> T
Returns the argument unchanged.
diff --git a/hpke_rs/index.html b/hpke_rs/index.html
index 6565b46..cfd171d 100644
--- a/hpke_rs/index.html
+++ b/hpke_rs/index.html
@@ -1,4 +1,4 @@
-hpke_rs - Rust Expand description
HPKE
+hpke_rs - Rust Expand description
HPKE
diff --git a/hpke_rs/prelude/trait.TryFrom.html b/hpke_rs/prelude/trait.TryFrom.html
index 37cd800..93185a6 100644
--- a/hpke_rs/prelude/trait.TryFrom.html
+++ b/hpke_rs/prelude/trait.TryFrom.html
@@ -65,7 +65,7 @@
Examples
§type Error = TryFromCharError
1.74.0 · source§impl TryFrom<char> for u16
Maps a char
with code point in U+0000..=U+FFFF to a u16
in 0x0000..=0xFFFF with same value,
failing if the code point is greater than U+FFFF.
This corresponds to the UCS-2 encoding, as specified in ISO/IEC 10646:2003.
-§type Error = TryFromCharError
1.46.0 · source§impl TryFrom<i16> for NonZeroI16
§type Error = TryFromIntError
1.46.0 · source§impl TryFrom<i32> for NonZeroI32
§type Error = TryFromIntError
1.46.0 · source§impl TryFrom<i64> for NonZeroI64
§type Error = TryFromIntError
1.46.0 · source§impl TryFrom<i128> for NonZeroI128
§type Error = TryFromIntError
1.46.0 · source§impl TryFrom<isize> for NonZeroIsize
§type Error = TryFromIntError
1.46.0 · source§impl TryFrom<u16> for NonZeroU16
§type Error = TryFromIntError
1.46.0 · source§impl TryFrom<u32> for NonZeroU32
§type Error = TryFromIntError
1.46.0 · source§impl TryFrom<u64> for NonZeroU64
§type Error = TryFromIntError
1.46.0 · source§impl TryFrom<u128> for NonZeroU128
§type Error = TryFromIntError
1.46.0 · source§impl TryFrom<usize> for NonZeroUsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI8> for NonZeroU16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI8> for NonZeroU32
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI8> for NonZeroU64
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI8> for NonZeroU128
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI8> for NonZeroUsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI16> for NonZeroI8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI16> for NonZeroU8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI16> for NonZeroU16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI16> for NonZeroU32
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI16> for NonZeroU64
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI16> for NonZeroU128
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI16> for NonZeroUsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI32> for NonZeroI8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI32> for NonZeroI16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI32> for NonZeroIsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI32> for NonZeroU8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI32> for NonZeroU16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI32> for NonZeroU32
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI32> for NonZeroU64
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI32> for NonZeroU128
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI32> for NonZeroUsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI64> for NonZeroI8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI64> for NonZeroI16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI64> for NonZeroI32
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI64> for NonZeroIsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI64> for NonZeroU8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI64> for NonZeroU16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI64> for NonZeroU32
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI64> for NonZeroU64
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI64> for NonZeroU128
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI64> for NonZeroUsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI128> for NonZeroI8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI128> for NonZeroI16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI128> for NonZeroI32
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI128> for NonZeroI64
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI128> for NonZeroIsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI128> for NonZeroU8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI128> for NonZeroU16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI128> for NonZeroU32
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI128> for NonZeroU64
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI128> for NonZeroU128
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI128> for NonZeroUsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroIsize> for NonZeroI8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroIsize> for NonZeroI16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroIsize> for NonZeroI32
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroIsize> for NonZeroI64
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroIsize> for NonZeroI128
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroIsize> for NonZeroU8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroIsize> for NonZeroU16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroIsize> for NonZeroU32
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroIsize> for NonZeroU64
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroIsize> for NonZeroU128
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroIsize> for NonZeroUsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU16> for NonZeroI8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU16> for NonZeroI16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU16> for NonZeroIsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU16> for NonZeroU8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU32> for NonZeroI8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU32> for NonZeroI16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU32> for NonZeroI32
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU32> for NonZeroIsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU32> for NonZeroU8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU32> for NonZeroU16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU32> for NonZeroUsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU64> for NonZeroI8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU64> for NonZeroI16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU64> for NonZeroI32
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU64> for NonZeroI64
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU64> for NonZeroIsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU64> for NonZeroU8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU64> for NonZeroU16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU64> for NonZeroU32
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU64> for NonZeroUsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU128> for NonZeroI8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU128> for NonZeroI16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU128> for NonZeroI32
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU128> for NonZeroI64
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU128> for NonZeroI128
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU128> for NonZeroIsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU128> for NonZeroU8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU128> for NonZeroU16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU128> for NonZeroU32
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU128> for NonZeroU64
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU128> for NonZeroUsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroUsize> for NonZeroI8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroUsize> for NonZeroI16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroUsize> for NonZeroI32
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroUsize> for NonZeroI64
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroUsize> for NonZeroI128
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroUsize> for NonZeroIsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroUsize> for NonZeroU8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroUsize> for NonZeroU16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroUsize> for NonZeroU32
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroUsize> for NonZeroU64
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroUsize> for NonZeroU128
§type Error = TryFromIntError
source§impl TryFrom<NonZeroUsize> for Alignment
§type Error = TryFromIntError
source§impl<'a, T, const N: usize> TryFrom<&'a [T]> for &'a [T; N]
Tries to create an array ref &[T; N]
from a slice ref &[T]
. Succeeds if
+
§type Error = TryFromCharError
1.46.0 · source§impl TryFrom<i16> for NonZeroI16
§type Error = TryFromIntError
1.46.0 · source§impl TryFrom<i32> for NonZeroI32
§type Error = TryFromIntError
1.46.0 · source§impl TryFrom<i64> for NonZeroI64
§type Error = TryFromIntError
1.46.0 · source§impl TryFrom<i128> for NonZeroI128
§type Error = TryFromIntError
1.46.0 · source§impl TryFrom<isize> for NonZeroIsize
§type Error = TryFromIntError
1.46.0 · source§impl TryFrom<u16> for NonZeroU16
§type Error = TryFromIntError
1.46.0 · source§impl TryFrom<u32> for NonZeroU32
§type Error = TryFromIntError
1.46.0 · source§impl TryFrom<u64> for NonZeroU64
§type Error = TryFromIntError
1.46.0 · source§impl TryFrom<u128> for NonZeroU128
§type Error = TryFromIntError
1.46.0 · source§impl TryFrom<usize> for NonZeroUsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI8> for NonZeroU16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI8> for NonZeroU32
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI8> for NonZeroU64
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI8> for NonZeroU128
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI8> for NonZeroUsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI16> for NonZeroI8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI16> for NonZeroU8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI16> for NonZeroU16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI16> for NonZeroU32
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI16> for NonZeroU64
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI16> for NonZeroU128
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI16> for NonZeroUsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI32> for NonZeroI8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI32> for NonZeroI16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI32> for NonZeroIsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI32> for NonZeroU8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI32> for NonZeroU16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI32> for NonZeroU32
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI32> for NonZeroU64
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI32> for NonZeroU128
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI32> for NonZeroUsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI64> for NonZeroI8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI64> for NonZeroI16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI64> for NonZeroI32
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI64> for NonZeroIsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI64> for NonZeroU8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI64> for NonZeroU16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI64> for NonZeroU32
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI64> for NonZeroU64
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI64> for NonZeroU128
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI64> for NonZeroUsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI128> for NonZeroI8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI128> for NonZeroI16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI128> for NonZeroI32
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI128> for NonZeroI64
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI128> for NonZeroIsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI128> for NonZeroU8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI128> for NonZeroU16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI128> for NonZeroU32
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI128> for NonZeroU64
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI128> for NonZeroU128
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroI128> for NonZeroUsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroIsize> for NonZeroI8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroIsize> for NonZeroI16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroIsize> for NonZeroI32
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroIsize> for NonZeroI64
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroIsize> for NonZeroI128
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroIsize> for NonZeroU8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroIsize> for NonZeroU16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroIsize> for NonZeroU32
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroIsize> for NonZeroU64
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroIsize> for NonZeroU128
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroIsize> for NonZeroUsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU16> for NonZeroI8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU16> for NonZeroI16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU16> for NonZeroIsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU16> for NonZeroU8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU32> for NonZeroI8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU32> for NonZeroI16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU32> for NonZeroI32
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU32> for NonZeroIsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU32> for NonZeroU8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU32> for NonZeroU16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU32> for NonZeroUsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU64> for NonZeroI8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU64> for NonZeroI16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU64> for NonZeroI32
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU64> for NonZeroI64
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU64> for NonZeroIsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU64> for NonZeroU8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU64> for NonZeroU16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU64> for NonZeroU32
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU64> for NonZeroUsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU128> for NonZeroI8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU128> for NonZeroI16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU128> for NonZeroI32
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU128> for NonZeroI64
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU128> for NonZeroI128
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU128> for NonZeroIsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU128> for NonZeroU8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU128> for NonZeroU16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU128> for NonZeroU32
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU128> for NonZeroU64
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroU128> for NonZeroUsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroUsize> for NonZeroI8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroUsize> for NonZeroI16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroUsize> for NonZeroI32
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroUsize> for NonZeroI64
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroUsize> for NonZeroI128
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroUsize> for NonZeroIsize
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroUsize> for NonZeroU8
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroUsize> for NonZeroU16
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroUsize> for NonZeroU32
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroUsize> for NonZeroU64
§type Error = TryFromIntError
1.49.0 · source§impl TryFrom<NonZeroUsize> for NonZeroU128
§type Error = TryFromIntError
source§impl TryFrom<NonZeroUsize> for Alignment
§type Error = TryFromIntError
source§impl<'a, T, const N: usize> TryFrom<&'a [T]> for &'a [T; N]
Tries to create an array ref &[T; N]
from a slice ref &[T]
. Succeeds if
slice.len() == N
.
let bytes: [u8; 3] = [1, 0, 2];
@@ -114,4 +114,4 @@ Examples
assert_eq!(512, u16::from_le_bytes(bytes_tail));
§type Error = TryFromSliceError
source§impl<T, const N: usize> TryFrom<&mut [T]> for Simd<T, N>where
LaneCount<N>: SupportedLaneCount,
- T: SimdElement,
§type Error = TryFromSliceError
\ No newline at end of file
+ T: SimdElement,§type Error = TryFromSliceError
\ No newline at end of file
diff --git a/hpke_rs/struct.Context.html b/hpke_rs/struct.Context.html
index ae6a0bb..0ff663e 100644
--- a/hpke_rs/struct.Context.html
+++ b/hpke_rs/struct.Context.html
@@ -1,7 +1,7 @@
-Context in hpke_rs - Rust pub struct Context<Crypto: 'static + HpkeCrypto> { /* private fields */ }
Expand description
The HPKE context.
+
Context in hpke_rs - Rust pub struct Context<Crypto: 'static + HpkeCrypto> { /* private fields */ }
Expand description
The HPKE context.
Note that the RFC currently doesn’t define this.
Also see https://github.com/cfrg/draft-irtf-cfrg-hpke/issues/161.
-Implementations§
Implementations§
Trait Implementations§
Auto Trait Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<Crypto> RefUnwindSafe for Context<Crypto>where + <Crypto as HpkeCrypto>::HpkePrng: RefUnwindSafe,
impl<Crypto> Send for Context<Crypto>where <Crypto as HpkeCrypto>::HpkePrng: Send,
impl<Crypto> Sync for Context<Crypto>where - <Crypto as HpkeCrypto>::HpkePrng: Send + Sync,
impl<Crypto> Unpin for Context<Crypto>where - <Crypto as HpkeCrypto>::HpkePrng: Unpin,
impl<Crypto> UnwindSafe for Context<Crypto>
Blanket Implementations§
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> From<T> for T
impl<T> From<T> for T
source§fn from(t: T) -> T
fn from(t: T) -> T
Returns the argument unchanged.
diff --git a/hpke_rs/struct.Hpke.html b/hpke_rs/struct.Hpke.html index ad4ca8f..c0284af 100644 --- a/hpke_rs/struct.Hpke.html +++ b/hpke_rs/struct.Hpke.html @@ -1,18 +1,18 @@ -pub struct Hpke<Crypto: 'static + HpkeCrypto> { /* private fields */ }
Expand description
The HPKE configuration struct. +
pub struct Hpke<Crypto: 'static + HpkeCrypto> { /* private fields */ }
Expand description
The HPKE configuration struct.
This holds the configuration for HPKE but no state.
To use HPKE first instantiate the configuration with
let hpke = Hpke::new(mode, kem_mode, kdf_mode, aead_mode)
.
Now one can use the hpke
configuration.
Note that cloning does NOT clone the PRNG state.
-Implementations§
Implementations§
source§impl<Crypto: HpkeCrypto> Hpke<Crypto>
impl<Crypto: HpkeCrypto> Hpke<Crypto>
sourcepub fn new(
mode: Mode,
kem_id: KemAlgorithm,
kdf_id: KdfAlgorithm,
aead_id: AeadAlgorithm
) -> Self
pub fn new( mode: Mode, kem_id: KemAlgorithm, kdf_id: KdfAlgorithm, aead_id: AeadAlgorithm ) -> Self
Set up the configuration for HPKE.
-sourcepub fn setup_sender(
- &self,
+
pub fn setup_sender( - &self, +
sourcepub fn setup_sender(
+ &mut self,
pk_r: &HpkePublicKey,
info: &[u8],
psk: Option<&[u8]>,
@@ -29,7 +29,7 @@
such that it doesn’t make sense to deserialize before passing it in.
The encapsulated secret is returned together with the context.
If the secret key is missing in an authenticated mode, an error is returned.
-
pub fn setup_sender( + &mut self, pk_r: &HpkePublicKey, info: &[u8], psk: Option<&[u8]>, @@ -29,7 +29,7 @@ such that it doesn’t make sense to deserialize before passing it in.
The encapsulated secret is returned together with the context. If the secret key is missing in an authenticated mode, an error is returned.
-sourcepub fn setup_receiver(
+
pub fn setup_receiver( +
sourcepub fn setup_receiver(
&self,
enc: &[u8],
sk_r: &HpkePrivateKey,
@@ -49,8 +49,8 @@
The context based on the decapsulated values and, if present, the PSK is
returned.
If the secret key is missing in an authenticated mode, an error is returned.
-
pub fn setup_receiver( &self, enc: &[u8], sk_r: &HpkePrivateKey, @@ -49,8 +49,8 @@
The context based on the decapsulated values and, if present, the PSK is returned. If the secret key is missing in an authenticated mode, an error is returned.
-sourcepub fn seal(
+ &mut self,
pk_r: &HpkePublicKey,
info: &[u8],
aad: &[u8],
@@ -69,7 +69,7 @@
But the public keys will be present in encoded form rather than raw form
such that it doesn’t make sense to deserialize before passing it in.
Returns the encapsulated secret and the ciphertext, or an error.
-
pub fn seal( + &mut self, pk_r: &HpkePublicKey, info: &[u8], aad: &[u8], @@ -69,7 +69,7 @@ But the public keys will be present in encoded form rather than raw form such that it doesn’t make sense to deserialize before passing it in.
Returns the encapsulated secret and the ciphertext, or an error.
-sourcepub fn open(
&self,
enc: &[u8],
sk_r: &HpkePrivateKey,
@@ -89,8 +89,8 @@
But the public keys will be present in encoded form rather than raw form
such that it doesn’t make sense to deserialize before passing it in.
Returns the decrypted plain text, or an error.
-
pub fn open( &self, enc: &[u8], sk_r: &HpkePrivateKey, @@ -89,8 +89,8 @@ But the public keys will be present in encoded form rather than raw form such that it doesn’t make sense to deserialize before passing it in.
Returns the decrypted plain text, or an error.
-sourcepub fn send_export(
- &self,
+
pub fn send_export( - &self, +
sourcepub fn send_export(
+ &mut self,
pk_r: &HpkePublicKey,
info: &[u8],
psk: Option<&[u8]>,
@@ -110,7 +110,7 @@
such that it doesn’t make sense to deserialize before passing it in.
Returns the encapsulated secret and the exporter secret for the given
exporter context and length.
-
pub fn send_export( + &mut self, pk_r: &HpkePublicKey, info: &[u8], psk: Option<&[u8]>, @@ -110,7 +110,7 @@ such that it doesn’t make sense to deserialize before passing it in.
Returns the encapsulated secret and the exporter secret for the given exporter context and length.
-sourcepub fn receiver_export(
+
pub fn receiver_export( +
sourcepub fn receiver_export(
&self,
enc: &[u8],
sk_r: &HpkePrivateKey,
@@ -131,7 +131,7 @@
But the public keys will be present in encoded form rather than raw form
such that it doesn’t make sense to deserialize before passing it in.
Returns the exporter secret for the given exporter context and length.
-
pub fn receiver_export( &self, enc: &[u8], sk_r: &HpkePrivateKey, @@ -131,7 +131,7 @@ But the public keys will be present in encoded form rather than raw form such that it doesn’t make sense to deserialize before passing it in.
Returns the exporter secret for the given exporter context and length.
-sourcepub fn key_schedule(
+
pub fn key_schedule( +
sourcepub fn key_schedule(
&self,
shared_secret: &[u8],
info: &[u8],
@@ -139,20 +139,22 @@
psk_id: &[u8]
) -> Result<Context<Crypto>, HpkeError>
pub fn key_schedule( &self, shared_secret: &[u8], info: &[u8], @@ -139,20 +139,22 @@ psk_id: &[u8] ) -> Result<Context<Crypto>, HpkeError>
Creating the Encryption Context Generate the HPKE context from the given input.
-sourcepub fn generate_key_pair(&self) -> Result<HpkeKeyPair, HpkeError>
pub fn generate_key_pair(&self) -> Result<HpkeKeyPair, HpkeError>
-
+
sourcepub fn generate_key_pair(&mut self) -> Result<HpkeKeyPair, HpkeError>
pub fn generate_key_pair(&mut self) -> Result<HpkeKeyPair, HpkeError>
- Cryptographic Dependencies
Randomized algorithm to generate a key pair
(skX, pkX)
for the KEM. This is equivalent toderive_key_pair(random_vector(sk.len()))
Returns an HpkeKeyPair
.
sourcepub fn derive_key_pair(&self, ikm: &[u8]) -> Result<HpkeKeyPair, HpkeError>
pub fn derive_key_pair(&self, ikm: &[u8]) -> Result<HpkeKeyPair, HpkeError>
7.1.2. DeriveKeyPair +
sourcepub fn derive_key_pair(&self, ikm: &[u8]) -> Result<HpkeKeyPair, HpkeError>
pub fn derive_key_pair(&self, ikm: &[u8]) -> Result<HpkeKeyPair, HpkeError>
7.1.2. DeriveKeyPair Derive a key pair for the used KEM with the given input key material.
Returns an HpkeKeyPair
result or an HpkeError
if key derivation fails.
Trait Implementations§
Auto Trait Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<Crypto> RefUnwindSafe for Hpke<Crypto>where + <Crypto as HpkeCrypto>::HpkePrng: RefUnwindSafe,
impl<Crypto> Send for Hpke<Crypto>where <Crypto as HpkeCrypto>::HpkePrng: Send,
impl<Crypto> Sync for Hpke<Crypto>where - <Crypto as HpkeCrypto>::HpkePrng: Send + Sync,
impl<Crypto> Unpin for Hpke<Crypto>where - <Crypto as HpkeCrypto>::HpkePrng: Unpin,
impl<Crypto> UnwindSafe for Hpke<Crypto>
Blanket Implementations§
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> From<T> for T
impl<T> From<T> for T
source§fn from(t: T) -> T
fn from(t: T) -> T
Returns the argument unchanged.
diff --git a/hpke_rs/struct.HpkeKeyPair.html b/hpke_rs/struct.HpkeKeyPair.html index 9e562d8..a4eec4d 100644 --- a/hpke_rs/struct.HpkeKeyPair.html +++ b/hpke_rs/struct.HpkeKeyPair.html @@ -1,12 +1,12 @@ -Struct hpke_rs::HpkeKeyPair
source · pub struct HpkeKeyPair { /* private fields */ }
Expand description
An HPKE key pair has an HPKE private and public key.
-Implementations§
source§impl HpkeKeyPair
impl HpkeKeyPair
sourcepub fn new(sk: Vec<u8>, pk: Vec<u8>) -> Self
pub fn new(sk: Vec<u8>, pk: Vec<u8>) -> Self
Create a new HPKE key pair. +
Struct hpke_rs::HpkeKeyPair
source · pub struct HpkeKeyPair { /* private fields */ }
Expand description
An HPKE key pair has an HPKE private and public key.
+Implementations§
source§impl HpkeKeyPair
impl HpkeKeyPair
sourcepub fn new(sk: Vec<u8>, pk: Vec<u8>) -> Self
pub fn new(sk: Vec<u8>, pk: Vec<u8>) -> Self
Create a new HPKE key pair. Consumes the private and public key bytes.
-sourcepub fn private_key(&self) -> &HpkePrivateKey
pub fn private_key(&self) -> &HpkePrivateKey
Get a reference to the HPKE private key of this key pair.
-sourcepub fn public_key(&self) -> &HpkePublicKey
pub fn public_key(&self) -> &HpkePublicKey
Get a reference to the HPKE public key of this key pair.
-sourcepub fn into_keys(self) -> (HpkePrivateKey, HpkePublicKey)
pub fn into_keys(self) -> (HpkePrivateKey, HpkePublicKey)
Split the key pair into the two keys
-sourcepub fn from_keys(private_key: HpkePrivateKey, public_key: HpkePublicKey) -> Self
pub fn from_keys(private_key: HpkePrivateKey, public_key: HpkePublicKey) -> Self
Build a key pair from two keys
-Trait Implementations§
source§impl Clone for HpkeKeyPair
impl Clone for HpkeKeyPair
source§fn clone(&self) -> HpkeKeyPair
fn clone(&self) -> HpkeKeyPair
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for HpkeKeyPair
impl Debug for HpkeKeyPair
source§impl Default for HpkeKeyPair
impl Default for HpkeKeyPair
source§fn default() -> HpkeKeyPair
fn default() -> HpkeKeyPair
source§impl<'de> Deserialize<'de> for HpkeKeyPair
impl<'de> Deserialize<'de> for HpkeKeyPair
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where - __D: Deserializer<'de>,
source§impl Serialize for HpkeKeyPair
impl Serialize for HpkeKeyPair
sourcepub fn private_key(&self) -> &HpkePrivateKey
pub fn private_key(&self) -> &HpkePrivateKey
Get a reference to the HPKE private key of this key pair.
+sourcepub fn public_key(&self) -> &HpkePublicKey
pub fn public_key(&self) -> &HpkePublicKey
Get a reference to the HPKE public key of this key pair.
+sourcepub fn into_keys(self) -> (HpkePrivateKey, HpkePublicKey)
pub fn into_keys(self) -> (HpkePrivateKey, HpkePublicKey)
Split the key pair into the two keys
+sourcepub fn from_keys(private_key: HpkePrivateKey, public_key: HpkePublicKey) -> Self
pub fn from_keys(private_key: HpkePrivateKey, public_key: HpkePublicKey) -> Self
Build a key pair from two keys
+Trait Implementations§
source§impl Clone for HpkeKeyPair
impl Clone for HpkeKeyPair
source§fn clone(&self) -> HpkeKeyPair
fn clone(&self) -> HpkeKeyPair
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for HpkeKeyPair
impl Debug for HpkeKeyPair
source§impl Default for HpkeKeyPair
impl Default for HpkeKeyPair
source§fn default() -> HpkeKeyPair
fn default() -> HpkeKeyPair
source§impl<'de> Deserialize<'de> for HpkeKeyPair
impl<'de> Deserialize<'de> for HpkeKeyPair
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,
Auto Trait Implementations§
impl RefUnwindSafe for HpkeKeyPair
impl Send for HpkeKeyPair
impl Sync for HpkeKeyPair
impl Unpin for HpkeKeyPair
impl UnwindSafe for HpkeKeyPair
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/hpke_rs/struct.HpkePrivateKey.html b/hpke_rs/struct.HpkePrivateKey.html
index c599330..bdd81a5 100644
--- a/hpke_rs/struct.HpkePrivateKey.html
+++ b/hpke_rs/struct.HpkePrivateKey.html
@@ -1,14 +1,14 @@
-HpkePrivateKey in hpke_rs - Rust Struct hpke_rs::HpkePrivateKey
source · pub struct HpkePrivateKey { /* private fields */ }
Expand description
An HPKE private key is a byte vector.
-Implementations§
source§impl HpkePrivateKey
sourcepub fn new(b: Vec<u8>) -> Self
Create a new HPKE private key.
+
HpkePrivateKey in hpke_rs - Rust Struct hpke_rs::HpkePrivateKey
source · pub struct HpkePrivateKey { /* private fields */ }
Expand description
An HPKE private key is a byte vector.
+Implementations§
Trait Implementations§
source§impl Clone for HpkePrivateKey
source§fn clone(&self) -> HpkePrivateKey
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkePrivateKey
source§impl Default for HpkePrivateKey
source§fn default() -> HpkePrivateKey
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkePrivateKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<&[u8]> for HpkePrivateKey
source§impl PartialEq<HpkePrivateKey> for HpkePrivateKey
Hopefully constant time comparison of the two values as long as they have the
+
Trait Implementations§
source§impl Clone for HpkePrivateKey
source§fn clone(&self) -> HpkePrivateKey
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkePrivateKey
source§impl Default for HpkePrivateKey
source§fn default() -> HpkePrivateKey
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkePrivateKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<&[u8]> for HpkePrivateKey
source§impl PartialEq<HpkePrivateKey> for HpkePrivateKey
Hopefully constant time comparison of the two values as long as they have the
same length.
-source§fn eq(&self, other: &Self) -> bool
This method tests for self
and other
values to be equal, and is used
+source§impl Serialize for HpkePrivateKey
source§impl Zeroize for HpkePrivateKey
source§impl Serialize for HpkePrivateKey
Auto Trait Implementations§
§impl RefUnwindSafe for HpkePrivateKey
§impl Send for HpkePrivateKey
§impl Sync for HpkePrivateKey
§impl Unpin for HpkePrivateKey
§impl UnwindSafe for HpkePrivateKey
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/hpke_rs/struct.HpkePublicKey.html b/hpke_rs/struct.HpkePublicKey.html
index fac3457..d162776 100644
--- a/hpke_rs/struct.HpkePublicKey.html
+++ b/hpke_rs/struct.HpkePublicKey.html
@@ -1,20 +1,20 @@
-HpkePublicKey in hpke_rs - Rust Struct hpke_rs::HpkePublicKey
source · pub struct HpkePublicKey { /* private fields */ }
Expand description
An HPKE public key is a byte vector.
-Implementations§
source§impl HpkePublicKey
sourcepub fn new(value: Vec<u8>) -> Self
Create a new HPKE public key.
+
HpkePublicKey in hpke_rs - Rust Struct hpke_rs::HpkePublicKey
source · pub struct HpkePublicKey { /* private fields */ }
Expand description
An HPKE public key is a byte vector.
+Implementations§
Trait Implementations§
source§impl Clone for HpkePublicKey
source§fn clone(&self) -> HpkePublicKey
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkePublicKey
source§impl Default for HpkePublicKey
source§fn default() -> HpkePublicKey
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkePublicKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Deserialize for &HpkePublicKey
source§fn tls_deserialize<R: Read>(_: &mut R) -> Result<Self, Error>
This function deserializes the bytes
from the provided a std::io::Read
-and returns the populated struct. Read moresource§impl Deserialize for HpkePublicKey
Trait Implementations§
source§impl Clone for HpkePublicKey
source§fn clone(&self) -> HpkePublicKey
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkePublicKey
source§impl Default for HpkePublicKey
source§fn default() -> HpkePublicKey
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkePublicKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Deserialize for &HpkePublicKey
source§fn tls_deserialize<R: Read>(_: &mut R) -> Result<Self, Error>
This function deserializes the bytes
from the provided a std::io::Read
and returns the populated struct. Read moresource§impl From<&[u8]> for HpkePublicKey
source§impl PartialEq<HpkePublicKey> for HpkePublicKey
source§impl Deserialize for HpkePublicKey
source§fn tls_deserialize<R: Read>(bytes: &mut R) -> Result<Self, Error>
This function deserializes the bytes
from the provided a std::io::Read
+and returns the populated struct. Read moresource§impl From<&[u8]> for HpkePublicKey
source§impl PartialEq<HpkePublicKey> for HpkePublicKey
source§fn eq(&self, other: &HpkePublicKey) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
.source§impl Serialize for &HpkePublicKey
source§impl Serialize for HpkePublicKey
source§impl Serialize for HpkePublicKey
source§impl Size for &HpkePublicKey
source§fn tls_serialized_len(&self) -> usize
source§impl Size for HpkePublicKey
source§fn tls_serialized_len(&self) -> usize
source§impl StructuralPartialEq for HpkePublicKey
Auto Trait Implementations§
§impl RefUnwindSafe for HpkePublicKey
§impl Send for HpkePublicKey
§impl Sync for HpkePublicKey
§impl Unpin for HpkePublicKey
§impl UnwindSafe for HpkePublicKey
Blanket Implementations§
source§impl Serialize for &HpkePublicKey
source§impl Serialize for HpkePublicKey
source§impl Serialize for HpkePublicKey
source§impl Size for &HpkePublicKey
source§fn tls_serialized_len(&self) -> usize
source§impl Size for HpkePublicKey
source§fn tls_serialized_len(&self) -> usize
source§impl StructuralPartialEq for HpkePublicKey
Auto Trait Implementations§
§impl RefUnwindSafe for HpkePublicKey
§impl Send for HpkePublicKey
§impl Sync for HpkePublicKey
§impl Unpin for HpkePublicKey
§impl UnwindSafe for HpkePublicKey
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moresource§impl<T> From<T> for T
source§fn from(t: T) -> T
Returns the argument unchanged.
diff --git a/hpke_rs/test_util/fn.bytes_to_hex.html b/hpke_rs/test_util/fn.bytes_to_hex.html
index c47028a..a04498e 100644
--- a/hpke_rs/test_util/fn.bytes_to_hex.html
+++ b/hpke_rs/test_util/fn.bytes_to_hex.html
@@ -1,2 +1,2 @@
-bytes_to_hex in hpke_rs::test_util - Rust Function hpke_rs::test_util::bytes_to_hex
source · pub fn bytes_to_hex(bytes: &[u8]) -> String
Expand description
Convert bytes
to a hex string.
+bytes_to_hex in hpke_rs::test_util - Rust
\ No newline at end of file
diff --git a/hpke_rs/test_util/fn.hex_to_bytes.html b/hpke_rs/test_util/fn.hex_to_bytes.html
index 84e2f6e..9cc1035 100644
--- a/hpke_rs/test_util/fn.hex_to_bytes.html
+++ b/hpke_rs/test_util/fn.hex_to_bytes.html
@@ -1,2 +1,2 @@
-hex_to_bytes in hpke_rs::test_util - Rust Function hpke_rs::test_util::hex_to_bytes
source · pub fn hex_to_bytes(hex: &str) -> Vec<u8>
Expand description
Convert a hex string to a byte vector.
+hex_to_bytes in hpke_rs::test_util - Rust
\ No newline at end of file
diff --git a/hpke_rs/test_util/fn.hex_to_bytes_option.html b/hpke_rs/test_util/fn.hex_to_bytes_option.html
index 7240995..d0bf887 100644
--- a/hpke_rs/test_util/fn.hex_to_bytes_option.html
+++ b/hpke_rs/test_util/fn.hex_to_bytes_option.html
@@ -1,3 +1,3 @@
-hex_to_bytes_option in hpke_rs::test_util - Rust Function hpke_rs::test_util::hex_to_bytes_option
source · pub fn hex_to_bytes_option(hex: Option<String>) -> Vec<u8>
Expand description
Convert a hex string to a byte vector.
+
hex_to_bytes_option in hpke_rs::test_util - Rust
\ No newline at end of file
diff --git a/hpke_rs/test_util/fn.vec_to_option_slice.html b/hpke_rs/test_util/fn.vec_to_option_slice.html
index bb11c70..5ddbf28 100644
--- a/hpke_rs/test_util/fn.vec_to_option_slice.html
+++ b/hpke_rs/test_util/fn.vec_to_option_slice.html
@@ -1,3 +1,3 @@
-vec_to_option_slice in hpke_rs::test_util - Rust Function hpke_rs::test_util::vec_to_option_slice
source · pub fn vec_to_option_slice(v: &[u8]) -> Option<&[u8]>
Expand description
Convert a byte slice into byte slice option.
+
vec_to_option_slice in hpke_rs::test_util - Rust
\ No newline at end of file
diff --git a/hpke_rs/test_util/index.html b/hpke_rs/test_util/index.html
index 301a0d6..c48a151 100644
--- a/hpke_rs/test_util/index.html
+++ b/hpke_rs/test_util/index.html
@@ -1,4 +1,4 @@
-hpke_rs::test_util - Rust Expand description
Test util module. Should be moved really.
+hpke_rs::test_util - Rust Expand description
Test util module. Should be moved really.
Functions
- Convert
bytes
to a hex string. - Convert a hex string to a byte vector.
- Convert a hex string to a byte vector.
If the input is
None
, this returns an empty vector. - Convert a byte slice into byte slice option.
Returns
Nonce
if the byte slice is empty and Some(v)
otherwise.
\ No newline at end of file
diff --git a/hpke_rs/type.HPKEKeyPair.html b/hpke_rs/type.HPKEKeyPair.html
index 9a9f9de..e10b94e 100644
--- a/hpke_rs/type.HPKEKeyPair.html
+++ b/hpke_rs/type.HPKEKeyPair.html
@@ -1,9 +1,9 @@
-HPKEKeyPair in hpke_rs - Rust Type Alias hpke_rs::HPKEKeyPair
source · pub type HPKEKeyPair = HpkeKeyPair;
👎Deprecated since 0.0.7: Please use HpkeKeyPair instead. This alias will be removed with the first stable 0.1 release.Aliased Type§
struct HPKEKeyPair { /* private fields */ }
Implementations§
source§impl HpkeKeyPair
sourcepub fn new(sk: Vec<u8>, pk: Vec<u8>) -> Self
Create a new HPKE key pair.
+
HPKEKeyPair in hpke_rs - Rust Type Alias hpke_rs::HPKEKeyPair
source · pub type HPKEKeyPair = HpkeKeyPair;
👎Deprecated since 0.0.7: Please use HpkeKeyPair instead. This alias will be removed with the first stable 0.1 release.Aliased Type§
struct HPKEKeyPair { /* private fields */ }
Implementations§
source§impl HpkeKeyPair
sourcepub fn new(sk: Vec<u8>, pk: Vec<u8>) -> Self
Create a new HPKE key pair.
Consumes the private and public key bytes.
-sourcepub fn private_key(&self) -> &HpkePrivateKey
Get a reference to the HPKE private key of this key pair.
-sourcepub fn public_key(&self) -> &HpkePublicKey
Get a reference to the HPKE public key of this key pair.
-sourcepub fn into_keys(self) -> (HpkePrivateKey, HpkePublicKey)
Split the key pair into the two keys
-sourcepub fn from_keys(private_key: HpkePrivateKey, public_key: HpkePublicKey) -> Self
Build a key pair from two keys
-Trait Implementations§
source§impl Clone for HpkeKeyPair
source§fn clone(&self) -> HpkeKeyPair
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkeKeyPair
source§impl Default for HpkeKeyPair
source§fn default() -> HpkeKeyPair
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkeKeyPair
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Serialize for HpkeKeyPair
sourcepub fn private_key(&self) -> &HpkePrivateKey
Get a reference to the HPKE private key of this key pair.
+sourcepub fn public_key(&self) -> &HpkePublicKey
Get a reference to the HPKE public key of this key pair.
+sourcepub fn into_keys(self) -> (HpkePrivateKey, HpkePublicKey)
Split the key pair into the two keys
+sourcepub fn from_keys(private_key: HpkePrivateKey, public_key: HpkePublicKey) -> Self
Build a key pair from two keys
+Trait Implementations§
source§impl Clone for HpkeKeyPair
source§fn clone(&self) -> HpkeKeyPair
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkeKeyPair
source§impl Default for HpkeKeyPair
source§fn default() -> HpkeKeyPair
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkeKeyPair
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
\ No newline at end of file
diff --git a/hpke_rs/type.HPKEPrivateKey.html b/hpke_rs/type.HPKEPrivateKey.html
index 44660f2..c21fe66 100644
--- a/hpke_rs/type.HPKEPrivateKey.html
+++ b/hpke_rs/type.HPKEPrivateKey.html
@@ -1,11 +1,11 @@
-HPKEPrivateKey in hpke_rs - Rust Type Alias hpke_rs::HPKEPrivateKey
source · pub type HPKEPrivateKey = HpkePrivateKey;
👎Deprecated since 0.0.7: Please use HpkePrivateKey instead. This alias will be removed with the first stable 0.1 release.Aliased Type§
struct HPKEPrivateKey { /* private fields */ }
Implementations§
source§impl HpkePrivateKey
sourcepub fn new(b: Vec<u8>) -> Self
Create a new HPKE private key.
+
HPKEPrivateKey in hpke_rs - Rust Type Alias hpke_rs::HPKEPrivateKey
source · pub type HPKEPrivateKey = HpkePrivateKey;
👎Deprecated since 0.0.7: Please use HpkePrivateKey instead. This alias will be removed with the first stable 0.1 release.Aliased Type§
struct HPKEPrivateKey { /* private fields */ }
Implementations§
Trait Implementations§
source§impl Clone for HpkePrivateKey
source§fn clone(&self) -> HpkePrivateKey
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkePrivateKey
source§impl Default for HpkePrivateKey
source§fn default() -> HpkePrivateKey
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkePrivateKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<&[u8]> for HpkePrivateKey
source§impl PartialEq<HpkePrivateKey> for HpkePrivateKey
Hopefully constant time comparison of the two values as long as they have the
+
Trait Implementations§
source§impl Clone for HpkePrivateKey
source§fn clone(&self) -> HpkePrivateKey
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkePrivateKey
source§impl Default for HpkePrivateKey
source§fn default() -> HpkePrivateKey
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkePrivateKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<&[u8]> for HpkePrivateKey
source§impl PartialEq<HpkePrivateKey> for HpkePrivateKey
Hopefully constant time comparison of the two values as long as they have the
same length.
-source§fn eq(&self, other: &Self) -> bool
This method tests for self
and other
values to be equal, and is used
+source§impl Serialize for HpkePrivateKey
source§impl Zeroize for HpkePrivateKey
source§impl Serialize for HpkePrivateKey
\ No newline at end of file
diff --git a/hpke_rs/type.HPKEPublicKey.html b/hpke_rs/type.HPKEPublicKey.html
index 44dc41a..81d662f 100644
--- a/hpke_rs/type.HPKEPublicKey.html
+++ b/hpke_rs/type.HPKEPublicKey.html
@@ -1,12 +1,12 @@
-HPKEPublicKey in hpke_rs - Rust Type Alias hpke_rs::HPKEPublicKey
source · pub type HPKEPublicKey = HpkePublicKey;
👎Deprecated since 0.0.7: Please use HpkePublicKey instead. This alias will be removed with the first stable 0.1 release.Aliased Type§
struct HPKEPublicKey { /* private fields */ }
Implementations§
source§impl HpkePublicKey
sourcepub fn new(value: Vec<u8>) -> Self
Create a new HPKE public key.
+
HPKEPublicKey in hpke_rs - Rust Type Alias hpke_rs::HPKEPublicKey
source · pub type HPKEPublicKey = HpkePublicKey;
👎Deprecated since 0.0.7: Please use HpkePublicKey instead. This alias will be removed with the first stable 0.1 release.Aliased Type§
struct HPKEPublicKey { /* private fields */ }
Implementations§
Trait Implementations§
source§impl Clone for HpkePublicKey
source§fn clone(&self) -> HpkePublicKey
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkePublicKey
source§impl Default for HpkePublicKey
source§fn default() -> HpkePublicKey
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkePublicKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Deserialize for HpkePublicKey
Trait Implementations§
source§impl Clone for HpkePublicKey
source§fn clone(&self) -> HpkePublicKey
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkePublicKey
source§impl Default for HpkePublicKey
source§fn default() -> HpkePublicKey
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkePublicKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Deserialize for HpkePublicKey
source§fn tls_deserialize<R: Read>(bytes: &mut R) -> Result<Self, Error>
This function deserializes the bytes
from the provided a std::io::Read
and returns the populated struct. Read moresource§impl From<&[u8]> for HpkePublicKey
source§impl PartialEq<HpkePublicKey> for HpkePublicKey
source§impl From<&[u8]> for HpkePublicKey
source§impl PartialEq<HpkePublicKey> for HpkePublicKey
source§fn eq(&self, other: &HpkePublicKey) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
.source§impl Serialize for HpkePublicKey
source§impl Serialize for HpkePublicKey
source§impl Size for HpkePublicKey
source§fn tls_serialized_len(&self) -> usize
source§impl StructuralPartialEq for HpkePublicKey
\ No newline at end of file
+sufficient, and should not be overridden without very good reason.source§impl Serialize for HpkePublicKey
source§impl Serialize for HpkePublicKey
source§impl Size for HpkePublicKey
source§fn tls_serialized_len(&self) -> usize
source§impl StructuralPartialEq for HpkePublicKey
\ No newline at end of file
diff --git a/implementors/core/clone/trait.Clone.js b/implementors/core/clone/trait.Clone.js
index 29c3d7e..c7012c5 100644
--- a/implementors/core/clone/trait.Clone.js
+++ b/implementors/core/clone/trait.Clone.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl Clone for HpkePrivateKey"],["impl<Crypto: 'static + HpkeCrypto> Clone for Hpke<Crypto>"],["impl Clone for HpkeKeyPair"],["impl Clone for HpkeError"],["impl Clone for Mode"],["impl Clone for HpkePublicKey"]]
+"hpke_rs":[["impl Clone for HpkePublicKey"],["impl Clone for Mode"],["impl Clone for HpkePrivateKey"],["impl<Crypto: 'static + HpkeCrypto> Clone for Hpke<Crypto>"],["impl Clone for HpkeError"],["impl Clone for HpkeKeyPair"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/cmp/trait.PartialEq.js b/implementors/core/cmp/trait.PartialEq.js
index 5f936b7..57abae6 100644
--- a/implementors/core/cmp/trait.PartialEq.js
+++ b/implementors/core/cmp/trait.PartialEq.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl PartialEq<HpkePrivateKey> for HpkePrivateKey"],["impl PartialEq<HpkePublicKey> for HpkePublicKey"],["impl PartialEq<HpkeError> for HpkeError"],["impl PartialEq<Mode> for Mode"]]
+"hpke_rs":[["impl PartialEq<HpkeError> for HpkeError"],["impl PartialEq<HpkePublicKey> for HpkePublicKey"],["impl PartialEq<HpkePrivateKey> for HpkePrivateKey"],["impl PartialEq<Mode> for Mode"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/convert/trait.From.js b/implementors/core/convert/trait.From.js
index 135811f..f37b9ac 100644
--- a/implementors/core/convert/trait.From.js
+++ b/implementors/core/convert/trait.From.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl From<Error> for HpkeError"],["impl From<Vec<u8, Global>> for HpkePublicKey"],["impl From<(Vec<u8, Global>, Vec<u8, Global>)> for HpkeKeyPair"],["impl From<Vec<u8, Global>> for HpkePrivateKey"],["impl From<&[u8]> for HpkePublicKey"],["impl From<(&[u8], &[u8])> for HpkeKeyPair"],["impl From<&[u8]> for HpkePrivateKey"]]
+"hpke_rs":[["impl From<Vec<u8, Global>> for HpkePublicKey"],["impl From<&[u8]> for HpkePrivateKey"],["impl From<(Vec<u8, Global>, Vec<u8, Global>)> for HpkeKeyPair"],["impl From<&[u8]> for HpkePublicKey"],["impl From<Vec<u8, Global>> for HpkePrivateKey"],["impl From<Error> for HpkeError"],["impl From<(&[u8], &[u8])> for HpkeKeyPair"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/default/trait.Default.js b/implementors/core/default/trait.Default.js
index b470006..af577a2 100644
--- a/implementors/core/default/trait.Default.js
+++ b/implementors/core/default/trait.Default.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl Default for HpkeKeyPair"],["impl Default for HpkePublicKey"],["impl Default for HpkePrivateKey"]]
+"hpke_rs":[["impl Default for HpkeKeyPair"],["impl Default for HpkePrivateKey"],["impl Default for HpkePublicKey"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/fmt/trait.Debug.js b/implementors/core/fmt/trait.Debug.js
index 825f35c..005952f 100644
--- a/implementors/core/fmt/trait.Debug.js
+++ b/implementors/core/fmt/trait.Debug.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl<Crypto: Debug + 'static + HpkeCrypto> Debug for Hpke<Crypto>where\n Crypto::HpkePrng: Debug,"],["impl Debug for HpkeError"],["impl<Crypto: HpkeCrypto> Debug for Context<Crypto>"],["impl Debug for HpkePrivateKey"],["impl Debug for Mode"],["impl Debug for HpkeKeyPair"],["impl Debug for HpkePublicKey"]]
+"hpke_rs":[["impl Debug for HpkePublicKey"],["impl Debug for HpkePrivateKey"],["impl Debug for HpkeKeyPair"],["impl Debug for HpkeError"],["impl<Crypto: Debug + 'static + HpkeCrypto> Debug for Hpke<Crypto>where\n Crypto::HpkePrng: Debug,"],["impl Debug for Mode"],["impl<Crypto: HpkeCrypto> Debug for Context<Crypto>"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/marker/trait.Freeze.js b/implementors/core/marker/trait.Freeze.js
index 0625333..6df983d 100644
--- a/implementors/core/marker/trait.Freeze.js
+++ b/implementors/core/marker/trait.Freeze.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl Freeze for HpkeError",1,["hpke_rs::HpkeError"]],["impl Freeze for HpkePublicKey",1,["hpke_rs::HpkePublicKey"]],["impl Freeze for HpkePrivateKey",1,["hpke_rs::HpkePrivateKey"]],["impl Freeze for HpkeKeyPair",1,["hpke_rs::HpkeKeyPair"]],["impl Freeze for Mode",1,["hpke_rs::Mode"]],["impl<Crypto> !Freeze for Context<Crypto>",1,["hpke_rs::Context"]],["impl<Crypto> !Freeze for Hpke<Crypto>",1,["hpke_rs::Hpke"]]]
+"hpke_rs":[["impl Freeze for HpkeError",1,["hpke_rs::HpkeError"]],["impl Freeze for HpkePublicKey",1,["hpke_rs::HpkePublicKey"]],["impl Freeze for HpkePrivateKey",1,["hpke_rs::HpkePrivateKey"]],["impl Freeze for HpkeKeyPair",1,["hpke_rs::HpkeKeyPair"]],["impl Freeze for Mode",1,["hpke_rs::Mode"]],["impl<Crypto> Freeze for Context<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: Freeze,",1,["hpke_rs::Context"]],["impl<Crypto> Freeze for Hpke<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: Freeze,",1,["hpke_rs::Hpke"]]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/marker/trait.StructuralPartialEq.js b/implementors/core/marker/trait.StructuralPartialEq.js
index 9ad52ad..5e93391 100644
--- a/implementors/core/marker/trait.StructuralPartialEq.js
+++ b/implementors/core/marker/trait.StructuralPartialEq.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl StructuralPartialEq for HpkeError"],["impl StructuralPartialEq for HpkePublicKey"],["impl StructuralPartialEq for Mode"]]
+"hpke_rs":[["impl StructuralPartialEq for HpkePublicKey"],["impl StructuralPartialEq for Mode"],["impl StructuralPartialEq for HpkeError"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/marker/trait.Sync.js b/implementors/core/marker/trait.Sync.js
index 6ff5d31..499ecde 100644
--- a/implementors/core/marker/trait.Sync.js
+++ b/implementors/core/marker/trait.Sync.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl Sync for HpkeError",1,["hpke_rs::HpkeError"]],["impl Sync for HpkePublicKey",1,["hpke_rs::HpkePublicKey"]],["impl Sync for HpkePrivateKey",1,["hpke_rs::HpkePrivateKey"]],["impl Sync for HpkeKeyPair",1,["hpke_rs::HpkeKeyPair"]],["impl Sync for Mode",1,["hpke_rs::Mode"]],["impl<Crypto> Sync for Context<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: Send + Sync,",1,["hpke_rs::Context"]],["impl<Crypto> Sync for Hpke<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: Send + Sync,",1,["hpke_rs::Hpke"]]]
+"hpke_rs":[["impl Sync for HpkeError",1,["hpke_rs::HpkeError"]],["impl Sync for HpkePublicKey",1,["hpke_rs::HpkePublicKey"]],["impl Sync for HpkePrivateKey",1,["hpke_rs::HpkePrivateKey"]],["impl Sync for HpkeKeyPair",1,["hpke_rs::HpkeKeyPair"]],["impl Sync for Mode",1,["hpke_rs::Mode"]],["impl<Crypto> Sync for Context<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: Sync,",1,["hpke_rs::Context"]],["impl<Crypto> Sync for Hpke<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: Sync,",1,["hpke_rs::Hpke"]]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js b/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js
index 9d20887..5bd8bb3 100644
--- a/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js
+++ b/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl RefUnwindSafe for HpkeError",1,["hpke_rs::HpkeError"]],["impl RefUnwindSafe for HpkePublicKey",1,["hpke_rs::HpkePublicKey"]],["impl RefUnwindSafe for HpkePrivateKey",1,["hpke_rs::HpkePrivateKey"]],["impl RefUnwindSafe for HpkeKeyPair",1,["hpke_rs::HpkeKeyPair"]],["impl RefUnwindSafe for Mode",1,["hpke_rs::Mode"]],["impl<Crypto> RefUnwindSafe for Context<Crypto>",1,["hpke_rs::Context"]],["impl<Crypto> RefUnwindSafe for Hpke<Crypto>",1,["hpke_rs::Hpke"]]]
+"hpke_rs":[["impl RefUnwindSafe for HpkeError",1,["hpke_rs::HpkeError"]],["impl RefUnwindSafe for HpkePublicKey",1,["hpke_rs::HpkePublicKey"]],["impl RefUnwindSafe for HpkePrivateKey",1,["hpke_rs::HpkePrivateKey"]],["impl RefUnwindSafe for HpkeKeyPair",1,["hpke_rs::HpkeKeyPair"]],["impl RefUnwindSafe for Mode",1,["hpke_rs::Mode"]],["impl<Crypto> RefUnwindSafe for Context<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: RefUnwindSafe,",1,["hpke_rs::Context"]],["impl<Crypto> RefUnwindSafe for Hpke<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: RefUnwindSafe,",1,["hpke_rs::Hpke"]]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/panic/unwind_safe/trait.UnwindSafe.js b/implementors/core/panic/unwind_safe/trait.UnwindSafe.js
index 79979b4..633c214 100644
--- a/implementors/core/panic/unwind_safe/trait.UnwindSafe.js
+++ b/implementors/core/panic/unwind_safe/trait.UnwindSafe.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl UnwindSafe for HpkeError",1,["hpke_rs::HpkeError"]],["impl UnwindSafe for HpkePublicKey",1,["hpke_rs::HpkePublicKey"]],["impl UnwindSafe for HpkePrivateKey",1,["hpke_rs::HpkePrivateKey"]],["impl UnwindSafe for HpkeKeyPair",1,["hpke_rs::HpkeKeyPair"]],["impl UnwindSafe for Mode",1,["hpke_rs::Mode"]],["impl<Crypto> UnwindSafe for Context<Crypto>",1,["hpke_rs::Context"]],["impl<Crypto> UnwindSafe for Hpke<Crypto>",1,["hpke_rs::Hpke"]]]
+"hpke_rs":[["impl UnwindSafe for HpkeError",1,["hpke_rs::HpkeError"]],["impl UnwindSafe for HpkePublicKey",1,["hpke_rs::HpkePublicKey"]],["impl UnwindSafe for HpkePrivateKey",1,["hpke_rs::HpkePrivateKey"]],["impl UnwindSafe for HpkeKeyPair",1,["hpke_rs::HpkeKeyPair"]],["impl UnwindSafe for Mode",1,["hpke_rs::Mode"]],["impl<Crypto> UnwindSafe for Context<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: UnwindSafe,",1,["hpke_rs::Context"]],["impl<Crypto> UnwindSafe for Hpke<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: UnwindSafe,",1,["hpke_rs::Hpke"]]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/serde/de/trait.Deserialize.js b/implementors/serde/de/trait.Deserialize.js
index d9a25b3..00387dc 100644
--- a/implementors/serde/de/trait.Deserialize.js
+++ b/implementors/serde/de/trait.Deserialize.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl<'de> Deserialize<'de> for HpkePublicKey"],["impl<'de> Deserialize<'de> for HpkePrivateKey"],["impl<'de> Deserialize<'de> for Mode"],["impl<'de> Deserialize<'de> for HpkeKeyPair"]]
+"hpke_rs":[["impl<'de> Deserialize<'de> for HpkeKeyPair"],["impl<'de> Deserialize<'de> for Mode"],["impl<'de> Deserialize<'de> for HpkePublicKey"],["impl<'de> Deserialize<'de> for HpkePrivateKey"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/serde/ser/trait.Serialize.js b/implementors/serde/ser/trait.Serialize.js
index 81bb575..19adfce 100644
--- a/implementors/serde/ser/trait.Serialize.js
+++ b/implementors/serde/ser/trait.Serialize.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl Serialize for Mode"],["impl Serialize for HpkePublicKey"],["impl Serialize for HpkePrivateKey"],["impl Serialize for HpkeKeyPair"]]
+"hpke_rs":[["impl Serialize for HpkeKeyPair"],["impl Serialize for HpkePrivateKey"],["impl Serialize for Mode"],["impl Serialize for HpkePublicKey"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/tls_codec/trait.Deserialize.js b/implementors/tls_codec/trait.Deserialize.js
index 7555aa8..606c95c 100644
--- a/implementors/tls_codec/trait.Deserialize.js
+++ b/implementors/tls_codec/trait.Deserialize.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl Deserialize for HpkePublicKey"],["impl Deserialize for &HpkePublicKey"]]
+"hpke_rs":[["impl Deserialize for &HpkePublicKey"],["impl Deserialize for HpkePublicKey"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/tls_codec/trait.Serialize.js b/implementors/tls_codec/trait.Serialize.js
index bcc076f..fa96398 100644
--- a/implementors/tls_codec/trait.Serialize.js
+++ b/implementors/tls_codec/trait.Serialize.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl Serialize for &HpkePublicKey"],["impl Serialize for HpkePublicKey"]]
+"hpke_rs":[["impl Serialize for HpkePublicKey"],["impl Serialize for &HpkePublicKey"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/search-index.js b/search-index.js
index 7292a68..e8bd321 100644
--- a/search-index.js
+++ b/search-index.js
@@ -1,5 +1,5 @@
var searchIndex = JSON.parse('{\
-"hpke_rs":{"doc":"HPKE","t":"NNNDNGGGDEDDDNNNNNNNNENNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLALLLLLLLLLLLLLALLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLQCIKFFFF","n":["Auth","AuthPsk","Base","Context","CryptoError","HPKEKeyPair","HPKEPrivateKey","HPKEPublicKey","Hpke","HpkeError","HpkeKeyPair","HpkePrivateKey","HpkePublicKey","InconsistentPsk","InsecurePsk","InsufficientRandomness","InvalidConfig","InvalidInput","LockPoisoned","MessageLimitReached","MissingPsk","Mode","OpenError","Psk","UnknownMode","UnnecessaryPsk","as_slice","as_slice","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","default","default","default","derive_key_pair","deserialize","deserialize","deserialize","deserialize","eq","eq","eq","eq","export","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from_keys","generate_key_pair","into","into","into","into","into","into","into","into_keys","key_schedule","new","new","new","new","open","open","prelude","private_key","public_key","receiver_export","seal","seal","seed","send_export","serialize","serialize","serialize","serialize","setup_receiver","setup_sender","test_util","tls_deserialize","tls_deserialize","tls_serialize","tls_serialize","tls_serialized_len","tls_serialized_len","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","zeroize","Error","HpkeMode","TryFrom","try_from","bytes_to_hex","hex_to_bytes","hex_to_bytes_option","vec_to_option_slice"],"q":[[0,"hpke_rs"],[161,"hpke_rs::prelude"],[165,"hpke_rs::test_util"],[169,"hpke_rs_crypto"],[170,"core::result"],[171,"serde::de"],[172,"alloc::vec"],[173,"core::fmt"],[174,"core::fmt"],[175,"hpke_rs_crypto::types"],[176,"hpke_rs_crypto::types"],[177,"serde::ser"],[178,"tls_codec"],[179,"std::io"],[180,"std::io"],[181,"core::any"]],"d":["Authenticated HPKE.","Authenticated HPKE with PSK.","HPKE Base mode.","The HPKE context. Note that the RFC currently doesn’t …","An error in the crypto library occurred.","","","","The HPKE configuration struct. This holds the …","HPKE Error types.","An HPKE key pair has an HPKE private and public key.","An HPKE private key is a byte vector.","An HPKE public key is a byte vector.","Inconsistent PSK input.","PSK input is too short (needs to be at least 32 bytes).","Unable to collect enough randomness.","Invalid configuration or arguments.","Invalid input.","A concurrency issue with an RwLock
.","The message limit for this AEAD, key, and nonce.","PSK input is required but missing.","HPKE supports four modes.","Error opening an HPKE ciphertext.","HPKE with PSK.","Unknown HPKE mode.","PSK input is provided but not needed.","Get the raw key as byte slice.","Get the raw key as byte slice.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","7.1.2. DeriveKeyPair Derive a key pair for the used KEM …","","","","","","","","","5.3. Secret Export","","","","","","","","","","","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","","","","Returns the argument unchanged.","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Build a key pair from two keys","Cryptographic Dependencies Randomized algorithm to …","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Split the key pair into the two keys","Creating the Encryption Context Generate the HPKE context …","Create a new HPKE public key. Consumes the public key …","Create a new HPKE private key. Consumes the private key …","Create a new HPKE key pair. Consumes the private and …","Set up the configuration for HPKE.","5.2. Encryption and Decryption","Single-Shot APIs 6.1. Encryption and DecryptionSingle shot …","Prelude for HPKE. Include this to get access to all the …","Get a reference to the HPKE private key of this key pair.","Get a reference to the HPKE public key of this key pair.","Single-Shot APIs 6.2. Secret ExportSingle shot API to …","5.2. Encryption and Decryption","Single-Shot APIs 6.1. Encryption and DecryptionSingle shot …","Set PRNG state for testing.","Single-Shot APIs 6.2. Secret ExportSingle shot API to …","","","","","Set up an HPKE receiver.","Set up an HPKE sender.","Test util module. Should be moved really.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","The type returned in the event of a conversion error.","","Simple and safe type conversions that may fail in a …","Performs the conversion.","Convert bytes
to a hex string.","Convert a hex string to a byte vector.","Convert a hex string to a byte vector. If the input is None
…","Convert a byte slice into byte slice option. Returns Nonce
…"],"i":[7,7,7,0,5,0,0,0,0,0,0,0,0,5,5,5,5,5,5,5,5,0,5,7,5,5,1,4,14,5,1,4,6,7,8,14,5,1,4,6,7,8,5,1,4,6,7,8,5,1,4,6,7,8,1,4,6,8,1,4,6,7,5,1,4,7,14,14,5,5,1,4,6,7,7,8,8,14,5,5,1,1,1,4,4,4,6,6,6,7,8,6,8,14,5,1,4,6,7,8,6,8,1,4,6,8,14,8,0,6,6,8,14,8,8,8,1,4,6,7,8,8,0,1,1,1,1,1,1,5,1,4,6,7,8,5,7,8,14,5,1,4,6,7,7,8,14,5,1,4,6,7,8,14,5,1,4,6,7,8,4,33,0,0,33,0,0,0,0],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[1,[[3,[2]]]],[4,[[3,[2]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[5,5],[1,1],[4,4],[6,6],[7,7],[[[8,[-1]]],[[8,[-1]]],9],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[],1],[[],4],[[],6],[[[8,[-1]],[3,[2]]],[[11,[6,5]]],9],[-1,[[11,[1]]],12],[-1,[[11,[4]]],12],[-1,[[11,[6]]],12],[-1,[[11,[7]]],12],[[5,5],13],[[1,1],13],[[4,4],13],[[7,7],13],[[[14,[-1]],[3,[2]],15],[[11,[[16,[2]],5]]],9],[[[14,[-1]],17],18,9],[[5,17],18],[[5,17],18],[[1,17],18],[[4,17],[[11,[10,19]]]],[[6,17],18],[[7,17],18],[[7,17],18],[[[8,[-1]],17],18,9],[[[8,[-1]],17],18,[20,9]],[-1,-1,[]],[21,5],[-1,-1,[]],[-1,-1,[]],[[[16,[2]]],1],[[[3,[2]]],1],[[[3,[2]]],4],[-1,-1,[]],[[[16,[2]]],4],[[[10,[[16,[2]],[16,[2]]]]],6],[[[10,[[3,[2]],[3,[2]]]]],6],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[[4,1],6],[[[8,[-1]]],[[11,[6,5]]],9],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[6,[[10,[4,1]]]],[[[8,[-1]],[3,[2]],[3,[2]],[3,[2]],[3,[2]]],[[11,[[14,[-1]],5]]],9],[[[16,[2]]],1],[[[16,[2]]],4],[[[16,[2]],[16,[2]]],6],[[7,22,23,24],[[8,[-1]]],9],[[[14,[-1]],[3,[2]],[3,[2]]],[[11,[[16,[2]],5]]],9],[[[8,[-1]],[3,[2]],4,[3,[2]],[3,[2]],[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[1]]],[[11,[[16,[2]],5]]],9],0,[6,4],[6,1],[[[8,[-1]],[3,[2]],4,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[1]],[3,[2]],15],[[11,[[16,[2]],5]]],9],[[[14,[-1]],[3,[2]],[3,[2]]],[[11,[[16,[2]],5]]],9],[[[8,[-1]],1,[3,[2]],[3,[2]],[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[4]]],[[11,[[10,[[16,[2]],[16,[2]]]],5]]],9],[[[8,[-1]],[3,[2]]],[[11,[10,5]]],9],[[[8,[-1]],1,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[4]],[3,[2]],15],[[11,[[10,[[16,[2]],[16,[2]]]],5]]],9],[[1,-1],11,26],[[4,-1],11,26],[[6,-1],11,26],[[7,-1],11,26],[[[8,[-1]],[3,[2]],4,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[1]]],[[11,[[14,[-1]],5]]],9],[[[8,[-1]],1,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[4]]],[[11,[[10,[[16,[2]],[14,[-1]]]],5]]],9],0,[-1,[[11,[1,27]]],28],[-1,[[11,[1,27]]],28],[[1,-1],[[11,[15,27]]],29],[[1,-1],[[11,[15,27]]],29],[1,15],[1,15],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,30,[]],[-1,30,[]],[-1,30,[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[2,[[11,[7,5]]]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[4,10],0,0,0,[-1,[[11,[-2]]],[],[]],[[[3,[2]]],30],[32,[[16,[2]]]],[[[25,[30]]],[[16,[2]]]],[[[3,[2]]],[[25,[[3,[2]]]]]]],"c":[5,6,7],"p":[[3,"HpkePublicKey",0],[15,"u8"],[15,"slice"],[3,"HpkePrivateKey",0],[4,"HpkeError",0],[3,"HpkeKeyPair",0],[4,"Mode",0],[3,"Hpke",0],[8,"HpkeCrypto",169],[15,"tuple"],[4,"Result",170],[8,"Deserializer",171],[15,"bool"],[3,"Context",0],[15,"usize"],[3,"Vec",172],[3,"Formatter",173],[6,"Result",173],[3,"Error",173],[8,"Debug",173],[4,"Error",174],[4,"KemAlgorithm",175],[4,"KdfAlgorithm",175],[4,"AeadAlgorithm",175],[4,"Option",176],[8,"Serializer",177],[4,"Error",178],[8,"Read",179],[8,"Write",179],[3,"String",180],[3,"TypeId",181],[15,"str"],[8,"TryFrom",161]]}\
+"hpke_rs":{"doc":"HPKE","t":"NNNDNGGGDEDDDNNNNNNNENNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLALLLLLLLLLLLLLALLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLQCIKFFFF","n":["Auth","AuthPsk","Base","Context","CryptoError","HPKEKeyPair","HPKEPrivateKey","HPKEPublicKey","Hpke","HpkeError","HpkeKeyPair","HpkePrivateKey","HpkePublicKey","InconsistentPsk","InsecurePsk","InsufficientRandomness","InvalidConfig","InvalidInput","MessageLimitReached","MissingPsk","Mode","OpenError","Psk","UnknownMode","UnnecessaryPsk","as_slice","as_slice","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","default","default","default","derive_key_pair","deserialize","deserialize","deserialize","deserialize","eq","eq","eq","eq","export","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from_keys","generate_key_pair","into","into","into","into","into","into","into","into_keys","key_schedule","new","new","new","new","open","open","prelude","private_key","public_key","receiver_export","seal","seal","seed","send_export","serialize","serialize","serialize","serialize","setup_receiver","setup_sender","test_util","tls_deserialize","tls_deserialize","tls_serialize","tls_serialize","tls_serialized_len","tls_serialized_len","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","zeroize","Error","HpkeMode","TryFrom","try_from","bytes_to_hex","hex_to_bytes","hex_to_bytes_option","vec_to_option_slice"],"q":[[0,"hpke_rs"],[160,"hpke_rs::prelude"],[164,"hpke_rs::test_util"],[168,"hpke_rs_crypto"],[169,"core::result"],[170,"serde::de"],[171,"alloc::vec"],[172,"core::fmt"],[173,"core::fmt"],[174,"hpke_rs_crypto::types"],[175,"hpke_rs_crypto::types"],[176,"serde::ser"],[177,"tls_codec"],[178,"std::io"],[179,"std::io"],[180,"core::any"]],"d":["Authenticated HPKE.","Authenticated HPKE with PSK.","HPKE Base mode.","The HPKE context. Note that the RFC currently doesn’t …","An error in the crypto library occurred.","","","","The HPKE configuration struct. This holds the …","HPKE Error types.","An HPKE key pair has an HPKE private and public key.","An HPKE private key is a byte vector.","An HPKE public key is a byte vector.","Inconsistent PSK input.","PSK input is too short (needs to be at least 32 bytes).","Unable to collect enough randomness.","Invalid configuration or arguments.","Invalid input.","The message limit for this AEAD, key, and nonce.","PSK input is required but missing.","HPKE supports four modes.","Error opening an HPKE ciphertext.","HPKE with PSK.","Unknown HPKE mode.","PSK input is provided but not needed.","Get the raw key as byte slice.","Get the raw key as byte slice.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","7.1.2. DeriveKeyPair Derive a key pair for the used KEM …","","","","","","","","","5.3. Secret Export","","","","","","","","","","","Returns the argument unchanged.","","Returns the argument unchanged.","","","Returns the argument unchanged.","","Returns the argument unchanged.","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Build a key pair from two keys","Cryptographic Dependencies Randomized algorithm to …","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Split the key pair into the two keys","Creating the Encryption Context Generate the HPKE context …","Create a new HPKE public key. Consumes the public key …","Create a new HPKE private key. Consumes the private key …","Create a new HPKE key pair. Consumes the private and …","Set up the configuration for HPKE.","5.2. Encryption and Decryption","Single-Shot APIs 6.1. Encryption and DecryptionSingle shot …","Prelude for HPKE. Include this to get access to all the …","Get a reference to the HPKE private key of this key pair.","Get a reference to the HPKE public key of this key pair.","Single-Shot APIs 6.2. Secret ExportSingle shot API to …","5.2. Encryption and Decryption","Single-Shot APIs 6.1. Encryption and DecryptionSingle shot …","Set PRNG state for testing.","Single-Shot APIs 6.2. Secret ExportSingle shot API to …","","","","","Set up an HPKE receiver.","Set up an HPKE sender.","Test util module. Should be moved really.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","The type returned in the event of a conversion error.","","Simple and safe type conversions that may fail in a …","Performs the conversion.","Convert bytes
to a hex string.","Convert a hex string to a byte vector.","Convert a hex string to a byte vector. If the input is None
…","Convert a byte slice into byte slice option. Returns Nonce
…"],"i":[7,7,7,0,5,0,0,0,0,0,0,0,0,5,5,5,5,5,5,5,0,5,7,5,5,1,4,14,5,1,4,6,7,8,14,5,1,4,6,7,8,5,1,4,6,7,8,5,1,4,6,7,8,1,4,6,8,1,4,6,7,5,1,4,7,14,14,5,5,1,4,6,7,7,8,8,14,5,5,1,1,1,4,4,4,6,6,6,7,8,6,8,14,5,1,4,6,7,8,6,8,1,4,6,8,14,8,0,6,6,8,14,8,8,8,1,4,6,7,8,8,0,1,1,1,1,1,1,5,1,4,6,7,8,5,7,8,14,5,1,4,6,7,7,8,14,5,1,4,6,7,8,14,5,1,4,6,7,8,4,33,0,0,33,0,0,0,0],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[1,[[3,[2]]]],[4,[[3,[2]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[5,5],[1,1],[4,4],[6,6],[7,7],[[[8,[-1]]],[[8,[-1]]],9],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[],1],[[],4],[[],6],[[[8,[-1]],[3,[2]]],[[11,[6,5]]],9],[-1,[[11,[1]]],12],[-1,[[11,[4]]],12],[-1,[[11,[6]]],12],[-1,[[11,[7]]],12],[[5,5],13],[[1,1],13],[[4,4],13],[[7,7],13],[[[14,[-1]],[3,[2]],15],[[11,[[16,[2]],5]]],9],[[[14,[-1]],17],18,9],[[5,17],18],[[5,17],18],[[1,17],18],[[4,17],[[11,[10,19]]]],[[6,17],18],[[7,17],18],[[7,17],18],[[[8,[-1]],17],18,9],[[[8,[-1]],17],18,[20,9]],[-1,-1,[]],[21,5],[-1,-1,[]],[[[16,[2]]],1],[[[3,[2]]],1],[-1,-1,[]],[[[3,[2]]],4],[-1,-1,[]],[[[16,[2]]],4],[[[10,[[3,[2]],[3,[2]]]]],6],[[[10,[[16,[2]],[16,[2]]]]],6],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[[4,1],6],[[[8,[-1]]],[[11,[6,5]]],9],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[6,[[10,[4,1]]]],[[[8,[-1]],[3,[2]],[3,[2]],[3,[2]],[3,[2]]],[[11,[[14,[-1]],5]]],9],[[[16,[2]]],1],[[[16,[2]]],4],[[[16,[2]],[16,[2]]],6],[[7,22,23,24],[[8,[-1]]],9],[[[14,[-1]],[3,[2]],[3,[2]]],[[11,[[16,[2]],5]]],9],[[[8,[-1]],[3,[2]],4,[3,[2]],[3,[2]],[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[1]]],[[11,[[16,[2]],5]]],9],0,[6,4],[6,1],[[[8,[-1]],[3,[2]],4,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[1]],[3,[2]],15],[[11,[[16,[2]],5]]],9],[[[14,[-1]],[3,[2]],[3,[2]]],[[11,[[16,[2]],5]]],9],[[[8,[-1]],1,[3,[2]],[3,[2]],[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[4]]],[[11,[[10,[[16,[2]],[16,[2]]]],5]]],9],[[[8,[-1]],[3,[2]]],[[11,[10,5]]],9],[[[8,[-1]],1,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[4]],[3,[2]],15],[[11,[[10,[[16,[2]],[16,[2]]]],5]]],9],[[1,-1],11,26],[[4,-1],11,26],[[6,-1],11,26],[[7,-1],11,26],[[[8,[-1]],[3,[2]],4,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[1]]],[[11,[[14,[-1]],5]]],9],[[[8,[-1]],1,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[4]]],[[11,[[10,[[16,[2]],[14,[-1]]]],5]]],9],0,[-1,[[11,[1,27]]],28],[-1,[[11,[1,27]]],28],[[1,-1],[[11,[15,27]]],29],[[1,-1],[[11,[15,27]]],29],[1,15],[1,15],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,30,[]],[-1,30,[]],[-1,30,[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[2,[[11,[7,5]]]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[4,10],0,0,0,[-1,[[11,[-2]]],[],[]],[[[3,[2]]],30],[32,[[16,[2]]]],[[[25,[30]]],[[16,[2]]]],[[[3,[2]]],[[25,[[3,[2]]]]]]],"c":[5,6,7],"p":[[3,"HpkePublicKey",0],[15,"u8"],[15,"slice"],[3,"HpkePrivateKey",0],[4,"HpkeError",0],[3,"HpkeKeyPair",0],[4,"Mode",0],[3,"Hpke",0],[8,"HpkeCrypto",168],[15,"tuple"],[4,"Result",169],[8,"Deserializer",170],[15,"bool"],[3,"Context",0],[15,"usize"],[3,"Vec",171],[3,"Formatter",172],[6,"Result",172],[3,"Error",172],[8,"Debug",172],[4,"Error",173],[4,"KemAlgorithm",174],[4,"KdfAlgorithm",174],[4,"AeadAlgorithm",174],[4,"Option",175],[8,"Serializer",176],[4,"Error",177],[8,"Read",178],[8,"Write",178],[3,"String",179],[3,"TypeId",180],[15,"str"],[8,"TryFrom",160]]}\
}');
if (typeof window !== 'undefined' && window.initSearch) {window.initSearch(searchIndex)};
if (typeof exports !== 'undefined') {exports.searchIndex = searchIndex};
diff --git a/src/hpke_rs/dh_kem.rs.html b/src/hpke_rs/dh_kem.rs.html
index 76d229d..e626cdb 100644
--- a/src/hpke_rs/dh_kem.rs.html
+++ b/src/hpke_rs/dh_kem.rs.html
@@ -175,9 +175,13 @@
175
176
177
+178
+179
//! DH KEM as described in §4.1. DH-Based KEM.
-use hpke_rs_crypto::{error::Error, types::KemAlgorithm, HpkeCrypto};
+use alloc::{string::ToString, vec::Vec};
+
+use hpke_rs_crypto::{error::Error, types::KemAlgorithm, HpkeCrypto};
use crate::util::*;
use crate::{
diff --git a/src/hpke_rs/kdf.rs.html b/src/hpke_rs/kdf.rs.html
index e71827a..63956d6 100644
--- a/src/hpke_rs/kdf.rs.html
+++ b/src/hpke_rs/kdf.rs.html
@@ -28,7 +28,11 @@
28
29
30
-
use hpke_rs_crypto::{error::Error, types::KdfAlgorithm, HpkeCrypto};
+31
+32
+
use alloc::vec::Vec;
+
+use hpke_rs_crypto::{error::Error, types::KdfAlgorithm, HpkeCrypto};
use crate::util::concat;
diff --git a/src/hpke_rs/kem.rs.html b/src/hpke_rs/kem.rs.html
index 3fbf089..e860613 100644
--- a/src/hpke_rs/kem.rs.html
+++ b/src/hpke_rs/kem.rs.html
@@ -97,7 +97,11 @@
97
98
99
-
use hpke_rs_crypto::{error::Error, types::KemAlgorithm, HpkeCrypto};
+100
+101
+
use alloc::vec::Vec;
+
+use hpke_rs_crypto::{error::Error, types::KemAlgorithm, HpkeCrypto};
use crate::dh_kem;
use crate::util;
diff --git a/src/hpke_rs/lib.rs.html b/src/hpke_rs/lib.rs.html
index e14bd4b..18ff4d7 100644
--- a/src/hpke_rs/lib.rs.html
+++ b/src/hpke_rs/lib.rs.html
@@ -994,6 +994,14 @@
994
995
996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
#![doc = include_str!("../Readme.md")]
#![forbid(unsafe_code, unused_must_use, unstable_features)]
#![deny(
@@ -1004,8 +1012,18 @@
unused_extern_crates,
unused_qualifications
)]
+#![cfg_attr(not(test), no_std)]
-use std::sync::RwLock;
+extern crate alloc;
+#[cfg(feature = "std")]
+extern crate std;
+
+use alloc::{
+ format,
+ string::{String, ToString},
+ vec,
+ vec::Vec,
+};
#[cfg(feature = "hpke-test-prng")]
use hpke_rs_crypto::HpkeTestRng;
@@ -1075,15 +1093,13 @@
/// Unable to collect enough randomness.
InsufficientRandomness,
-
- /// A concurrency issue with an [`RwLock`].
- LockPoisoned,
}
-impl std::error::Error for HpkeError {}
+#[cfg(feature = "std")]
+impl std::error::Error for HpkeError {}
-impl std::fmt::Display for HpkeError {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+impl core::fmt::Display for HpkeError {
+ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "HPKE Error: {:?}", self)
}
}
@@ -1155,8 +1171,8 @@
AuthPsk = 0x03,
}
-impl std::fmt::Display for Mode {
- fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+impl core::fmt::Display for Mode {
+ fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
write!(f, "{:?}", self)
}
}
@@ -1198,8 +1214,8 @@
}
#[cfg(feature = "hazmat")]
-impl<Crypto: HpkeCrypto> std::fmt::Debug for Context<Crypto> {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+impl<Crypto: HpkeCrypto> core::fmt::Debug for Context<Crypto> {
+ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(
f,
"Context {{\n key: {:?}\n nonce: {:?}\n exporter_secret: {:?}\n seq no: {:?}\n}}",
@@ -1209,8 +1225,8 @@
}
#[cfg(not(feature = "hazmat"))]
-impl<Crypto: HpkeCrypto> std::fmt::Debug for Context<Crypto> {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+impl<Crypto: HpkeCrypto> core::fmt::Debug for Context<Crypto> {
+ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(
f,
"Context {{\n key: {:?}\n nonce: {:?}\n exporter_secret: {:?}\n seq no: {:?}\n}}",
@@ -1327,7 +1343,7 @@
kem_id: KemAlgorithm,
kdf_id: KdfAlgorithm,
aead_id: AeadAlgorithm,
- prng: RwLock<Crypto::HpkePrng>,
+ prng: Crypto::HpkePrng,
}
impl<Crypto: 'static + HpkeCrypto> Clone for Hpke<Crypto> {
@@ -1337,13 +1353,13 @@
kem_id: self.kem_id,
kdf_id: self.kdf_id,
aead_id: self.aead_id,
- prng: RwLock::new(Crypto::prng()),
+ prng: Crypto::prng(),
}
}
}
-impl<Crypto: HpkeCrypto> std::fmt::Display for Hpke<Crypto> {
- fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+impl<Crypto: HpkeCrypto> core::fmt::Display for Hpke<Crypto> {
+ fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
write!(
f,
"{}_{}_{}_{}",
@@ -1368,7 +1384,7 @@
kem_id,
kdf_id,
aead_id,
- prng: RwLock::new(Crypto::prng()),
+ prng: Crypto::prng(),
}
}
@@ -1387,7 +1403,7 @@
/// The encapsulated secret is returned together with the context.
/// If the secret key is missing in an authenticated mode, an error is returned.
pub fn setup_sender(
- &self,
+ &mut self,
pk_r: &HpkePublicKey,
info: &[u8],
psk: Option<&[u8]>,
@@ -1474,7 +1490,7 @@
/// Returns the encapsulated secret and the ciphertext, or an error.
#[allow(clippy::too_many_arguments)]
pub fn seal(
- &self,
+ &mut self,
pk_r: &HpkePublicKey,
info: &[u8],
aad: &[u8],
@@ -1530,7 +1546,7 @@
/// exporter context and length.
#[allow(clippy::too_many_arguments)]
pub fn send_export(
- &self,
+ &mut self,
pk_r: &HpkePublicKey,
info: &[u8],
psk: Option<&[u8]>,
@@ -1670,9 +1686,8 @@
/// This is equivalent to `derive_key_pair(random_vector(sk.len()))`
///
/// Returns an `HpkeKeyPair`.
- pub fn generate_key_pair(&self) -> Result<HpkeKeyPair, HpkeError> {
- let mut prng = self.prng.write().map_err(|_| HpkeError::LockPoisoned)?;
- let (sk, pk) = kem::key_gen::<Crypto>(self.kem_id, &mut prng)?;
+ pub fn generate_key_pair(&mut self) -> Result<HpkeKeyPair, HpkeError> {
+ let (sk, pk) = kem::key_gen::<Crypto>(self.kem_id, &mut self.prng)?;
Ok(HpkeKeyPair::new(sk, pk))
}
@@ -1686,8 +1701,8 @@
}
#[inline]
- pub(crate) fn random(&self, len: usize) -> Result<Vec<u8>, HpkeError> {
- let mut prng = self.prng.write().map_err(|_| HpkeError::LockPoisoned)?;
+ pub(crate) fn random(&mut self, len: usize) -> Result<Vec<u8>, HpkeError> {
+ let prng = &mut self.prng;
let mut out = vec![0u8; len];
#[cfg(feature = "hpke-test-prng")]
@@ -1790,8 +1805,8 @@
}
#[cfg(not(feature = "hazmat"))]
-impl std::fmt::Debug for HpkePrivateKey {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
+impl core::fmt::Debug for HpkePrivateKey {
+ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> Result<(), core::fmt::Error> {
f.debug_struct("HpkePrivateKey")
.field("value", &"***")
.finish()
@@ -1799,8 +1814,8 @@
}
#[cfg(feature = "hazmat")]
-impl std::fmt::Debug for HpkePrivateKey {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
+impl core::fmt::Debug for HpkePrivateKey {
+ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> Result<(), core::fmt::Error> {
f.debug_struct("HpkePrivateKey")
.field("value", &self.value)
.finish()
@@ -1887,14 +1902,15 @@
/// Test util module. Should be moved really.
#[cfg(feature = "hpke-test")]
pub mod test_util {
+ use alloc::{format, string::String, vec, vec::Vec};
+
use crate::HpkeError;
use hpke_rs_crypto::{HpkeCrypto, HpkeTestRng};
impl<Crypto: HpkeCrypto> super::Hpke<Crypto> {
/// Set PRNG state for testing.
- pub fn seed(&self, seed: &[u8]) -> Result<(), HpkeError> {
- let mut prng = self.prng.write().map_err(|_| HpkeError::LockPoisoned)?;
- prng.seed(seed);
+ pub fn seed(&mut self, seed: &[u8]) -> Result<(), HpkeError> {
+ self.prng.seed(seed);
Ok(())
}
}
diff --git a/src/hpke_rs/prelude.rs.html b/src/hpke_rs/prelude.rs.html
index dd7776a..41db4f7 100644
--- a/src/hpke_rs/prelude.rs.html
+++ b/src/hpke_rs/prelude.rs.html
@@ -7,5 +7,5 @@
//! Include this to get access to all the public functions of HPKE.
pub use super::{Mode as HpkeMode, *};
-pub use std::convert::TryFrom;
+pub use core::convert::TryFrom;
\ No newline at end of file
diff --git a/src/hpke_rs/util.rs.html b/src/hpke_rs/util.rs.html
index 5e150a7..f3a73c0 100644
--- a/src/hpke_rs/util.rs.html
+++ b/src/hpke_rs/util.rs.html
@@ -19,7 +19,11 @@
19
20
21
-#[inline]
+22
+23
+
use alloc::vec::Vec;
+
+#[inline]
pub(crate) fn concat(values: &[&[u8]]) -> Vec<u8> {
values.join(&[][..])
}
impl<T> BorrowMut<T> for Twhere
diff --git a/hpke_rs/struct.HpkePrivateKey.html b/hpke_rs/struct.HpkePrivateKey.html
index c599330..bdd81a5 100644
--- a/hpke_rs/struct.HpkePrivateKey.html
+++ b/hpke_rs/struct.HpkePrivateKey.html
@@ -1,14 +1,14 @@
-HpkePrivateKey in hpke_rs - Rust Struct hpke_rs::HpkePrivateKey
source · pub struct HpkePrivateKey { /* private fields */ }
Expand description
An HPKE private key is a byte vector.
-Implementations§
source§impl HpkePrivateKey
sourcepub fn new(b: Vec<u8>) -> Self
Create a new HPKE private key.
+
HpkePrivateKey in hpke_rs - Rust Struct hpke_rs::HpkePrivateKey
source · pub struct HpkePrivateKey { /* private fields */ }
Expand description
An HPKE private key is a byte vector.
+Implementations§
Trait Implementations§
source§impl Clone for HpkePrivateKey
source§fn clone(&self) -> HpkePrivateKey
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkePrivateKey
source§impl Default for HpkePrivateKey
source§fn default() -> HpkePrivateKey
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkePrivateKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<&[u8]> for HpkePrivateKey
source§impl PartialEq<HpkePrivateKey> for HpkePrivateKey
Hopefully constant time comparison of the two values as long as they have the
+
Trait Implementations§
source§impl Clone for HpkePrivateKey
source§fn clone(&self) -> HpkePrivateKey
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkePrivateKey
source§impl Default for HpkePrivateKey
source§fn default() -> HpkePrivateKey
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkePrivateKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<&[u8]> for HpkePrivateKey
source§impl PartialEq<HpkePrivateKey> for HpkePrivateKey
Hopefully constant time comparison of the two values as long as they have the
same length.
-source§fn eq(&self, other: &Self) -> bool
This method tests for self
and other
values to be equal, and is used
+source§impl Serialize for HpkePrivateKey
source§impl Zeroize for HpkePrivateKey
source§impl Serialize for HpkePrivateKey
Auto Trait Implementations§
§impl RefUnwindSafe for HpkePrivateKey
§impl Send for HpkePrivateKey
§impl Sync for HpkePrivateKey
§impl Unpin for HpkePrivateKey
§impl UnwindSafe for HpkePrivateKey
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/hpke_rs/struct.HpkePublicKey.html b/hpke_rs/struct.HpkePublicKey.html
index fac3457..d162776 100644
--- a/hpke_rs/struct.HpkePublicKey.html
+++ b/hpke_rs/struct.HpkePublicKey.html
@@ -1,20 +1,20 @@
-HpkePublicKey in hpke_rs - Rust Struct hpke_rs::HpkePublicKey
source · pub struct HpkePublicKey { /* private fields */ }
Expand description
An HPKE public key is a byte vector.
-Implementations§
source§impl HpkePublicKey
sourcepub fn new(value: Vec<u8>) -> Self
Create a new HPKE public key.
+
HpkePublicKey in hpke_rs - Rust Struct hpke_rs::HpkePublicKey
source · pub struct HpkePublicKey { /* private fields */ }
Expand description
An HPKE public key is a byte vector.
+Implementations§
Trait Implementations§
source§impl Clone for HpkePublicKey
source§fn clone(&self) -> HpkePublicKey
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkePublicKey
source§impl Default for HpkePublicKey
source§fn default() -> HpkePublicKey
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkePublicKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Deserialize for &HpkePublicKey
source§fn tls_deserialize<R: Read>(_: &mut R) -> Result<Self, Error>
This function deserializes the bytes
from the provided a std::io::Read
-and returns the populated struct. Read moresource§impl Deserialize for HpkePublicKey
Trait Implementations§
source§impl Clone for HpkePublicKey
source§fn clone(&self) -> HpkePublicKey
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkePublicKey
source§impl Default for HpkePublicKey
source§fn default() -> HpkePublicKey
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkePublicKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Deserialize for &HpkePublicKey
source§fn tls_deserialize<R: Read>(_: &mut R) -> Result<Self, Error>
This function deserializes the bytes
from the provided a std::io::Read
and returns the populated struct. Read moresource§impl From<&[u8]> for HpkePublicKey
source§impl PartialEq<HpkePublicKey> for HpkePublicKey
source§impl Deserialize for HpkePublicKey
source§fn tls_deserialize<R: Read>(bytes: &mut R) -> Result<Self, Error>
This function deserializes the bytes
from the provided a std::io::Read
+and returns the populated struct. Read moresource§impl From<&[u8]> for HpkePublicKey
source§impl PartialEq<HpkePublicKey> for HpkePublicKey
source§fn eq(&self, other: &HpkePublicKey) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
.source§impl Serialize for &HpkePublicKey
source§impl Serialize for HpkePublicKey
source§impl Serialize for HpkePublicKey
source§impl Size for &HpkePublicKey
source§fn tls_serialized_len(&self) -> usize
source§impl Size for HpkePublicKey
source§fn tls_serialized_len(&self) -> usize
source§impl StructuralPartialEq for HpkePublicKey
Auto Trait Implementations§
§impl RefUnwindSafe for HpkePublicKey
§impl Send for HpkePublicKey
§impl Sync for HpkePublicKey
§impl Unpin for HpkePublicKey
§impl UnwindSafe for HpkePublicKey
Blanket Implementations§
source§impl Serialize for &HpkePublicKey
source§impl Serialize for HpkePublicKey
source§impl Serialize for HpkePublicKey
source§impl Size for &HpkePublicKey
source§fn tls_serialized_len(&self) -> usize
source§impl Size for HpkePublicKey
source§fn tls_serialized_len(&self) -> usize
source§impl StructuralPartialEq for HpkePublicKey
Auto Trait Implementations§
§impl RefUnwindSafe for HpkePublicKey
§impl Send for HpkePublicKey
§impl Sync for HpkePublicKey
§impl Unpin for HpkePublicKey
§impl UnwindSafe for HpkePublicKey
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moresource§impl<T> From<T> for T
source§fn from(t: T) -> T
Returns the argument unchanged.
diff --git a/hpke_rs/test_util/fn.bytes_to_hex.html b/hpke_rs/test_util/fn.bytes_to_hex.html
index c47028a..a04498e 100644
--- a/hpke_rs/test_util/fn.bytes_to_hex.html
+++ b/hpke_rs/test_util/fn.bytes_to_hex.html
@@ -1,2 +1,2 @@
-bytes_to_hex in hpke_rs::test_util - Rust Function hpke_rs::test_util::bytes_to_hex
source · pub fn bytes_to_hex(bytes: &[u8]) -> String
Expand description
Convert bytes
to a hex string.
+bytes_to_hex in hpke_rs::test_util - Rust
\ No newline at end of file
diff --git a/hpke_rs/test_util/fn.hex_to_bytes.html b/hpke_rs/test_util/fn.hex_to_bytes.html
index 84e2f6e..9cc1035 100644
--- a/hpke_rs/test_util/fn.hex_to_bytes.html
+++ b/hpke_rs/test_util/fn.hex_to_bytes.html
@@ -1,2 +1,2 @@
-hex_to_bytes in hpke_rs::test_util - Rust Function hpke_rs::test_util::hex_to_bytes
source · pub fn hex_to_bytes(hex: &str) -> Vec<u8>
Expand description
Convert a hex string to a byte vector.
+hex_to_bytes in hpke_rs::test_util - Rust
\ No newline at end of file
diff --git a/hpke_rs/test_util/fn.hex_to_bytes_option.html b/hpke_rs/test_util/fn.hex_to_bytes_option.html
index 7240995..d0bf887 100644
--- a/hpke_rs/test_util/fn.hex_to_bytes_option.html
+++ b/hpke_rs/test_util/fn.hex_to_bytes_option.html
@@ -1,3 +1,3 @@
-hex_to_bytes_option in hpke_rs::test_util - Rust Function hpke_rs::test_util::hex_to_bytes_option
source · pub fn hex_to_bytes_option(hex: Option<String>) -> Vec<u8>
Expand description
Convert a hex string to a byte vector.
+
hex_to_bytes_option in hpke_rs::test_util - Rust
\ No newline at end of file
diff --git a/hpke_rs/test_util/fn.vec_to_option_slice.html b/hpke_rs/test_util/fn.vec_to_option_slice.html
index bb11c70..5ddbf28 100644
--- a/hpke_rs/test_util/fn.vec_to_option_slice.html
+++ b/hpke_rs/test_util/fn.vec_to_option_slice.html
@@ -1,3 +1,3 @@
-vec_to_option_slice in hpke_rs::test_util - Rust Function hpke_rs::test_util::vec_to_option_slice
source · pub fn vec_to_option_slice(v: &[u8]) -> Option<&[u8]>
Expand description
Convert a byte slice into byte slice option.
+
vec_to_option_slice in hpke_rs::test_util - Rust
\ No newline at end of file
diff --git a/hpke_rs/test_util/index.html b/hpke_rs/test_util/index.html
index 301a0d6..c48a151 100644
--- a/hpke_rs/test_util/index.html
+++ b/hpke_rs/test_util/index.html
@@ -1,4 +1,4 @@
-hpke_rs::test_util - Rust Expand description
Test util module. Should be moved really.
+hpke_rs::test_util - Rust Expand description
Test util module. Should be moved really.
Functions
- Convert
bytes
to a hex string. - Convert a hex string to a byte vector.
- Convert a hex string to a byte vector.
If the input is
None
, this returns an empty vector. - Convert a byte slice into byte slice option.
Returns
Nonce
if the byte slice is empty and Some(v)
otherwise.
\ No newline at end of file
diff --git a/hpke_rs/type.HPKEKeyPair.html b/hpke_rs/type.HPKEKeyPair.html
index 9a9f9de..e10b94e 100644
--- a/hpke_rs/type.HPKEKeyPair.html
+++ b/hpke_rs/type.HPKEKeyPair.html
@@ -1,9 +1,9 @@
-HPKEKeyPair in hpke_rs - Rust Type Alias hpke_rs::HPKEKeyPair
source · pub type HPKEKeyPair = HpkeKeyPair;
👎Deprecated since 0.0.7: Please use HpkeKeyPair instead. This alias will be removed with the first stable 0.1 release.Aliased Type§
struct HPKEKeyPair { /* private fields */ }
Implementations§
source§impl HpkeKeyPair
sourcepub fn new(sk: Vec<u8>, pk: Vec<u8>) -> Self
Create a new HPKE key pair.
+
HPKEKeyPair in hpke_rs - Rust Type Alias hpke_rs::HPKEKeyPair
source · pub type HPKEKeyPair = HpkeKeyPair;
👎Deprecated since 0.0.7: Please use HpkeKeyPair instead. This alias will be removed with the first stable 0.1 release.Aliased Type§
struct HPKEKeyPair { /* private fields */ }
Implementations§
source§impl HpkeKeyPair
sourcepub fn new(sk: Vec<u8>, pk: Vec<u8>) -> Self
Create a new HPKE key pair.
Consumes the private and public key bytes.
-sourcepub fn private_key(&self) -> &HpkePrivateKey
Get a reference to the HPKE private key of this key pair.
-sourcepub fn public_key(&self) -> &HpkePublicKey
Get a reference to the HPKE public key of this key pair.
-sourcepub fn into_keys(self) -> (HpkePrivateKey, HpkePublicKey)
Split the key pair into the two keys
-sourcepub fn from_keys(private_key: HpkePrivateKey, public_key: HpkePublicKey) -> Self
Build a key pair from two keys
-Trait Implementations§
source§impl Clone for HpkeKeyPair
source§fn clone(&self) -> HpkeKeyPair
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkeKeyPair
source§impl Default for HpkeKeyPair
source§fn default() -> HpkeKeyPair
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkeKeyPair
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Serialize for HpkeKeyPair
sourcepub fn private_key(&self) -> &HpkePrivateKey
Get a reference to the HPKE private key of this key pair.
+sourcepub fn public_key(&self) -> &HpkePublicKey
Get a reference to the HPKE public key of this key pair.
+sourcepub fn into_keys(self) -> (HpkePrivateKey, HpkePublicKey)
Split the key pair into the two keys
+sourcepub fn from_keys(private_key: HpkePrivateKey, public_key: HpkePublicKey) -> Self
Build a key pair from two keys
+Trait Implementations§
source§impl Clone for HpkeKeyPair
source§fn clone(&self) -> HpkeKeyPair
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkeKeyPair
source§impl Default for HpkeKeyPair
source§fn default() -> HpkeKeyPair
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkeKeyPair
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
\ No newline at end of file
diff --git a/hpke_rs/type.HPKEPrivateKey.html b/hpke_rs/type.HPKEPrivateKey.html
index 44660f2..c21fe66 100644
--- a/hpke_rs/type.HPKEPrivateKey.html
+++ b/hpke_rs/type.HPKEPrivateKey.html
@@ -1,11 +1,11 @@
-HPKEPrivateKey in hpke_rs - Rust Type Alias hpke_rs::HPKEPrivateKey
source · pub type HPKEPrivateKey = HpkePrivateKey;
👎Deprecated since 0.0.7: Please use HpkePrivateKey instead. This alias will be removed with the first stable 0.1 release.Aliased Type§
struct HPKEPrivateKey { /* private fields */ }
Implementations§
source§impl HpkePrivateKey
sourcepub fn new(b: Vec<u8>) -> Self
Create a new HPKE private key.
+
HPKEPrivateKey in hpke_rs - Rust Type Alias hpke_rs::HPKEPrivateKey
source · pub type HPKEPrivateKey = HpkePrivateKey;
👎Deprecated since 0.0.7: Please use HpkePrivateKey instead. This alias will be removed with the first stable 0.1 release.Aliased Type§
struct HPKEPrivateKey { /* private fields */ }
Implementations§
Trait Implementations§
source§impl Clone for HpkePrivateKey
source§fn clone(&self) -> HpkePrivateKey
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkePrivateKey
source§impl Default for HpkePrivateKey
source§fn default() -> HpkePrivateKey
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkePrivateKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<&[u8]> for HpkePrivateKey
source§impl PartialEq<HpkePrivateKey> for HpkePrivateKey
Hopefully constant time comparison of the two values as long as they have the
+
Trait Implementations§
source§impl Clone for HpkePrivateKey
source§fn clone(&self) -> HpkePrivateKey
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkePrivateKey
source§impl Default for HpkePrivateKey
source§fn default() -> HpkePrivateKey
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkePrivateKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<&[u8]> for HpkePrivateKey
source§impl PartialEq<HpkePrivateKey> for HpkePrivateKey
Hopefully constant time comparison of the two values as long as they have the
same length.
-source§fn eq(&self, other: &Self) -> bool
This method tests for self
and other
values to be equal, and is used
+source§impl Serialize for HpkePrivateKey
source§impl Zeroize for HpkePrivateKey
source§impl Serialize for HpkePrivateKey
\ No newline at end of file
diff --git a/hpke_rs/type.HPKEPublicKey.html b/hpke_rs/type.HPKEPublicKey.html
index 44dc41a..81d662f 100644
--- a/hpke_rs/type.HPKEPublicKey.html
+++ b/hpke_rs/type.HPKEPublicKey.html
@@ -1,12 +1,12 @@
-HPKEPublicKey in hpke_rs - Rust Type Alias hpke_rs::HPKEPublicKey
source · pub type HPKEPublicKey = HpkePublicKey;
👎Deprecated since 0.0.7: Please use HpkePublicKey instead. This alias will be removed with the first stable 0.1 release.Aliased Type§
struct HPKEPublicKey { /* private fields */ }
Implementations§
source§impl HpkePublicKey
sourcepub fn new(value: Vec<u8>) -> Self
Create a new HPKE public key.
+
HPKEPublicKey in hpke_rs - Rust Type Alias hpke_rs::HPKEPublicKey
source · pub type HPKEPublicKey = HpkePublicKey;
👎Deprecated since 0.0.7: Please use HpkePublicKey instead. This alias will be removed with the first stable 0.1 release.Aliased Type§
struct HPKEPublicKey { /* private fields */ }
Implementations§
Trait Implementations§
source§impl Clone for HpkePublicKey
source§fn clone(&self) -> HpkePublicKey
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkePublicKey
source§impl Default for HpkePublicKey
source§fn default() -> HpkePublicKey
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkePublicKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Deserialize for HpkePublicKey
Trait Implementations§
source§impl Clone for HpkePublicKey
source§fn clone(&self) -> HpkePublicKey
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkePublicKey
source§impl Default for HpkePublicKey
source§fn default() -> HpkePublicKey
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkePublicKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Deserialize for HpkePublicKey
source§fn tls_deserialize<R: Read>(bytes: &mut R) -> Result<Self, Error>
This function deserializes the bytes
from the provided a std::io::Read
and returns the populated struct. Read moresource§impl From<&[u8]> for HpkePublicKey
source§impl PartialEq<HpkePublicKey> for HpkePublicKey
source§impl From<&[u8]> for HpkePublicKey
source§impl PartialEq<HpkePublicKey> for HpkePublicKey
source§fn eq(&self, other: &HpkePublicKey) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
.source§impl Serialize for HpkePublicKey
source§impl Serialize for HpkePublicKey
source§impl Size for HpkePublicKey
source§fn tls_serialized_len(&self) -> usize
source§impl StructuralPartialEq for HpkePublicKey
\ No newline at end of file
+sufficient, and should not be overridden without very good reason.source§impl Serialize for HpkePublicKey
source§impl Serialize for HpkePublicKey
source§impl Size for HpkePublicKey
source§fn tls_serialized_len(&self) -> usize
source§impl StructuralPartialEq for HpkePublicKey
\ No newline at end of file
diff --git a/implementors/core/clone/trait.Clone.js b/implementors/core/clone/trait.Clone.js
index 29c3d7e..c7012c5 100644
--- a/implementors/core/clone/trait.Clone.js
+++ b/implementors/core/clone/trait.Clone.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl Clone for HpkePrivateKey"],["impl<Crypto: 'static + HpkeCrypto> Clone for Hpke<Crypto>"],["impl Clone for HpkeKeyPair"],["impl Clone for HpkeError"],["impl Clone for Mode"],["impl Clone for HpkePublicKey"]]
+"hpke_rs":[["impl Clone for HpkePublicKey"],["impl Clone for Mode"],["impl Clone for HpkePrivateKey"],["impl<Crypto: 'static + HpkeCrypto> Clone for Hpke<Crypto>"],["impl Clone for HpkeError"],["impl Clone for HpkeKeyPair"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/cmp/trait.PartialEq.js b/implementors/core/cmp/trait.PartialEq.js
index 5f936b7..57abae6 100644
--- a/implementors/core/cmp/trait.PartialEq.js
+++ b/implementors/core/cmp/trait.PartialEq.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl PartialEq<HpkePrivateKey> for HpkePrivateKey"],["impl PartialEq<HpkePublicKey> for HpkePublicKey"],["impl PartialEq<HpkeError> for HpkeError"],["impl PartialEq<Mode> for Mode"]]
+"hpke_rs":[["impl PartialEq<HpkeError> for HpkeError"],["impl PartialEq<HpkePublicKey> for HpkePublicKey"],["impl PartialEq<HpkePrivateKey> for HpkePrivateKey"],["impl PartialEq<Mode> for Mode"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/convert/trait.From.js b/implementors/core/convert/trait.From.js
index 135811f..f37b9ac 100644
--- a/implementors/core/convert/trait.From.js
+++ b/implementors/core/convert/trait.From.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl From<Error> for HpkeError"],["impl From<Vec<u8, Global>> for HpkePublicKey"],["impl From<(Vec<u8, Global>, Vec<u8, Global>)> for HpkeKeyPair"],["impl From<Vec<u8, Global>> for HpkePrivateKey"],["impl From<&[u8]> for HpkePublicKey"],["impl From<(&[u8], &[u8])> for HpkeKeyPair"],["impl From<&[u8]> for HpkePrivateKey"]]
+"hpke_rs":[["impl From<Vec<u8, Global>> for HpkePublicKey"],["impl From<&[u8]> for HpkePrivateKey"],["impl From<(Vec<u8, Global>, Vec<u8, Global>)> for HpkeKeyPair"],["impl From<&[u8]> for HpkePublicKey"],["impl From<Vec<u8, Global>> for HpkePrivateKey"],["impl From<Error> for HpkeError"],["impl From<(&[u8], &[u8])> for HpkeKeyPair"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/default/trait.Default.js b/implementors/core/default/trait.Default.js
index b470006..af577a2 100644
--- a/implementors/core/default/trait.Default.js
+++ b/implementors/core/default/trait.Default.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl Default for HpkeKeyPair"],["impl Default for HpkePublicKey"],["impl Default for HpkePrivateKey"]]
+"hpke_rs":[["impl Default for HpkeKeyPair"],["impl Default for HpkePrivateKey"],["impl Default for HpkePublicKey"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/fmt/trait.Debug.js b/implementors/core/fmt/trait.Debug.js
index 825f35c..005952f 100644
--- a/implementors/core/fmt/trait.Debug.js
+++ b/implementors/core/fmt/trait.Debug.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl<Crypto: Debug + 'static + HpkeCrypto> Debug for Hpke<Crypto>where\n Crypto::HpkePrng: Debug,"],["impl Debug for HpkeError"],["impl<Crypto: HpkeCrypto> Debug for Context<Crypto>"],["impl Debug for HpkePrivateKey"],["impl Debug for Mode"],["impl Debug for HpkeKeyPair"],["impl Debug for HpkePublicKey"]]
+"hpke_rs":[["impl Debug for HpkePublicKey"],["impl Debug for HpkePrivateKey"],["impl Debug for HpkeKeyPair"],["impl Debug for HpkeError"],["impl<Crypto: Debug + 'static + HpkeCrypto> Debug for Hpke<Crypto>where\n Crypto::HpkePrng: Debug,"],["impl Debug for Mode"],["impl<Crypto: HpkeCrypto> Debug for Context<Crypto>"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/marker/trait.Freeze.js b/implementors/core/marker/trait.Freeze.js
index 0625333..6df983d 100644
--- a/implementors/core/marker/trait.Freeze.js
+++ b/implementors/core/marker/trait.Freeze.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl Freeze for HpkeError",1,["hpke_rs::HpkeError"]],["impl Freeze for HpkePublicKey",1,["hpke_rs::HpkePublicKey"]],["impl Freeze for HpkePrivateKey",1,["hpke_rs::HpkePrivateKey"]],["impl Freeze for HpkeKeyPair",1,["hpke_rs::HpkeKeyPair"]],["impl Freeze for Mode",1,["hpke_rs::Mode"]],["impl<Crypto> !Freeze for Context<Crypto>",1,["hpke_rs::Context"]],["impl<Crypto> !Freeze for Hpke<Crypto>",1,["hpke_rs::Hpke"]]]
+"hpke_rs":[["impl Freeze for HpkeError",1,["hpke_rs::HpkeError"]],["impl Freeze for HpkePublicKey",1,["hpke_rs::HpkePublicKey"]],["impl Freeze for HpkePrivateKey",1,["hpke_rs::HpkePrivateKey"]],["impl Freeze for HpkeKeyPair",1,["hpke_rs::HpkeKeyPair"]],["impl Freeze for Mode",1,["hpke_rs::Mode"]],["impl<Crypto> Freeze for Context<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: Freeze,",1,["hpke_rs::Context"]],["impl<Crypto> Freeze for Hpke<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: Freeze,",1,["hpke_rs::Hpke"]]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/marker/trait.StructuralPartialEq.js b/implementors/core/marker/trait.StructuralPartialEq.js
index 9ad52ad..5e93391 100644
--- a/implementors/core/marker/trait.StructuralPartialEq.js
+++ b/implementors/core/marker/trait.StructuralPartialEq.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl StructuralPartialEq for HpkeError"],["impl StructuralPartialEq for HpkePublicKey"],["impl StructuralPartialEq for Mode"]]
+"hpke_rs":[["impl StructuralPartialEq for HpkePublicKey"],["impl StructuralPartialEq for Mode"],["impl StructuralPartialEq for HpkeError"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/marker/trait.Sync.js b/implementors/core/marker/trait.Sync.js
index 6ff5d31..499ecde 100644
--- a/implementors/core/marker/trait.Sync.js
+++ b/implementors/core/marker/trait.Sync.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl Sync for HpkeError",1,["hpke_rs::HpkeError"]],["impl Sync for HpkePublicKey",1,["hpke_rs::HpkePublicKey"]],["impl Sync for HpkePrivateKey",1,["hpke_rs::HpkePrivateKey"]],["impl Sync for HpkeKeyPair",1,["hpke_rs::HpkeKeyPair"]],["impl Sync for Mode",1,["hpke_rs::Mode"]],["impl<Crypto> Sync for Context<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: Send + Sync,",1,["hpke_rs::Context"]],["impl<Crypto> Sync for Hpke<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: Send + Sync,",1,["hpke_rs::Hpke"]]]
+"hpke_rs":[["impl Sync for HpkeError",1,["hpke_rs::HpkeError"]],["impl Sync for HpkePublicKey",1,["hpke_rs::HpkePublicKey"]],["impl Sync for HpkePrivateKey",1,["hpke_rs::HpkePrivateKey"]],["impl Sync for HpkeKeyPair",1,["hpke_rs::HpkeKeyPair"]],["impl Sync for Mode",1,["hpke_rs::Mode"]],["impl<Crypto> Sync for Context<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: Sync,",1,["hpke_rs::Context"]],["impl<Crypto> Sync for Hpke<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: Sync,",1,["hpke_rs::Hpke"]]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js b/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js
index 9d20887..5bd8bb3 100644
--- a/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js
+++ b/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl RefUnwindSafe for HpkeError",1,["hpke_rs::HpkeError"]],["impl RefUnwindSafe for HpkePublicKey",1,["hpke_rs::HpkePublicKey"]],["impl RefUnwindSafe for HpkePrivateKey",1,["hpke_rs::HpkePrivateKey"]],["impl RefUnwindSafe for HpkeKeyPair",1,["hpke_rs::HpkeKeyPair"]],["impl RefUnwindSafe for Mode",1,["hpke_rs::Mode"]],["impl<Crypto> RefUnwindSafe for Context<Crypto>",1,["hpke_rs::Context"]],["impl<Crypto> RefUnwindSafe for Hpke<Crypto>",1,["hpke_rs::Hpke"]]]
+"hpke_rs":[["impl RefUnwindSafe for HpkeError",1,["hpke_rs::HpkeError"]],["impl RefUnwindSafe for HpkePublicKey",1,["hpke_rs::HpkePublicKey"]],["impl RefUnwindSafe for HpkePrivateKey",1,["hpke_rs::HpkePrivateKey"]],["impl RefUnwindSafe for HpkeKeyPair",1,["hpke_rs::HpkeKeyPair"]],["impl RefUnwindSafe for Mode",1,["hpke_rs::Mode"]],["impl<Crypto> RefUnwindSafe for Context<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: RefUnwindSafe,",1,["hpke_rs::Context"]],["impl<Crypto> RefUnwindSafe for Hpke<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: RefUnwindSafe,",1,["hpke_rs::Hpke"]]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/panic/unwind_safe/trait.UnwindSafe.js b/implementors/core/panic/unwind_safe/trait.UnwindSafe.js
index 79979b4..633c214 100644
--- a/implementors/core/panic/unwind_safe/trait.UnwindSafe.js
+++ b/implementors/core/panic/unwind_safe/trait.UnwindSafe.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl UnwindSafe for HpkeError",1,["hpke_rs::HpkeError"]],["impl UnwindSafe for HpkePublicKey",1,["hpke_rs::HpkePublicKey"]],["impl UnwindSafe for HpkePrivateKey",1,["hpke_rs::HpkePrivateKey"]],["impl UnwindSafe for HpkeKeyPair",1,["hpke_rs::HpkeKeyPair"]],["impl UnwindSafe for Mode",1,["hpke_rs::Mode"]],["impl<Crypto> UnwindSafe for Context<Crypto>",1,["hpke_rs::Context"]],["impl<Crypto> UnwindSafe for Hpke<Crypto>",1,["hpke_rs::Hpke"]]]
+"hpke_rs":[["impl UnwindSafe for HpkeError",1,["hpke_rs::HpkeError"]],["impl UnwindSafe for HpkePublicKey",1,["hpke_rs::HpkePublicKey"]],["impl UnwindSafe for HpkePrivateKey",1,["hpke_rs::HpkePrivateKey"]],["impl UnwindSafe for HpkeKeyPair",1,["hpke_rs::HpkeKeyPair"]],["impl UnwindSafe for Mode",1,["hpke_rs::Mode"]],["impl<Crypto> UnwindSafe for Context<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: UnwindSafe,",1,["hpke_rs::Context"]],["impl<Crypto> UnwindSafe for Hpke<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: UnwindSafe,",1,["hpke_rs::Hpke"]]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/serde/de/trait.Deserialize.js b/implementors/serde/de/trait.Deserialize.js
index d9a25b3..00387dc 100644
--- a/implementors/serde/de/trait.Deserialize.js
+++ b/implementors/serde/de/trait.Deserialize.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl<'de> Deserialize<'de> for HpkePublicKey"],["impl<'de> Deserialize<'de> for HpkePrivateKey"],["impl<'de> Deserialize<'de> for Mode"],["impl<'de> Deserialize<'de> for HpkeKeyPair"]]
+"hpke_rs":[["impl<'de> Deserialize<'de> for HpkeKeyPair"],["impl<'de> Deserialize<'de> for Mode"],["impl<'de> Deserialize<'de> for HpkePublicKey"],["impl<'de> Deserialize<'de> for HpkePrivateKey"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/serde/ser/trait.Serialize.js b/implementors/serde/ser/trait.Serialize.js
index 81bb575..19adfce 100644
--- a/implementors/serde/ser/trait.Serialize.js
+++ b/implementors/serde/ser/trait.Serialize.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl Serialize for Mode"],["impl Serialize for HpkePublicKey"],["impl Serialize for HpkePrivateKey"],["impl Serialize for HpkeKeyPair"]]
+"hpke_rs":[["impl Serialize for HpkeKeyPair"],["impl Serialize for HpkePrivateKey"],["impl Serialize for Mode"],["impl Serialize for HpkePublicKey"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/tls_codec/trait.Deserialize.js b/implementors/tls_codec/trait.Deserialize.js
index 7555aa8..606c95c 100644
--- a/implementors/tls_codec/trait.Deserialize.js
+++ b/implementors/tls_codec/trait.Deserialize.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl Deserialize for HpkePublicKey"],["impl Deserialize for &HpkePublicKey"]]
+"hpke_rs":[["impl Deserialize for &HpkePublicKey"],["impl Deserialize for HpkePublicKey"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/tls_codec/trait.Serialize.js b/implementors/tls_codec/trait.Serialize.js
index bcc076f..fa96398 100644
--- a/implementors/tls_codec/trait.Serialize.js
+++ b/implementors/tls_codec/trait.Serialize.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl Serialize for &HpkePublicKey"],["impl Serialize for HpkePublicKey"]]
+"hpke_rs":[["impl Serialize for HpkePublicKey"],["impl Serialize for &HpkePublicKey"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/search-index.js b/search-index.js
index 7292a68..e8bd321 100644
--- a/search-index.js
+++ b/search-index.js
@@ -1,5 +1,5 @@
var searchIndex = JSON.parse('{\
-"hpke_rs":{"doc":"HPKE","t":"NNNDNGGGDEDDDNNNNNNNNENNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLALLLLLLLLLLLLLALLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLQCIKFFFF","n":["Auth","AuthPsk","Base","Context","CryptoError","HPKEKeyPair","HPKEPrivateKey","HPKEPublicKey","Hpke","HpkeError","HpkeKeyPair","HpkePrivateKey","HpkePublicKey","InconsistentPsk","InsecurePsk","InsufficientRandomness","InvalidConfig","InvalidInput","LockPoisoned","MessageLimitReached","MissingPsk","Mode","OpenError","Psk","UnknownMode","UnnecessaryPsk","as_slice","as_slice","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","default","default","default","derive_key_pair","deserialize","deserialize","deserialize","deserialize","eq","eq","eq","eq","export","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from_keys","generate_key_pair","into","into","into","into","into","into","into","into_keys","key_schedule","new","new","new","new","open","open","prelude","private_key","public_key","receiver_export","seal","seal","seed","send_export","serialize","serialize","serialize","serialize","setup_receiver","setup_sender","test_util","tls_deserialize","tls_deserialize","tls_serialize","tls_serialize","tls_serialized_len","tls_serialized_len","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","zeroize","Error","HpkeMode","TryFrom","try_from","bytes_to_hex","hex_to_bytes","hex_to_bytes_option","vec_to_option_slice"],"q":[[0,"hpke_rs"],[161,"hpke_rs::prelude"],[165,"hpke_rs::test_util"],[169,"hpke_rs_crypto"],[170,"core::result"],[171,"serde::de"],[172,"alloc::vec"],[173,"core::fmt"],[174,"core::fmt"],[175,"hpke_rs_crypto::types"],[176,"hpke_rs_crypto::types"],[177,"serde::ser"],[178,"tls_codec"],[179,"std::io"],[180,"std::io"],[181,"core::any"]],"d":["Authenticated HPKE.","Authenticated HPKE with PSK.","HPKE Base mode.","The HPKE context. Note that the RFC currently doesn’t …","An error in the crypto library occurred.","","","","The HPKE configuration struct. This holds the …","HPKE Error types.","An HPKE key pair has an HPKE private and public key.","An HPKE private key is a byte vector.","An HPKE public key is a byte vector.","Inconsistent PSK input.","PSK input is too short (needs to be at least 32 bytes).","Unable to collect enough randomness.","Invalid configuration or arguments.","Invalid input.","A concurrency issue with an RwLock
.","The message limit for this AEAD, key, and nonce.","PSK input is required but missing.","HPKE supports four modes.","Error opening an HPKE ciphertext.","HPKE with PSK.","Unknown HPKE mode.","PSK input is provided but not needed.","Get the raw key as byte slice.","Get the raw key as byte slice.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","7.1.2. DeriveKeyPair Derive a key pair for the used KEM …","","","","","","","","","5.3. Secret Export","","","","","","","","","","","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","","","","Returns the argument unchanged.","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Build a key pair from two keys","Cryptographic Dependencies Randomized algorithm to …","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Split the key pair into the two keys","Creating the Encryption Context Generate the HPKE context …","Create a new HPKE public key. Consumes the public key …","Create a new HPKE private key. Consumes the private key …","Create a new HPKE key pair. Consumes the private and …","Set up the configuration for HPKE.","5.2. Encryption and Decryption","Single-Shot APIs 6.1. Encryption and DecryptionSingle shot …","Prelude for HPKE. Include this to get access to all the …","Get a reference to the HPKE private key of this key pair.","Get a reference to the HPKE public key of this key pair.","Single-Shot APIs 6.2. Secret ExportSingle shot API to …","5.2. Encryption and Decryption","Single-Shot APIs 6.1. Encryption and DecryptionSingle shot …","Set PRNG state for testing.","Single-Shot APIs 6.2. Secret ExportSingle shot API to …","","","","","Set up an HPKE receiver.","Set up an HPKE sender.","Test util module. Should be moved really.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","The type returned in the event of a conversion error.","","Simple and safe type conversions that may fail in a …","Performs the conversion.","Convert bytes
to a hex string.","Convert a hex string to a byte vector.","Convert a hex string to a byte vector. If the input is None
…","Convert a byte slice into byte slice option. Returns Nonce
…"],"i":[7,7,7,0,5,0,0,0,0,0,0,0,0,5,5,5,5,5,5,5,5,0,5,7,5,5,1,4,14,5,1,4,6,7,8,14,5,1,4,6,7,8,5,1,4,6,7,8,5,1,4,6,7,8,1,4,6,8,1,4,6,7,5,1,4,7,14,14,5,5,1,4,6,7,7,8,8,14,5,5,1,1,1,4,4,4,6,6,6,7,8,6,8,14,5,1,4,6,7,8,6,8,1,4,6,8,14,8,0,6,6,8,14,8,8,8,1,4,6,7,8,8,0,1,1,1,1,1,1,5,1,4,6,7,8,5,7,8,14,5,1,4,6,7,7,8,14,5,1,4,6,7,8,14,5,1,4,6,7,8,4,33,0,0,33,0,0,0,0],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[1,[[3,[2]]]],[4,[[3,[2]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[5,5],[1,1],[4,4],[6,6],[7,7],[[[8,[-1]]],[[8,[-1]]],9],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[],1],[[],4],[[],6],[[[8,[-1]],[3,[2]]],[[11,[6,5]]],9],[-1,[[11,[1]]],12],[-1,[[11,[4]]],12],[-1,[[11,[6]]],12],[-1,[[11,[7]]],12],[[5,5],13],[[1,1],13],[[4,4],13],[[7,7],13],[[[14,[-1]],[3,[2]],15],[[11,[[16,[2]],5]]],9],[[[14,[-1]],17],18,9],[[5,17],18],[[5,17],18],[[1,17],18],[[4,17],[[11,[10,19]]]],[[6,17],18],[[7,17],18],[[7,17],18],[[[8,[-1]],17],18,9],[[[8,[-1]],17],18,[20,9]],[-1,-1,[]],[21,5],[-1,-1,[]],[-1,-1,[]],[[[16,[2]]],1],[[[3,[2]]],1],[[[3,[2]]],4],[-1,-1,[]],[[[16,[2]]],4],[[[10,[[16,[2]],[16,[2]]]]],6],[[[10,[[3,[2]],[3,[2]]]]],6],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[[4,1],6],[[[8,[-1]]],[[11,[6,5]]],9],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[6,[[10,[4,1]]]],[[[8,[-1]],[3,[2]],[3,[2]],[3,[2]],[3,[2]]],[[11,[[14,[-1]],5]]],9],[[[16,[2]]],1],[[[16,[2]]],4],[[[16,[2]],[16,[2]]],6],[[7,22,23,24],[[8,[-1]]],9],[[[14,[-1]],[3,[2]],[3,[2]]],[[11,[[16,[2]],5]]],9],[[[8,[-1]],[3,[2]],4,[3,[2]],[3,[2]],[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[1]]],[[11,[[16,[2]],5]]],9],0,[6,4],[6,1],[[[8,[-1]],[3,[2]],4,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[1]],[3,[2]],15],[[11,[[16,[2]],5]]],9],[[[14,[-1]],[3,[2]],[3,[2]]],[[11,[[16,[2]],5]]],9],[[[8,[-1]],1,[3,[2]],[3,[2]],[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[4]]],[[11,[[10,[[16,[2]],[16,[2]]]],5]]],9],[[[8,[-1]],[3,[2]]],[[11,[10,5]]],9],[[[8,[-1]],1,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[4]],[3,[2]],15],[[11,[[10,[[16,[2]],[16,[2]]]],5]]],9],[[1,-1],11,26],[[4,-1],11,26],[[6,-1],11,26],[[7,-1],11,26],[[[8,[-1]],[3,[2]],4,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[1]]],[[11,[[14,[-1]],5]]],9],[[[8,[-1]],1,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[4]]],[[11,[[10,[[16,[2]],[14,[-1]]]],5]]],9],0,[-1,[[11,[1,27]]],28],[-1,[[11,[1,27]]],28],[[1,-1],[[11,[15,27]]],29],[[1,-1],[[11,[15,27]]],29],[1,15],[1,15],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,30,[]],[-1,30,[]],[-1,30,[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[2,[[11,[7,5]]]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[4,10],0,0,0,[-1,[[11,[-2]]],[],[]],[[[3,[2]]],30],[32,[[16,[2]]]],[[[25,[30]]],[[16,[2]]]],[[[3,[2]]],[[25,[[3,[2]]]]]]],"c":[5,6,7],"p":[[3,"HpkePublicKey",0],[15,"u8"],[15,"slice"],[3,"HpkePrivateKey",0],[4,"HpkeError",0],[3,"HpkeKeyPair",0],[4,"Mode",0],[3,"Hpke",0],[8,"HpkeCrypto",169],[15,"tuple"],[4,"Result",170],[8,"Deserializer",171],[15,"bool"],[3,"Context",0],[15,"usize"],[3,"Vec",172],[3,"Formatter",173],[6,"Result",173],[3,"Error",173],[8,"Debug",173],[4,"Error",174],[4,"KemAlgorithm",175],[4,"KdfAlgorithm",175],[4,"AeadAlgorithm",175],[4,"Option",176],[8,"Serializer",177],[4,"Error",178],[8,"Read",179],[8,"Write",179],[3,"String",180],[3,"TypeId",181],[15,"str"],[8,"TryFrom",161]]}\
+"hpke_rs":{"doc":"HPKE","t":"NNNDNGGGDEDDDNNNNNNNENNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLALLLLLLLLLLLLLALLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLQCIKFFFF","n":["Auth","AuthPsk","Base","Context","CryptoError","HPKEKeyPair","HPKEPrivateKey","HPKEPublicKey","Hpke","HpkeError","HpkeKeyPair","HpkePrivateKey","HpkePublicKey","InconsistentPsk","InsecurePsk","InsufficientRandomness","InvalidConfig","InvalidInput","MessageLimitReached","MissingPsk","Mode","OpenError","Psk","UnknownMode","UnnecessaryPsk","as_slice","as_slice","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","default","default","default","derive_key_pair","deserialize","deserialize","deserialize","deserialize","eq","eq","eq","eq","export","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from_keys","generate_key_pair","into","into","into","into","into","into","into","into_keys","key_schedule","new","new","new","new","open","open","prelude","private_key","public_key","receiver_export","seal","seal","seed","send_export","serialize","serialize","serialize","serialize","setup_receiver","setup_sender","test_util","tls_deserialize","tls_deserialize","tls_serialize","tls_serialize","tls_serialized_len","tls_serialized_len","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","zeroize","Error","HpkeMode","TryFrom","try_from","bytes_to_hex","hex_to_bytes","hex_to_bytes_option","vec_to_option_slice"],"q":[[0,"hpke_rs"],[160,"hpke_rs::prelude"],[164,"hpke_rs::test_util"],[168,"hpke_rs_crypto"],[169,"core::result"],[170,"serde::de"],[171,"alloc::vec"],[172,"core::fmt"],[173,"core::fmt"],[174,"hpke_rs_crypto::types"],[175,"hpke_rs_crypto::types"],[176,"serde::ser"],[177,"tls_codec"],[178,"std::io"],[179,"std::io"],[180,"core::any"]],"d":["Authenticated HPKE.","Authenticated HPKE with PSK.","HPKE Base mode.","The HPKE context. Note that the RFC currently doesn’t …","An error in the crypto library occurred.","","","","The HPKE configuration struct. This holds the …","HPKE Error types.","An HPKE key pair has an HPKE private and public key.","An HPKE private key is a byte vector.","An HPKE public key is a byte vector.","Inconsistent PSK input.","PSK input is too short (needs to be at least 32 bytes).","Unable to collect enough randomness.","Invalid configuration or arguments.","Invalid input.","The message limit for this AEAD, key, and nonce.","PSK input is required but missing.","HPKE supports four modes.","Error opening an HPKE ciphertext.","HPKE with PSK.","Unknown HPKE mode.","PSK input is provided but not needed.","Get the raw key as byte slice.","Get the raw key as byte slice.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","7.1.2. DeriveKeyPair Derive a key pair for the used KEM …","","","","","","","","","5.3. Secret Export","","","","","","","","","","","Returns the argument unchanged.","","Returns the argument unchanged.","","","Returns the argument unchanged.","","Returns the argument unchanged.","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Build a key pair from two keys","Cryptographic Dependencies Randomized algorithm to …","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Split the key pair into the two keys","Creating the Encryption Context Generate the HPKE context …","Create a new HPKE public key. Consumes the public key …","Create a new HPKE private key. Consumes the private key …","Create a new HPKE key pair. Consumes the private and …","Set up the configuration for HPKE.","5.2. Encryption and Decryption","Single-Shot APIs 6.1. Encryption and DecryptionSingle shot …","Prelude for HPKE. Include this to get access to all the …","Get a reference to the HPKE private key of this key pair.","Get a reference to the HPKE public key of this key pair.","Single-Shot APIs 6.2. Secret ExportSingle shot API to …","5.2. Encryption and Decryption","Single-Shot APIs 6.1. Encryption and DecryptionSingle shot …","Set PRNG state for testing.","Single-Shot APIs 6.2. Secret ExportSingle shot API to …","","","","","Set up an HPKE receiver.","Set up an HPKE sender.","Test util module. Should be moved really.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","The type returned in the event of a conversion error.","","Simple and safe type conversions that may fail in a …","Performs the conversion.","Convert bytes
to a hex string.","Convert a hex string to a byte vector.","Convert a hex string to a byte vector. If the input is None
…","Convert a byte slice into byte slice option. Returns Nonce
…"],"i":[7,7,7,0,5,0,0,0,0,0,0,0,0,5,5,5,5,5,5,5,0,5,7,5,5,1,4,14,5,1,4,6,7,8,14,5,1,4,6,7,8,5,1,4,6,7,8,5,1,4,6,7,8,1,4,6,8,1,4,6,7,5,1,4,7,14,14,5,5,1,4,6,7,7,8,8,14,5,5,1,1,1,4,4,4,6,6,6,7,8,6,8,14,5,1,4,6,7,8,6,8,1,4,6,8,14,8,0,6,6,8,14,8,8,8,1,4,6,7,8,8,0,1,1,1,1,1,1,5,1,4,6,7,8,5,7,8,14,5,1,4,6,7,7,8,14,5,1,4,6,7,8,14,5,1,4,6,7,8,4,33,0,0,33,0,0,0,0],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[1,[[3,[2]]]],[4,[[3,[2]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[5,5],[1,1],[4,4],[6,6],[7,7],[[[8,[-1]]],[[8,[-1]]],9],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[],1],[[],4],[[],6],[[[8,[-1]],[3,[2]]],[[11,[6,5]]],9],[-1,[[11,[1]]],12],[-1,[[11,[4]]],12],[-1,[[11,[6]]],12],[-1,[[11,[7]]],12],[[5,5],13],[[1,1],13],[[4,4],13],[[7,7],13],[[[14,[-1]],[3,[2]],15],[[11,[[16,[2]],5]]],9],[[[14,[-1]],17],18,9],[[5,17],18],[[5,17],18],[[1,17],18],[[4,17],[[11,[10,19]]]],[[6,17],18],[[7,17],18],[[7,17],18],[[[8,[-1]],17],18,9],[[[8,[-1]],17],18,[20,9]],[-1,-1,[]],[21,5],[-1,-1,[]],[[[16,[2]]],1],[[[3,[2]]],1],[-1,-1,[]],[[[3,[2]]],4],[-1,-1,[]],[[[16,[2]]],4],[[[10,[[3,[2]],[3,[2]]]]],6],[[[10,[[16,[2]],[16,[2]]]]],6],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[[4,1],6],[[[8,[-1]]],[[11,[6,5]]],9],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[6,[[10,[4,1]]]],[[[8,[-1]],[3,[2]],[3,[2]],[3,[2]],[3,[2]]],[[11,[[14,[-1]],5]]],9],[[[16,[2]]],1],[[[16,[2]]],4],[[[16,[2]],[16,[2]]],6],[[7,22,23,24],[[8,[-1]]],9],[[[14,[-1]],[3,[2]],[3,[2]]],[[11,[[16,[2]],5]]],9],[[[8,[-1]],[3,[2]],4,[3,[2]],[3,[2]],[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[1]]],[[11,[[16,[2]],5]]],9],0,[6,4],[6,1],[[[8,[-1]],[3,[2]],4,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[1]],[3,[2]],15],[[11,[[16,[2]],5]]],9],[[[14,[-1]],[3,[2]],[3,[2]]],[[11,[[16,[2]],5]]],9],[[[8,[-1]],1,[3,[2]],[3,[2]],[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[4]]],[[11,[[10,[[16,[2]],[16,[2]]]],5]]],9],[[[8,[-1]],[3,[2]]],[[11,[10,5]]],9],[[[8,[-1]],1,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[4]],[3,[2]],15],[[11,[[10,[[16,[2]],[16,[2]]]],5]]],9],[[1,-1],11,26],[[4,-1],11,26],[[6,-1],11,26],[[7,-1],11,26],[[[8,[-1]],[3,[2]],4,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[1]]],[[11,[[14,[-1]],5]]],9],[[[8,[-1]],1,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[4]]],[[11,[[10,[[16,[2]],[14,[-1]]]],5]]],9],0,[-1,[[11,[1,27]]],28],[-1,[[11,[1,27]]],28],[[1,-1],[[11,[15,27]]],29],[[1,-1],[[11,[15,27]]],29],[1,15],[1,15],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,30,[]],[-1,30,[]],[-1,30,[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[2,[[11,[7,5]]]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[4,10],0,0,0,[-1,[[11,[-2]]],[],[]],[[[3,[2]]],30],[32,[[16,[2]]]],[[[25,[30]]],[[16,[2]]]],[[[3,[2]]],[[25,[[3,[2]]]]]]],"c":[5,6,7],"p":[[3,"HpkePublicKey",0],[15,"u8"],[15,"slice"],[3,"HpkePrivateKey",0],[4,"HpkeError",0],[3,"HpkeKeyPair",0],[4,"Mode",0],[3,"Hpke",0],[8,"HpkeCrypto",168],[15,"tuple"],[4,"Result",169],[8,"Deserializer",170],[15,"bool"],[3,"Context",0],[15,"usize"],[3,"Vec",171],[3,"Formatter",172],[6,"Result",172],[3,"Error",172],[8,"Debug",172],[4,"Error",173],[4,"KemAlgorithm",174],[4,"KdfAlgorithm",174],[4,"AeadAlgorithm",174],[4,"Option",175],[8,"Serializer",176],[4,"Error",177],[8,"Read",178],[8,"Write",178],[3,"String",179],[3,"TypeId",180],[15,"str"],[8,"TryFrom",160]]}\
}');
if (typeof window !== 'undefined' && window.initSearch) {window.initSearch(searchIndex)};
if (typeof exports !== 'undefined') {exports.searchIndex = searchIndex};
diff --git a/src/hpke_rs/dh_kem.rs.html b/src/hpke_rs/dh_kem.rs.html
index 76d229d..e626cdb 100644
--- a/src/hpke_rs/dh_kem.rs.html
+++ b/src/hpke_rs/dh_kem.rs.html
@@ -175,9 +175,13 @@
175
176
177
+178
+179
//! DH KEM as described in §4.1. DH-Based KEM.
-use hpke_rs_crypto::{error::Error, types::KemAlgorithm, HpkeCrypto};
+use alloc::{string::ToString, vec::Vec};
+
+use hpke_rs_crypto::{error::Error, types::KemAlgorithm, HpkeCrypto};
use crate::util::*;
use crate::{
diff --git a/src/hpke_rs/kdf.rs.html b/src/hpke_rs/kdf.rs.html
index e71827a..63956d6 100644
--- a/src/hpke_rs/kdf.rs.html
+++ b/src/hpke_rs/kdf.rs.html
@@ -28,7 +28,11 @@
28
29
30
-
use hpke_rs_crypto::{error::Error, types::KdfAlgorithm, HpkeCrypto};
+31
+32
+
use alloc::vec::Vec;
+
+use hpke_rs_crypto::{error::Error, types::KdfAlgorithm, HpkeCrypto};
use crate::util::concat;
diff --git a/src/hpke_rs/kem.rs.html b/src/hpke_rs/kem.rs.html
index 3fbf089..e860613 100644
--- a/src/hpke_rs/kem.rs.html
+++ b/src/hpke_rs/kem.rs.html
@@ -97,7 +97,11 @@
97
98
99
-
use hpke_rs_crypto::{error::Error, types::KemAlgorithm, HpkeCrypto};
+100
+101
+
use alloc::vec::Vec;
+
+use hpke_rs_crypto::{error::Error, types::KemAlgorithm, HpkeCrypto};
use crate::dh_kem;
use crate::util;
diff --git a/src/hpke_rs/lib.rs.html b/src/hpke_rs/lib.rs.html
index e14bd4b..18ff4d7 100644
--- a/src/hpke_rs/lib.rs.html
+++ b/src/hpke_rs/lib.rs.html
@@ -994,6 +994,14 @@
994
995
996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
#![doc = include_str!("../Readme.md")]
#![forbid(unsafe_code, unused_must_use, unstable_features)]
#![deny(
@@ -1004,8 +1012,18 @@
unused_extern_crates,
unused_qualifications
)]
+#![cfg_attr(not(test), no_std)]
-use std::sync::RwLock;
+extern crate alloc;
+#[cfg(feature = "std")]
+extern crate std;
+
+use alloc::{
+ format,
+ string::{String, ToString},
+ vec,
+ vec::Vec,
+};
#[cfg(feature = "hpke-test-prng")]
use hpke_rs_crypto::HpkeTestRng;
@@ -1075,15 +1093,13 @@
/// Unable to collect enough randomness.
InsufficientRandomness,
-
- /// A concurrency issue with an [`RwLock`].
- LockPoisoned,
}
-impl std::error::Error for HpkeError {}
+#[cfg(feature = "std")]
+impl std::error::Error for HpkeError {}
-impl std::fmt::Display for HpkeError {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+impl core::fmt::Display for HpkeError {
+ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "HPKE Error: {:?}", self)
}
}
@@ -1155,8 +1171,8 @@
AuthPsk = 0x03,
}
-impl std::fmt::Display for Mode {
- fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+impl core::fmt::Display for Mode {
+ fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
write!(f, "{:?}", self)
}
}
@@ -1198,8 +1214,8 @@
}
#[cfg(feature = "hazmat")]
-impl<Crypto: HpkeCrypto> std::fmt::Debug for Context<Crypto> {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+impl<Crypto: HpkeCrypto> core::fmt::Debug for Context<Crypto> {
+ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(
f,
"Context {{\n key: {:?}\n nonce: {:?}\n exporter_secret: {:?}\n seq no: {:?}\n}}",
@@ -1209,8 +1225,8 @@
}
#[cfg(not(feature = "hazmat"))]
-impl<Crypto: HpkeCrypto> std::fmt::Debug for Context<Crypto> {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+impl<Crypto: HpkeCrypto> core::fmt::Debug for Context<Crypto> {
+ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(
f,
"Context {{\n key: {:?}\n nonce: {:?}\n exporter_secret: {:?}\n seq no: {:?}\n}}",
@@ -1327,7 +1343,7 @@
kem_id: KemAlgorithm,
kdf_id: KdfAlgorithm,
aead_id: AeadAlgorithm,
- prng: RwLock<Crypto::HpkePrng>,
+ prng: Crypto::HpkePrng,
}
impl<Crypto: 'static + HpkeCrypto> Clone for Hpke<Crypto> {
@@ -1337,13 +1353,13 @@
kem_id: self.kem_id,
kdf_id: self.kdf_id,
aead_id: self.aead_id,
- prng: RwLock::new(Crypto::prng()),
+ prng: Crypto::prng(),
}
}
}
-impl<Crypto: HpkeCrypto> std::fmt::Display for Hpke<Crypto> {
- fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+impl<Crypto: HpkeCrypto> core::fmt::Display for Hpke<Crypto> {
+ fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
write!(
f,
"{}_{}_{}_{}",
@@ -1368,7 +1384,7 @@
kem_id,
kdf_id,
aead_id,
- prng: RwLock::new(Crypto::prng()),
+ prng: Crypto::prng(),
}
}
@@ -1387,7 +1403,7 @@
/// The encapsulated secret is returned together with the context.
/// If the secret key is missing in an authenticated mode, an error is returned.
pub fn setup_sender(
- &self,
+ &mut self,
pk_r: &HpkePublicKey,
info: &[u8],
psk: Option<&[u8]>,
@@ -1474,7 +1490,7 @@
/// Returns the encapsulated secret and the ciphertext, or an error.
#[allow(clippy::too_many_arguments)]
pub fn seal(
- &self,
+ &mut self,
pk_r: &HpkePublicKey,
info: &[u8],
aad: &[u8],
@@ -1530,7 +1546,7 @@
/// exporter context and length.
#[allow(clippy::too_many_arguments)]
pub fn send_export(
- &self,
+ &mut self,
pk_r: &HpkePublicKey,
info: &[u8],
psk: Option<&[u8]>,
@@ -1670,9 +1686,8 @@
/// This is equivalent to `derive_key_pair(random_vector(sk.len()))`
///
/// Returns an `HpkeKeyPair`.
- pub fn generate_key_pair(&self) -> Result<HpkeKeyPair, HpkeError> {
- let mut prng = self.prng.write().map_err(|_| HpkeError::LockPoisoned)?;
- let (sk, pk) = kem::key_gen::<Crypto>(self.kem_id, &mut prng)?;
+ pub fn generate_key_pair(&mut self) -> Result<HpkeKeyPair, HpkeError> {
+ let (sk, pk) = kem::key_gen::<Crypto>(self.kem_id, &mut self.prng)?;
Ok(HpkeKeyPair::new(sk, pk))
}
@@ -1686,8 +1701,8 @@
}
#[inline]
- pub(crate) fn random(&self, len: usize) -> Result<Vec<u8>, HpkeError> {
- let mut prng = self.prng.write().map_err(|_| HpkeError::LockPoisoned)?;
+ pub(crate) fn random(&mut self, len: usize) -> Result<Vec<u8>, HpkeError> {
+ let prng = &mut self.prng;
let mut out = vec![0u8; len];
#[cfg(feature = "hpke-test-prng")]
@@ -1790,8 +1805,8 @@
}
#[cfg(not(feature = "hazmat"))]
-impl std::fmt::Debug for HpkePrivateKey {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
+impl core::fmt::Debug for HpkePrivateKey {
+ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> Result<(), core::fmt::Error> {
f.debug_struct("HpkePrivateKey")
.field("value", &"***")
.finish()
@@ -1799,8 +1814,8 @@
}
#[cfg(feature = "hazmat")]
-impl std::fmt::Debug for HpkePrivateKey {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
+impl core::fmt::Debug for HpkePrivateKey {
+ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> Result<(), core::fmt::Error> {
f.debug_struct("HpkePrivateKey")
.field("value", &self.value)
.finish()
@@ -1887,14 +1902,15 @@
/// Test util module. Should be moved really.
#[cfg(feature = "hpke-test")]
pub mod test_util {
+ use alloc::{format, string::String, vec, vec::Vec};
+
use crate::HpkeError;
use hpke_rs_crypto::{HpkeCrypto, HpkeTestRng};
impl<Crypto: HpkeCrypto> super::Hpke<Crypto> {
/// Set PRNG state for testing.
- pub fn seed(&self, seed: &[u8]) -> Result<(), HpkeError> {
- let mut prng = self.prng.write().map_err(|_| HpkeError::LockPoisoned)?;
- prng.seed(seed);
+ pub fn seed(&mut self, seed: &[u8]) -> Result<(), HpkeError> {
+ self.prng.seed(seed);
Ok(())
}
}
diff --git a/src/hpke_rs/prelude.rs.html b/src/hpke_rs/prelude.rs.html
index dd7776a..41db4f7 100644
--- a/src/hpke_rs/prelude.rs.html
+++ b/src/hpke_rs/prelude.rs.html
@@ -7,5 +7,5 @@
//! Include this to get access to all the public functions of HPKE.
pub use super::{Mode as HpkeMode, *};
-pub use std::convert::TryFrom;
+pub use core::convert::TryFrom;
\ No newline at end of file
diff --git a/src/hpke_rs/util.rs.html b/src/hpke_rs/util.rs.html
index 5e150a7..f3a73c0 100644
--- a/src/hpke_rs/util.rs.html
+++ b/src/hpke_rs/util.rs.html
@@ -19,7 +19,11 @@
19
20
21
-#[inline]
+22
+23
+
use alloc::vec::Vec;
+
+#[inline]
pub(crate) fn concat(values: &[&[u8]]) -> Vec<u8> {
values.join(&[][..])
}
Struct hpke_rs::HpkePrivateKey
source · pub struct HpkePrivateKey { /* private fields */ }
Expand description
An HPKE private key is a byte vector.
-Implementations§
source§impl HpkePrivateKey
impl HpkePrivateKey
sourcepub fn new(b: Vec<u8>) -> Self
pub fn new(b: Vec<u8>) -> Self
Create a new HPKE private key. +
Struct hpke_rs::HpkePrivateKey
source · pub struct HpkePrivateKey { /* private fields */ }
Expand description
An HPKE private key is a byte vector.
+Implementations§
Trait Implementations§
source§impl Clone for HpkePrivateKey
impl Clone for HpkePrivateKey
source§fn clone(&self) -> HpkePrivateKey
fn clone(&self) -> HpkePrivateKey
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for HpkePrivateKey
impl Debug for HpkePrivateKey
source§impl Default for HpkePrivateKey
impl Default for HpkePrivateKey
source§fn default() -> HpkePrivateKey
fn default() -> HpkePrivateKey
source§impl<'de> Deserialize<'de> for HpkePrivateKey
impl<'de> Deserialize<'de> for HpkePrivateKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where - __D: Deserializer<'de>,
source§impl From<&[u8]> for HpkePrivateKey
impl From<&[u8]> for HpkePrivateKey
source§impl PartialEq<HpkePrivateKey> for HpkePrivateKey
impl PartialEq<HpkePrivateKey> for HpkePrivateKey
Hopefully constant time comparison of the two values as long as they have the +
Trait Implementations§
source§impl Clone for HpkePrivateKey
impl Clone for HpkePrivateKey
source§fn clone(&self) -> HpkePrivateKey
fn clone(&self) -> HpkePrivateKey
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for HpkePrivateKey
impl Debug for HpkePrivateKey
source§impl Default for HpkePrivateKey
impl Default for HpkePrivateKey
source§fn default() -> HpkePrivateKey
fn default() -> HpkePrivateKey
source§impl<'de> Deserialize<'de> for HpkePrivateKey
impl<'de> Deserialize<'de> for HpkePrivateKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,
source§impl From<&[u8]> for HpkePrivateKey
impl From<&[u8]> for HpkePrivateKey
source§impl PartialEq<HpkePrivateKey> for HpkePrivateKey
impl PartialEq<HpkePrivateKey> for HpkePrivateKey
Hopefully constant time comparison of the two values as long as they have the same length.
-source§fn eq(&self, other: &Self) -> bool
fn eq(&self, other: &Self) -> bool
self
and other
values to be equal, and is used
+source§impl Serialize for HpkePrivateKey
impl Serialize for HpkePrivateKey
source§impl Zeroize for HpkePrivateKey
impl Zeroize for HpkePrivateKey
source§impl Serialize for HpkePrivateKey
impl Serialize for HpkePrivateKey
Auto Trait Implementations§
impl RefUnwindSafe for HpkePrivateKey
impl Send for HpkePrivateKey
impl Sync for HpkePrivateKey
impl Unpin for HpkePrivateKey
impl UnwindSafe for HpkePrivateKey
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
diff --git a/hpke_rs/struct.HpkePublicKey.html b/hpke_rs/struct.HpkePublicKey.html
index fac3457..d162776 100644
--- a/hpke_rs/struct.HpkePublicKey.html
+++ b/hpke_rs/struct.HpkePublicKey.html
@@ -1,20 +1,20 @@
-HpkePublicKey in hpke_rs - Rust Struct hpke_rs::HpkePublicKey
source · pub struct HpkePublicKey { /* private fields */ }
Expand description
An HPKE public key is a byte vector.
-Implementations§
source§impl HpkePublicKey
sourcepub fn new(value: Vec<u8>) -> Self
Create a new HPKE public key.
+
HpkePublicKey in hpke_rs - Rust Struct hpke_rs::HpkePublicKey
source · pub struct HpkePublicKey { /* private fields */ }
Expand description
An HPKE public key is a byte vector.
+Implementations§
Trait Implementations§
source§impl Clone for HpkePublicKey
source§fn clone(&self) -> HpkePublicKey
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkePublicKey
source§impl Default for HpkePublicKey
source§fn default() -> HpkePublicKey
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkePublicKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Deserialize for &HpkePublicKey
source§fn tls_deserialize<R: Read>(_: &mut R) -> Result<Self, Error>
This function deserializes the bytes
from the provided a std::io::Read
-and returns the populated struct. Read moresource§impl Deserialize for HpkePublicKey
Trait Implementations§
source§impl Clone for HpkePublicKey
source§fn clone(&self) -> HpkePublicKey
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkePublicKey
source§impl Default for HpkePublicKey
source§fn default() -> HpkePublicKey
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkePublicKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Deserialize for &HpkePublicKey
source§fn tls_deserialize<R: Read>(_: &mut R) -> Result<Self, Error>
This function deserializes the bytes
from the provided a std::io::Read
and returns the populated struct. Read moresource§impl From<&[u8]> for HpkePublicKey
source§impl PartialEq<HpkePublicKey> for HpkePublicKey
source§impl Deserialize for HpkePublicKey
source§fn tls_deserialize<R: Read>(bytes: &mut R) -> Result<Self, Error>
This function deserializes the bytes
from the provided a std::io::Read
+and returns the populated struct. Read moresource§impl From<&[u8]> for HpkePublicKey
source§impl PartialEq<HpkePublicKey> for HpkePublicKey
source§fn eq(&self, other: &HpkePublicKey) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
.source§impl Serialize for &HpkePublicKey
source§impl Serialize for HpkePublicKey
source§impl Serialize for HpkePublicKey
source§impl Size for &HpkePublicKey
source§fn tls_serialized_len(&self) -> usize
source§impl Size for HpkePublicKey
source§fn tls_serialized_len(&self) -> usize
source§impl StructuralPartialEq for HpkePublicKey
Auto Trait Implementations§
§impl RefUnwindSafe for HpkePublicKey
§impl Send for HpkePublicKey
§impl Sync for HpkePublicKey
§impl Unpin for HpkePublicKey
§impl UnwindSafe for HpkePublicKey
Blanket Implementations§
source§impl Serialize for &HpkePublicKey
source§impl Serialize for HpkePublicKey
source§impl Serialize for HpkePublicKey
source§impl Size for &HpkePublicKey
source§fn tls_serialized_len(&self) -> usize
source§impl Size for HpkePublicKey
source§fn tls_serialized_len(&self) -> usize
source§impl StructuralPartialEq for HpkePublicKey
Auto Trait Implementations§
§impl RefUnwindSafe for HpkePublicKey
§impl Send for HpkePublicKey
§impl Sync for HpkePublicKey
§impl Unpin for HpkePublicKey
§impl UnwindSafe for HpkePublicKey
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moresource§impl<T> From<T> for T
source§fn from(t: T) -> T
Returns the argument unchanged.
diff --git a/hpke_rs/test_util/fn.bytes_to_hex.html b/hpke_rs/test_util/fn.bytes_to_hex.html
index c47028a..a04498e 100644
--- a/hpke_rs/test_util/fn.bytes_to_hex.html
+++ b/hpke_rs/test_util/fn.bytes_to_hex.html
@@ -1,2 +1,2 @@
-bytes_to_hex in hpke_rs::test_util - Rust Function hpke_rs::test_util::bytes_to_hex
source · pub fn bytes_to_hex(bytes: &[u8]) -> String
Expand description
Convert bytes
to a hex string.
+bytes_to_hex in hpke_rs::test_util - Rust
\ No newline at end of file
diff --git a/hpke_rs/test_util/fn.hex_to_bytes.html b/hpke_rs/test_util/fn.hex_to_bytes.html
index 84e2f6e..9cc1035 100644
--- a/hpke_rs/test_util/fn.hex_to_bytes.html
+++ b/hpke_rs/test_util/fn.hex_to_bytes.html
@@ -1,2 +1,2 @@
-hex_to_bytes in hpke_rs::test_util - Rust Function hpke_rs::test_util::hex_to_bytes
source · pub fn hex_to_bytes(hex: &str) -> Vec<u8>
Expand description
Convert a hex string to a byte vector.
+hex_to_bytes in hpke_rs::test_util - Rust
\ No newline at end of file
diff --git a/hpke_rs/test_util/fn.hex_to_bytes_option.html b/hpke_rs/test_util/fn.hex_to_bytes_option.html
index 7240995..d0bf887 100644
--- a/hpke_rs/test_util/fn.hex_to_bytes_option.html
+++ b/hpke_rs/test_util/fn.hex_to_bytes_option.html
@@ -1,3 +1,3 @@
-hex_to_bytes_option in hpke_rs::test_util - Rust Function hpke_rs::test_util::hex_to_bytes_option
source · pub fn hex_to_bytes_option(hex: Option<String>) -> Vec<u8>
Expand description
Convert a hex string to a byte vector.
+
hex_to_bytes_option in hpke_rs::test_util - Rust
\ No newline at end of file
diff --git a/hpke_rs/test_util/fn.vec_to_option_slice.html b/hpke_rs/test_util/fn.vec_to_option_slice.html
index bb11c70..5ddbf28 100644
--- a/hpke_rs/test_util/fn.vec_to_option_slice.html
+++ b/hpke_rs/test_util/fn.vec_to_option_slice.html
@@ -1,3 +1,3 @@
-vec_to_option_slice in hpke_rs::test_util - Rust Function hpke_rs::test_util::vec_to_option_slice
source · pub fn vec_to_option_slice(v: &[u8]) -> Option<&[u8]>
Expand description
Convert a byte slice into byte slice option.
+
vec_to_option_slice in hpke_rs::test_util - Rust
\ No newline at end of file
diff --git a/hpke_rs/test_util/index.html b/hpke_rs/test_util/index.html
index 301a0d6..c48a151 100644
--- a/hpke_rs/test_util/index.html
+++ b/hpke_rs/test_util/index.html
@@ -1,4 +1,4 @@
-hpke_rs::test_util - Rust Expand description
Test util module. Should be moved really.
+hpke_rs::test_util - Rust Expand description
Test util module. Should be moved really.
Functions
- Convert
bytes
to a hex string. - Convert a hex string to a byte vector.
- Convert a hex string to a byte vector.
If the input is
None
, this returns an empty vector. - Convert a byte slice into byte slice option.
Returns
Nonce
if the byte slice is empty and Some(v)
otherwise.
\ No newline at end of file
diff --git a/hpke_rs/type.HPKEKeyPair.html b/hpke_rs/type.HPKEKeyPair.html
index 9a9f9de..e10b94e 100644
--- a/hpke_rs/type.HPKEKeyPair.html
+++ b/hpke_rs/type.HPKEKeyPair.html
@@ -1,9 +1,9 @@
-HPKEKeyPair in hpke_rs - Rust Type Alias hpke_rs::HPKEKeyPair
source · pub type HPKEKeyPair = HpkeKeyPair;
👎Deprecated since 0.0.7: Please use HpkeKeyPair instead. This alias will be removed with the first stable 0.1 release.Aliased Type§
struct HPKEKeyPair { /* private fields */ }
Implementations§
source§impl HpkeKeyPair
sourcepub fn new(sk: Vec<u8>, pk: Vec<u8>) -> Self
Create a new HPKE key pair.
+
HPKEKeyPair in hpke_rs - Rust Type Alias hpke_rs::HPKEKeyPair
source · pub type HPKEKeyPair = HpkeKeyPair;
👎Deprecated since 0.0.7: Please use HpkeKeyPair instead. This alias will be removed with the first stable 0.1 release.Aliased Type§
struct HPKEKeyPair { /* private fields */ }
Implementations§
source§impl HpkeKeyPair
sourcepub fn new(sk: Vec<u8>, pk: Vec<u8>) -> Self
Create a new HPKE key pair.
Consumes the private and public key bytes.
-sourcepub fn private_key(&self) -> &HpkePrivateKey
Get a reference to the HPKE private key of this key pair.
-sourcepub fn public_key(&self) -> &HpkePublicKey
Get a reference to the HPKE public key of this key pair.
-sourcepub fn into_keys(self) -> (HpkePrivateKey, HpkePublicKey)
Split the key pair into the two keys
-sourcepub fn from_keys(private_key: HpkePrivateKey, public_key: HpkePublicKey) -> Self
Build a key pair from two keys
-Trait Implementations§
source§impl Clone for HpkeKeyPair
source§fn clone(&self) -> HpkeKeyPair
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkeKeyPair
source§impl Default for HpkeKeyPair
source§fn default() -> HpkeKeyPair
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkeKeyPair
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Serialize for HpkeKeyPair
sourcepub fn private_key(&self) -> &HpkePrivateKey
Get a reference to the HPKE private key of this key pair.
+sourcepub fn public_key(&self) -> &HpkePublicKey
Get a reference to the HPKE public key of this key pair.
+sourcepub fn into_keys(self) -> (HpkePrivateKey, HpkePublicKey)
Split the key pair into the two keys
+sourcepub fn from_keys(private_key: HpkePrivateKey, public_key: HpkePublicKey) -> Self
Build a key pair from two keys
+Trait Implementations§
source§impl Clone for HpkeKeyPair
source§fn clone(&self) -> HpkeKeyPair
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkeKeyPair
source§impl Default for HpkeKeyPair
source§fn default() -> HpkeKeyPair
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkeKeyPair
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
\ No newline at end of file
diff --git a/hpke_rs/type.HPKEPrivateKey.html b/hpke_rs/type.HPKEPrivateKey.html
index 44660f2..c21fe66 100644
--- a/hpke_rs/type.HPKEPrivateKey.html
+++ b/hpke_rs/type.HPKEPrivateKey.html
@@ -1,11 +1,11 @@
-HPKEPrivateKey in hpke_rs - Rust Type Alias hpke_rs::HPKEPrivateKey
source · pub type HPKEPrivateKey = HpkePrivateKey;
👎Deprecated since 0.0.7: Please use HpkePrivateKey instead. This alias will be removed with the first stable 0.1 release.Aliased Type§
struct HPKEPrivateKey { /* private fields */ }
Implementations§
source§impl HpkePrivateKey
sourcepub fn new(b: Vec<u8>) -> Self
Create a new HPKE private key.
+
HPKEPrivateKey in hpke_rs - Rust Type Alias hpke_rs::HPKEPrivateKey
source · pub type HPKEPrivateKey = HpkePrivateKey;
👎Deprecated since 0.0.7: Please use HpkePrivateKey instead. This alias will be removed with the first stable 0.1 release.Aliased Type§
struct HPKEPrivateKey { /* private fields */ }
Implementations§
Trait Implementations§
source§impl Clone for HpkePrivateKey
source§fn clone(&self) -> HpkePrivateKey
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkePrivateKey
source§impl Default for HpkePrivateKey
source§fn default() -> HpkePrivateKey
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkePrivateKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<&[u8]> for HpkePrivateKey
source§impl PartialEq<HpkePrivateKey> for HpkePrivateKey
Hopefully constant time comparison of the two values as long as they have the
+
Trait Implementations§
source§impl Clone for HpkePrivateKey
source§fn clone(&self) -> HpkePrivateKey
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkePrivateKey
source§impl Default for HpkePrivateKey
source§fn default() -> HpkePrivateKey
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkePrivateKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<&[u8]> for HpkePrivateKey
source§impl PartialEq<HpkePrivateKey> for HpkePrivateKey
Hopefully constant time comparison of the two values as long as they have the
same length.
-source§fn eq(&self, other: &Self) -> bool
This method tests for self
and other
values to be equal, and is used
+source§impl Serialize for HpkePrivateKey
source§impl Zeroize for HpkePrivateKey
source§impl Serialize for HpkePrivateKey
\ No newline at end of file
diff --git a/hpke_rs/type.HPKEPublicKey.html b/hpke_rs/type.HPKEPublicKey.html
index 44dc41a..81d662f 100644
--- a/hpke_rs/type.HPKEPublicKey.html
+++ b/hpke_rs/type.HPKEPublicKey.html
@@ -1,12 +1,12 @@
-HPKEPublicKey in hpke_rs - Rust Type Alias hpke_rs::HPKEPublicKey
source · pub type HPKEPublicKey = HpkePublicKey;
👎Deprecated since 0.0.7: Please use HpkePublicKey instead. This alias will be removed with the first stable 0.1 release.Aliased Type§
struct HPKEPublicKey { /* private fields */ }
Implementations§
source§impl HpkePublicKey
sourcepub fn new(value: Vec<u8>) -> Self
Create a new HPKE public key.
+
HPKEPublicKey in hpke_rs - Rust Type Alias hpke_rs::HPKEPublicKey
source · pub type HPKEPublicKey = HpkePublicKey;
👎Deprecated since 0.0.7: Please use HpkePublicKey instead. This alias will be removed with the first stable 0.1 release.Aliased Type§
struct HPKEPublicKey { /* private fields */ }
Implementations§
Trait Implementations§
source§impl Clone for HpkePublicKey
source§fn clone(&self) -> HpkePublicKey
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkePublicKey
source§impl Default for HpkePublicKey
source§fn default() -> HpkePublicKey
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkePublicKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Deserialize for HpkePublicKey
Trait Implementations§
source§impl Clone for HpkePublicKey
source§fn clone(&self) -> HpkePublicKey
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkePublicKey
source§impl Default for HpkePublicKey
source§fn default() -> HpkePublicKey
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkePublicKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Deserialize for HpkePublicKey
source§fn tls_deserialize<R: Read>(bytes: &mut R) -> Result<Self, Error>
This function deserializes the bytes
from the provided a std::io::Read
and returns the populated struct. Read moresource§impl From<&[u8]> for HpkePublicKey
source§impl PartialEq<HpkePublicKey> for HpkePublicKey
source§impl From<&[u8]> for HpkePublicKey
source§impl PartialEq<HpkePublicKey> for HpkePublicKey
source§fn eq(&self, other: &HpkePublicKey) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
.source§impl Serialize for HpkePublicKey
source§impl Serialize for HpkePublicKey
source§impl Size for HpkePublicKey
source§fn tls_serialized_len(&self) -> usize
source§impl StructuralPartialEq for HpkePublicKey
\ No newline at end of file
+sufficient, and should not be overridden without very good reason.source§impl Serialize for HpkePublicKey
source§impl Serialize for HpkePublicKey
source§impl Size for HpkePublicKey
source§fn tls_serialized_len(&self) -> usize
source§impl StructuralPartialEq for HpkePublicKey
\ No newline at end of file
diff --git a/implementors/core/clone/trait.Clone.js b/implementors/core/clone/trait.Clone.js
index 29c3d7e..c7012c5 100644
--- a/implementors/core/clone/trait.Clone.js
+++ b/implementors/core/clone/trait.Clone.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl Clone for HpkePrivateKey"],["impl<Crypto: 'static + HpkeCrypto> Clone for Hpke<Crypto>"],["impl Clone for HpkeKeyPair"],["impl Clone for HpkeError"],["impl Clone for Mode"],["impl Clone for HpkePublicKey"]]
+"hpke_rs":[["impl Clone for HpkePublicKey"],["impl Clone for Mode"],["impl Clone for HpkePrivateKey"],["impl<Crypto: 'static + HpkeCrypto> Clone for Hpke<Crypto>"],["impl Clone for HpkeError"],["impl Clone for HpkeKeyPair"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/cmp/trait.PartialEq.js b/implementors/core/cmp/trait.PartialEq.js
index 5f936b7..57abae6 100644
--- a/implementors/core/cmp/trait.PartialEq.js
+++ b/implementors/core/cmp/trait.PartialEq.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl PartialEq<HpkePrivateKey> for HpkePrivateKey"],["impl PartialEq<HpkePublicKey> for HpkePublicKey"],["impl PartialEq<HpkeError> for HpkeError"],["impl PartialEq<Mode> for Mode"]]
+"hpke_rs":[["impl PartialEq<HpkeError> for HpkeError"],["impl PartialEq<HpkePublicKey> for HpkePublicKey"],["impl PartialEq<HpkePrivateKey> for HpkePrivateKey"],["impl PartialEq<Mode> for Mode"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/convert/trait.From.js b/implementors/core/convert/trait.From.js
index 135811f..f37b9ac 100644
--- a/implementors/core/convert/trait.From.js
+++ b/implementors/core/convert/trait.From.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl From<Error> for HpkeError"],["impl From<Vec<u8, Global>> for HpkePublicKey"],["impl From<(Vec<u8, Global>, Vec<u8, Global>)> for HpkeKeyPair"],["impl From<Vec<u8, Global>> for HpkePrivateKey"],["impl From<&[u8]> for HpkePublicKey"],["impl From<(&[u8], &[u8])> for HpkeKeyPair"],["impl From<&[u8]> for HpkePrivateKey"]]
+"hpke_rs":[["impl From<Vec<u8, Global>> for HpkePublicKey"],["impl From<&[u8]> for HpkePrivateKey"],["impl From<(Vec<u8, Global>, Vec<u8, Global>)> for HpkeKeyPair"],["impl From<&[u8]> for HpkePublicKey"],["impl From<Vec<u8, Global>> for HpkePrivateKey"],["impl From<Error> for HpkeError"],["impl From<(&[u8], &[u8])> for HpkeKeyPair"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/default/trait.Default.js b/implementors/core/default/trait.Default.js
index b470006..af577a2 100644
--- a/implementors/core/default/trait.Default.js
+++ b/implementors/core/default/trait.Default.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl Default for HpkeKeyPair"],["impl Default for HpkePublicKey"],["impl Default for HpkePrivateKey"]]
+"hpke_rs":[["impl Default for HpkeKeyPair"],["impl Default for HpkePrivateKey"],["impl Default for HpkePublicKey"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/fmt/trait.Debug.js b/implementors/core/fmt/trait.Debug.js
index 825f35c..005952f 100644
--- a/implementors/core/fmt/trait.Debug.js
+++ b/implementors/core/fmt/trait.Debug.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl<Crypto: Debug + 'static + HpkeCrypto> Debug for Hpke<Crypto>where\n Crypto::HpkePrng: Debug,"],["impl Debug for HpkeError"],["impl<Crypto: HpkeCrypto> Debug for Context<Crypto>"],["impl Debug for HpkePrivateKey"],["impl Debug for Mode"],["impl Debug for HpkeKeyPair"],["impl Debug for HpkePublicKey"]]
+"hpke_rs":[["impl Debug for HpkePublicKey"],["impl Debug for HpkePrivateKey"],["impl Debug for HpkeKeyPair"],["impl Debug for HpkeError"],["impl<Crypto: Debug + 'static + HpkeCrypto> Debug for Hpke<Crypto>where\n Crypto::HpkePrng: Debug,"],["impl Debug for Mode"],["impl<Crypto: HpkeCrypto> Debug for Context<Crypto>"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/marker/trait.Freeze.js b/implementors/core/marker/trait.Freeze.js
index 0625333..6df983d 100644
--- a/implementors/core/marker/trait.Freeze.js
+++ b/implementors/core/marker/trait.Freeze.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl Freeze for HpkeError",1,["hpke_rs::HpkeError"]],["impl Freeze for HpkePublicKey",1,["hpke_rs::HpkePublicKey"]],["impl Freeze for HpkePrivateKey",1,["hpke_rs::HpkePrivateKey"]],["impl Freeze for HpkeKeyPair",1,["hpke_rs::HpkeKeyPair"]],["impl Freeze for Mode",1,["hpke_rs::Mode"]],["impl<Crypto> !Freeze for Context<Crypto>",1,["hpke_rs::Context"]],["impl<Crypto> !Freeze for Hpke<Crypto>",1,["hpke_rs::Hpke"]]]
+"hpke_rs":[["impl Freeze for HpkeError",1,["hpke_rs::HpkeError"]],["impl Freeze for HpkePublicKey",1,["hpke_rs::HpkePublicKey"]],["impl Freeze for HpkePrivateKey",1,["hpke_rs::HpkePrivateKey"]],["impl Freeze for HpkeKeyPair",1,["hpke_rs::HpkeKeyPair"]],["impl Freeze for Mode",1,["hpke_rs::Mode"]],["impl<Crypto> Freeze for Context<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: Freeze,",1,["hpke_rs::Context"]],["impl<Crypto> Freeze for Hpke<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: Freeze,",1,["hpke_rs::Hpke"]]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/marker/trait.StructuralPartialEq.js b/implementors/core/marker/trait.StructuralPartialEq.js
index 9ad52ad..5e93391 100644
--- a/implementors/core/marker/trait.StructuralPartialEq.js
+++ b/implementors/core/marker/trait.StructuralPartialEq.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl StructuralPartialEq for HpkeError"],["impl StructuralPartialEq for HpkePublicKey"],["impl StructuralPartialEq for Mode"]]
+"hpke_rs":[["impl StructuralPartialEq for HpkePublicKey"],["impl StructuralPartialEq for Mode"],["impl StructuralPartialEq for HpkeError"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/marker/trait.Sync.js b/implementors/core/marker/trait.Sync.js
index 6ff5d31..499ecde 100644
--- a/implementors/core/marker/trait.Sync.js
+++ b/implementors/core/marker/trait.Sync.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl Sync for HpkeError",1,["hpke_rs::HpkeError"]],["impl Sync for HpkePublicKey",1,["hpke_rs::HpkePublicKey"]],["impl Sync for HpkePrivateKey",1,["hpke_rs::HpkePrivateKey"]],["impl Sync for HpkeKeyPair",1,["hpke_rs::HpkeKeyPair"]],["impl Sync for Mode",1,["hpke_rs::Mode"]],["impl<Crypto> Sync for Context<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: Send + Sync,",1,["hpke_rs::Context"]],["impl<Crypto> Sync for Hpke<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: Send + Sync,",1,["hpke_rs::Hpke"]]]
+"hpke_rs":[["impl Sync for HpkeError",1,["hpke_rs::HpkeError"]],["impl Sync for HpkePublicKey",1,["hpke_rs::HpkePublicKey"]],["impl Sync for HpkePrivateKey",1,["hpke_rs::HpkePrivateKey"]],["impl Sync for HpkeKeyPair",1,["hpke_rs::HpkeKeyPair"]],["impl Sync for Mode",1,["hpke_rs::Mode"]],["impl<Crypto> Sync for Context<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: Sync,",1,["hpke_rs::Context"]],["impl<Crypto> Sync for Hpke<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: Sync,",1,["hpke_rs::Hpke"]]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js b/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js
index 9d20887..5bd8bb3 100644
--- a/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js
+++ b/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl RefUnwindSafe for HpkeError",1,["hpke_rs::HpkeError"]],["impl RefUnwindSafe for HpkePublicKey",1,["hpke_rs::HpkePublicKey"]],["impl RefUnwindSafe for HpkePrivateKey",1,["hpke_rs::HpkePrivateKey"]],["impl RefUnwindSafe for HpkeKeyPair",1,["hpke_rs::HpkeKeyPair"]],["impl RefUnwindSafe for Mode",1,["hpke_rs::Mode"]],["impl<Crypto> RefUnwindSafe for Context<Crypto>",1,["hpke_rs::Context"]],["impl<Crypto> RefUnwindSafe for Hpke<Crypto>",1,["hpke_rs::Hpke"]]]
+"hpke_rs":[["impl RefUnwindSafe for HpkeError",1,["hpke_rs::HpkeError"]],["impl RefUnwindSafe for HpkePublicKey",1,["hpke_rs::HpkePublicKey"]],["impl RefUnwindSafe for HpkePrivateKey",1,["hpke_rs::HpkePrivateKey"]],["impl RefUnwindSafe for HpkeKeyPair",1,["hpke_rs::HpkeKeyPair"]],["impl RefUnwindSafe for Mode",1,["hpke_rs::Mode"]],["impl<Crypto> RefUnwindSafe for Context<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: RefUnwindSafe,",1,["hpke_rs::Context"]],["impl<Crypto> RefUnwindSafe for Hpke<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: RefUnwindSafe,",1,["hpke_rs::Hpke"]]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/panic/unwind_safe/trait.UnwindSafe.js b/implementors/core/panic/unwind_safe/trait.UnwindSafe.js
index 79979b4..633c214 100644
--- a/implementors/core/panic/unwind_safe/trait.UnwindSafe.js
+++ b/implementors/core/panic/unwind_safe/trait.UnwindSafe.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl UnwindSafe for HpkeError",1,["hpke_rs::HpkeError"]],["impl UnwindSafe for HpkePublicKey",1,["hpke_rs::HpkePublicKey"]],["impl UnwindSafe for HpkePrivateKey",1,["hpke_rs::HpkePrivateKey"]],["impl UnwindSafe for HpkeKeyPair",1,["hpke_rs::HpkeKeyPair"]],["impl UnwindSafe for Mode",1,["hpke_rs::Mode"]],["impl<Crypto> UnwindSafe for Context<Crypto>",1,["hpke_rs::Context"]],["impl<Crypto> UnwindSafe for Hpke<Crypto>",1,["hpke_rs::Hpke"]]]
+"hpke_rs":[["impl UnwindSafe for HpkeError",1,["hpke_rs::HpkeError"]],["impl UnwindSafe for HpkePublicKey",1,["hpke_rs::HpkePublicKey"]],["impl UnwindSafe for HpkePrivateKey",1,["hpke_rs::HpkePrivateKey"]],["impl UnwindSafe for HpkeKeyPair",1,["hpke_rs::HpkeKeyPair"]],["impl UnwindSafe for Mode",1,["hpke_rs::Mode"]],["impl<Crypto> UnwindSafe for Context<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: UnwindSafe,",1,["hpke_rs::Context"]],["impl<Crypto> UnwindSafe for Hpke<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: UnwindSafe,",1,["hpke_rs::Hpke"]]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/serde/de/trait.Deserialize.js b/implementors/serde/de/trait.Deserialize.js
index d9a25b3..00387dc 100644
--- a/implementors/serde/de/trait.Deserialize.js
+++ b/implementors/serde/de/trait.Deserialize.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl<'de> Deserialize<'de> for HpkePublicKey"],["impl<'de> Deserialize<'de> for HpkePrivateKey"],["impl<'de> Deserialize<'de> for Mode"],["impl<'de> Deserialize<'de> for HpkeKeyPair"]]
+"hpke_rs":[["impl<'de> Deserialize<'de> for HpkeKeyPair"],["impl<'de> Deserialize<'de> for Mode"],["impl<'de> Deserialize<'de> for HpkePublicKey"],["impl<'de> Deserialize<'de> for HpkePrivateKey"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/serde/ser/trait.Serialize.js b/implementors/serde/ser/trait.Serialize.js
index 81bb575..19adfce 100644
--- a/implementors/serde/ser/trait.Serialize.js
+++ b/implementors/serde/ser/trait.Serialize.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl Serialize for Mode"],["impl Serialize for HpkePublicKey"],["impl Serialize for HpkePrivateKey"],["impl Serialize for HpkeKeyPair"]]
+"hpke_rs":[["impl Serialize for HpkeKeyPair"],["impl Serialize for HpkePrivateKey"],["impl Serialize for Mode"],["impl Serialize for HpkePublicKey"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/tls_codec/trait.Deserialize.js b/implementors/tls_codec/trait.Deserialize.js
index 7555aa8..606c95c 100644
--- a/implementors/tls_codec/trait.Deserialize.js
+++ b/implementors/tls_codec/trait.Deserialize.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl Deserialize for HpkePublicKey"],["impl Deserialize for &HpkePublicKey"]]
+"hpke_rs":[["impl Deserialize for &HpkePublicKey"],["impl Deserialize for HpkePublicKey"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/tls_codec/trait.Serialize.js b/implementors/tls_codec/trait.Serialize.js
index bcc076f..fa96398 100644
--- a/implementors/tls_codec/trait.Serialize.js
+++ b/implementors/tls_codec/trait.Serialize.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl Serialize for &HpkePublicKey"],["impl Serialize for HpkePublicKey"]]
+"hpke_rs":[["impl Serialize for HpkePublicKey"],["impl Serialize for &HpkePublicKey"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/search-index.js b/search-index.js
index 7292a68..e8bd321 100644
--- a/search-index.js
+++ b/search-index.js
@@ -1,5 +1,5 @@
var searchIndex = JSON.parse('{\
-"hpke_rs":{"doc":"HPKE","t":"NNNDNGGGDEDDDNNNNNNNNENNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLALLLLLLLLLLLLLALLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLQCIKFFFF","n":["Auth","AuthPsk","Base","Context","CryptoError","HPKEKeyPair","HPKEPrivateKey","HPKEPublicKey","Hpke","HpkeError","HpkeKeyPair","HpkePrivateKey","HpkePublicKey","InconsistentPsk","InsecurePsk","InsufficientRandomness","InvalidConfig","InvalidInput","LockPoisoned","MessageLimitReached","MissingPsk","Mode","OpenError","Psk","UnknownMode","UnnecessaryPsk","as_slice","as_slice","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","default","default","default","derive_key_pair","deserialize","deserialize","deserialize","deserialize","eq","eq","eq","eq","export","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from_keys","generate_key_pair","into","into","into","into","into","into","into","into_keys","key_schedule","new","new","new","new","open","open","prelude","private_key","public_key","receiver_export","seal","seal","seed","send_export","serialize","serialize","serialize","serialize","setup_receiver","setup_sender","test_util","tls_deserialize","tls_deserialize","tls_serialize","tls_serialize","tls_serialized_len","tls_serialized_len","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","zeroize","Error","HpkeMode","TryFrom","try_from","bytes_to_hex","hex_to_bytes","hex_to_bytes_option","vec_to_option_slice"],"q":[[0,"hpke_rs"],[161,"hpke_rs::prelude"],[165,"hpke_rs::test_util"],[169,"hpke_rs_crypto"],[170,"core::result"],[171,"serde::de"],[172,"alloc::vec"],[173,"core::fmt"],[174,"core::fmt"],[175,"hpke_rs_crypto::types"],[176,"hpke_rs_crypto::types"],[177,"serde::ser"],[178,"tls_codec"],[179,"std::io"],[180,"std::io"],[181,"core::any"]],"d":["Authenticated HPKE.","Authenticated HPKE with PSK.","HPKE Base mode.","The HPKE context. Note that the RFC currently doesn’t …","An error in the crypto library occurred.","","","","The HPKE configuration struct. This holds the …","HPKE Error types.","An HPKE key pair has an HPKE private and public key.","An HPKE private key is a byte vector.","An HPKE public key is a byte vector.","Inconsistent PSK input.","PSK input is too short (needs to be at least 32 bytes).","Unable to collect enough randomness.","Invalid configuration or arguments.","Invalid input.","A concurrency issue with an RwLock
.","The message limit for this AEAD, key, and nonce.","PSK input is required but missing.","HPKE supports four modes.","Error opening an HPKE ciphertext.","HPKE with PSK.","Unknown HPKE mode.","PSK input is provided but not needed.","Get the raw key as byte slice.","Get the raw key as byte slice.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","7.1.2. DeriveKeyPair Derive a key pair for the used KEM …","","","","","","","","","5.3. Secret Export","","","","","","","","","","","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","","","","Returns the argument unchanged.","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Build a key pair from two keys","Cryptographic Dependencies Randomized algorithm to …","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Split the key pair into the two keys","Creating the Encryption Context Generate the HPKE context …","Create a new HPKE public key. Consumes the public key …","Create a new HPKE private key. Consumes the private key …","Create a new HPKE key pair. Consumes the private and …","Set up the configuration for HPKE.","5.2. Encryption and Decryption","Single-Shot APIs 6.1. Encryption and DecryptionSingle shot …","Prelude for HPKE. Include this to get access to all the …","Get a reference to the HPKE private key of this key pair.","Get a reference to the HPKE public key of this key pair.","Single-Shot APIs 6.2. Secret ExportSingle shot API to …","5.2. Encryption and Decryption","Single-Shot APIs 6.1. Encryption and DecryptionSingle shot …","Set PRNG state for testing.","Single-Shot APIs 6.2. Secret ExportSingle shot API to …","","","","","Set up an HPKE receiver.","Set up an HPKE sender.","Test util module. Should be moved really.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","The type returned in the event of a conversion error.","","Simple and safe type conversions that may fail in a …","Performs the conversion.","Convert bytes
to a hex string.","Convert a hex string to a byte vector.","Convert a hex string to a byte vector. If the input is None
…","Convert a byte slice into byte slice option. Returns Nonce
…"],"i":[7,7,7,0,5,0,0,0,0,0,0,0,0,5,5,5,5,5,5,5,5,0,5,7,5,5,1,4,14,5,1,4,6,7,8,14,5,1,4,6,7,8,5,1,4,6,7,8,5,1,4,6,7,8,1,4,6,8,1,4,6,7,5,1,4,7,14,14,5,5,1,4,6,7,7,8,8,14,5,5,1,1,1,4,4,4,6,6,6,7,8,6,8,14,5,1,4,6,7,8,6,8,1,4,6,8,14,8,0,6,6,8,14,8,8,8,1,4,6,7,8,8,0,1,1,1,1,1,1,5,1,4,6,7,8,5,7,8,14,5,1,4,6,7,7,8,14,5,1,4,6,7,8,14,5,1,4,6,7,8,4,33,0,0,33,0,0,0,0],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[1,[[3,[2]]]],[4,[[3,[2]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[5,5],[1,1],[4,4],[6,6],[7,7],[[[8,[-1]]],[[8,[-1]]],9],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[],1],[[],4],[[],6],[[[8,[-1]],[3,[2]]],[[11,[6,5]]],9],[-1,[[11,[1]]],12],[-1,[[11,[4]]],12],[-1,[[11,[6]]],12],[-1,[[11,[7]]],12],[[5,5],13],[[1,1],13],[[4,4],13],[[7,7],13],[[[14,[-1]],[3,[2]],15],[[11,[[16,[2]],5]]],9],[[[14,[-1]],17],18,9],[[5,17],18],[[5,17],18],[[1,17],18],[[4,17],[[11,[10,19]]]],[[6,17],18],[[7,17],18],[[7,17],18],[[[8,[-1]],17],18,9],[[[8,[-1]],17],18,[20,9]],[-1,-1,[]],[21,5],[-1,-1,[]],[-1,-1,[]],[[[16,[2]]],1],[[[3,[2]]],1],[[[3,[2]]],4],[-1,-1,[]],[[[16,[2]]],4],[[[10,[[16,[2]],[16,[2]]]]],6],[[[10,[[3,[2]],[3,[2]]]]],6],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[[4,1],6],[[[8,[-1]]],[[11,[6,5]]],9],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[6,[[10,[4,1]]]],[[[8,[-1]],[3,[2]],[3,[2]],[3,[2]],[3,[2]]],[[11,[[14,[-1]],5]]],9],[[[16,[2]]],1],[[[16,[2]]],4],[[[16,[2]],[16,[2]]],6],[[7,22,23,24],[[8,[-1]]],9],[[[14,[-1]],[3,[2]],[3,[2]]],[[11,[[16,[2]],5]]],9],[[[8,[-1]],[3,[2]],4,[3,[2]],[3,[2]],[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[1]]],[[11,[[16,[2]],5]]],9],0,[6,4],[6,1],[[[8,[-1]],[3,[2]],4,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[1]],[3,[2]],15],[[11,[[16,[2]],5]]],9],[[[14,[-1]],[3,[2]],[3,[2]]],[[11,[[16,[2]],5]]],9],[[[8,[-1]],1,[3,[2]],[3,[2]],[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[4]]],[[11,[[10,[[16,[2]],[16,[2]]]],5]]],9],[[[8,[-1]],[3,[2]]],[[11,[10,5]]],9],[[[8,[-1]],1,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[4]],[3,[2]],15],[[11,[[10,[[16,[2]],[16,[2]]]],5]]],9],[[1,-1],11,26],[[4,-1],11,26],[[6,-1],11,26],[[7,-1],11,26],[[[8,[-1]],[3,[2]],4,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[1]]],[[11,[[14,[-1]],5]]],9],[[[8,[-1]],1,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[4]]],[[11,[[10,[[16,[2]],[14,[-1]]]],5]]],9],0,[-1,[[11,[1,27]]],28],[-1,[[11,[1,27]]],28],[[1,-1],[[11,[15,27]]],29],[[1,-1],[[11,[15,27]]],29],[1,15],[1,15],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,30,[]],[-1,30,[]],[-1,30,[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[2,[[11,[7,5]]]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[4,10],0,0,0,[-1,[[11,[-2]]],[],[]],[[[3,[2]]],30],[32,[[16,[2]]]],[[[25,[30]]],[[16,[2]]]],[[[3,[2]]],[[25,[[3,[2]]]]]]],"c":[5,6,7],"p":[[3,"HpkePublicKey",0],[15,"u8"],[15,"slice"],[3,"HpkePrivateKey",0],[4,"HpkeError",0],[3,"HpkeKeyPair",0],[4,"Mode",0],[3,"Hpke",0],[8,"HpkeCrypto",169],[15,"tuple"],[4,"Result",170],[8,"Deserializer",171],[15,"bool"],[3,"Context",0],[15,"usize"],[3,"Vec",172],[3,"Formatter",173],[6,"Result",173],[3,"Error",173],[8,"Debug",173],[4,"Error",174],[4,"KemAlgorithm",175],[4,"KdfAlgorithm",175],[4,"AeadAlgorithm",175],[4,"Option",176],[8,"Serializer",177],[4,"Error",178],[8,"Read",179],[8,"Write",179],[3,"String",180],[3,"TypeId",181],[15,"str"],[8,"TryFrom",161]]}\
+"hpke_rs":{"doc":"HPKE","t":"NNNDNGGGDEDDDNNNNNNNENNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLALLLLLLLLLLLLLALLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLQCIKFFFF","n":["Auth","AuthPsk","Base","Context","CryptoError","HPKEKeyPair","HPKEPrivateKey","HPKEPublicKey","Hpke","HpkeError","HpkeKeyPair","HpkePrivateKey","HpkePublicKey","InconsistentPsk","InsecurePsk","InsufficientRandomness","InvalidConfig","InvalidInput","MessageLimitReached","MissingPsk","Mode","OpenError","Psk","UnknownMode","UnnecessaryPsk","as_slice","as_slice","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","default","default","default","derive_key_pair","deserialize","deserialize","deserialize","deserialize","eq","eq","eq","eq","export","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from_keys","generate_key_pair","into","into","into","into","into","into","into","into_keys","key_schedule","new","new","new","new","open","open","prelude","private_key","public_key","receiver_export","seal","seal","seed","send_export","serialize","serialize","serialize","serialize","setup_receiver","setup_sender","test_util","tls_deserialize","tls_deserialize","tls_serialize","tls_serialize","tls_serialized_len","tls_serialized_len","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","zeroize","Error","HpkeMode","TryFrom","try_from","bytes_to_hex","hex_to_bytes","hex_to_bytes_option","vec_to_option_slice"],"q":[[0,"hpke_rs"],[160,"hpke_rs::prelude"],[164,"hpke_rs::test_util"],[168,"hpke_rs_crypto"],[169,"core::result"],[170,"serde::de"],[171,"alloc::vec"],[172,"core::fmt"],[173,"core::fmt"],[174,"hpke_rs_crypto::types"],[175,"hpke_rs_crypto::types"],[176,"serde::ser"],[177,"tls_codec"],[178,"std::io"],[179,"std::io"],[180,"core::any"]],"d":["Authenticated HPKE.","Authenticated HPKE with PSK.","HPKE Base mode.","The HPKE context. Note that the RFC currently doesn’t …","An error in the crypto library occurred.","","","","The HPKE configuration struct. This holds the …","HPKE Error types.","An HPKE key pair has an HPKE private and public key.","An HPKE private key is a byte vector.","An HPKE public key is a byte vector.","Inconsistent PSK input.","PSK input is too short (needs to be at least 32 bytes).","Unable to collect enough randomness.","Invalid configuration or arguments.","Invalid input.","The message limit for this AEAD, key, and nonce.","PSK input is required but missing.","HPKE supports four modes.","Error opening an HPKE ciphertext.","HPKE with PSK.","Unknown HPKE mode.","PSK input is provided but not needed.","Get the raw key as byte slice.","Get the raw key as byte slice.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","7.1.2. DeriveKeyPair Derive a key pair for the used KEM …","","","","","","","","","5.3. Secret Export","","","","","","","","","","","Returns the argument unchanged.","","Returns the argument unchanged.","","","Returns the argument unchanged.","","Returns the argument unchanged.","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Build a key pair from two keys","Cryptographic Dependencies Randomized algorithm to …","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Split the key pair into the two keys","Creating the Encryption Context Generate the HPKE context …","Create a new HPKE public key. Consumes the public key …","Create a new HPKE private key. Consumes the private key …","Create a new HPKE key pair. Consumes the private and …","Set up the configuration for HPKE.","5.2. Encryption and Decryption","Single-Shot APIs 6.1. Encryption and DecryptionSingle shot …","Prelude for HPKE. Include this to get access to all the …","Get a reference to the HPKE private key of this key pair.","Get a reference to the HPKE public key of this key pair.","Single-Shot APIs 6.2. Secret ExportSingle shot API to …","5.2. Encryption and Decryption","Single-Shot APIs 6.1. Encryption and DecryptionSingle shot …","Set PRNG state for testing.","Single-Shot APIs 6.2. Secret ExportSingle shot API to …","","","","","Set up an HPKE receiver.","Set up an HPKE sender.","Test util module. Should be moved really.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","The type returned in the event of a conversion error.","","Simple and safe type conversions that may fail in a …","Performs the conversion.","Convert bytes
to a hex string.","Convert a hex string to a byte vector.","Convert a hex string to a byte vector. If the input is None
…","Convert a byte slice into byte slice option. Returns Nonce
…"],"i":[7,7,7,0,5,0,0,0,0,0,0,0,0,5,5,5,5,5,5,5,0,5,7,5,5,1,4,14,5,1,4,6,7,8,14,5,1,4,6,7,8,5,1,4,6,7,8,5,1,4,6,7,8,1,4,6,8,1,4,6,7,5,1,4,7,14,14,5,5,1,4,6,7,7,8,8,14,5,5,1,1,1,4,4,4,6,6,6,7,8,6,8,14,5,1,4,6,7,8,6,8,1,4,6,8,14,8,0,6,6,8,14,8,8,8,1,4,6,7,8,8,0,1,1,1,1,1,1,5,1,4,6,7,8,5,7,8,14,5,1,4,6,7,7,8,14,5,1,4,6,7,8,14,5,1,4,6,7,8,4,33,0,0,33,0,0,0,0],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[1,[[3,[2]]]],[4,[[3,[2]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[5,5],[1,1],[4,4],[6,6],[7,7],[[[8,[-1]]],[[8,[-1]]],9],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[],1],[[],4],[[],6],[[[8,[-1]],[3,[2]]],[[11,[6,5]]],9],[-1,[[11,[1]]],12],[-1,[[11,[4]]],12],[-1,[[11,[6]]],12],[-1,[[11,[7]]],12],[[5,5],13],[[1,1],13],[[4,4],13],[[7,7],13],[[[14,[-1]],[3,[2]],15],[[11,[[16,[2]],5]]],9],[[[14,[-1]],17],18,9],[[5,17],18],[[5,17],18],[[1,17],18],[[4,17],[[11,[10,19]]]],[[6,17],18],[[7,17],18],[[7,17],18],[[[8,[-1]],17],18,9],[[[8,[-1]],17],18,[20,9]],[-1,-1,[]],[21,5],[-1,-1,[]],[[[16,[2]]],1],[[[3,[2]]],1],[-1,-1,[]],[[[3,[2]]],4],[-1,-1,[]],[[[16,[2]]],4],[[[10,[[3,[2]],[3,[2]]]]],6],[[[10,[[16,[2]],[16,[2]]]]],6],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[[4,1],6],[[[8,[-1]]],[[11,[6,5]]],9],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[6,[[10,[4,1]]]],[[[8,[-1]],[3,[2]],[3,[2]],[3,[2]],[3,[2]]],[[11,[[14,[-1]],5]]],9],[[[16,[2]]],1],[[[16,[2]]],4],[[[16,[2]],[16,[2]]],6],[[7,22,23,24],[[8,[-1]]],9],[[[14,[-1]],[3,[2]],[3,[2]]],[[11,[[16,[2]],5]]],9],[[[8,[-1]],[3,[2]],4,[3,[2]],[3,[2]],[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[1]]],[[11,[[16,[2]],5]]],9],0,[6,4],[6,1],[[[8,[-1]],[3,[2]],4,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[1]],[3,[2]],15],[[11,[[16,[2]],5]]],9],[[[14,[-1]],[3,[2]],[3,[2]]],[[11,[[16,[2]],5]]],9],[[[8,[-1]],1,[3,[2]],[3,[2]],[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[4]]],[[11,[[10,[[16,[2]],[16,[2]]]],5]]],9],[[[8,[-1]],[3,[2]]],[[11,[10,5]]],9],[[[8,[-1]],1,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[4]],[3,[2]],15],[[11,[[10,[[16,[2]],[16,[2]]]],5]]],9],[[1,-1],11,26],[[4,-1],11,26],[[6,-1],11,26],[[7,-1],11,26],[[[8,[-1]],[3,[2]],4,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[1]]],[[11,[[14,[-1]],5]]],9],[[[8,[-1]],1,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[4]]],[[11,[[10,[[16,[2]],[14,[-1]]]],5]]],9],0,[-1,[[11,[1,27]]],28],[-1,[[11,[1,27]]],28],[[1,-1],[[11,[15,27]]],29],[[1,-1],[[11,[15,27]]],29],[1,15],[1,15],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,30,[]],[-1,30,[]],[-1,30,[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[2,[[11,[7,5]]]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[4,10],0,0,0,[-1,[[11,[-2]]],[],[]],[[[3,[2]]],30],[32,[[16,[2]]]],[[[25,[30]]],[[16,[2]]]],[[[3,[2]]],[[25,[[3,[2]]]]]]],"c":[5,6,7],"p":[[3,"HpkePublicKey",0],[15,"u8"],[15,"slice"],[3,"HpkePrivateKey",0],[4,"HpkeError",0],[3,"HpkeKeyPair",0],[4,"Mode",0],[3,"Hpke",0],[8,"HpkeCrypto",168],[15,"tuple"],[4,"Result",169],[8,"Deserializer",170],[15,"bool"],[3,"Context",0],[15,"usize"],[3,"Vec",171],[3,"Formatter",172],[6,"Result",172],[3,"Error",172],[8,"Debug",172],[4,"Error",173],[4,"KemAlgorithm",174],[4,"KdfAlgorithm",174],[4,"AeadAlgorithm",174],[4,"Option",175],[8,"Serializer",176],[4,"Error",177],[8,"Read",178],[8,"Write",178],[3,"String",179],[3,"TypeId",180],[15,"str"],[8,"TryFrom",160]]}\
}');
if (typeof window !== 'undefined' && window.initSearch) {window.initSearch(searchIndex)};
if (typeof exports !== 'undefined') {exports.searchIndex = searchIndex};
diff --git a/src/hpke_rs/dh_kem.rs.html b/src/hpke_rs/dh_kem.rs.html
index 76d229d..e626cdb 100644
--- a/src/hpke_rs/dh_kem.rs.html
+++ b/src/hpke_rs/dh_kem.rs.html
@@ -175,9 +175,13 @@
175
176
177
+178
+179
//! DH KEM as described in §4.1. DH-Based KEM.
-use hpke_rs_crypto::{error::Error, types::KemAlgorithm, HpkeCrypto};
+use alloc::{string::ToString, vec::Vec};
+
+use hpke_rs_crypto::{error::Error, types::KemAlgorithm, HpkeCrypto};
use crate::util::*;
use crate::{
diff --git a/src/hpke_rs/kdf.rs.html b/src/hpke_rs/kdf.rs.html
index e71827a..63956d6 100644
--- a/src/hpke_rs/kdf.rs.html
+++ b/src/hpke_rs/kdf.rs.html
@@ -28,7 +28,11 @@
28
29
30
-
use hpke_rs_crypto::{error::Error, types::KdfAlgorithm, HpkeCrypto};
+31
+32
+
use alloc::vec::Vec;
+
+use hpke_rs_crypto::{error::Error, types::KdfAlgorithm, HpkeCrypto};
use crate::util::concat;
diff --git a/src/hpke_rs/kem.rs.html b/src/hpke_rs/kem.rs.html
index 3fbf089..e860613 100644
--- a/src/hpke_rs/kem.rs.html
+++ b/src/hpke_rs/kem.rs.html
@@ -97,7 +97,11 @@
97
98
99
-
use hpke_rs_crypto::{error::Error, types::KemAlgorithm, HpkeCrypto};
+100
+101
+
use alloc::vec::Vec;
+
+use hpke_rs_crypto::{error::Error, types::KemAlgorithm, HpkeCrypto};
use crate::dh_kem;
use crate::util;
diff --git a/src/hpke_rs/lib.rs.html b/src/hpke_rs/lib.rs.html
index e14bd4b..18ff4d7 100644
--- a/src/hpke_rs/lib.rs.html
+++ b/src/hpke_rs/lib.rs.html
@@ -994,6 +994,14 @@
994
995
996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
#![doc = include_str!("../Readme.md")]
#![forbid(unsafe_code, unused_must_use, unstable_features)]
#![deny(
@@ -1004,8 +1012,18 @@
unused_extern_crates,
unused_qualifications
)]
+#![cfg_attr(not(test), no_std)]
-use std::sync::RwLock;
+extern crate alloc;
+#[cfg(feature = "std")]
+extern crate std;
+
+use alloc::{
+ format,
+ string::{String, ToString},
+ vec,
+ vec::Vec,
+};
#[cfg(feature = "hpke-test-prng")]
use hpke_rs_crypto::HpkeTestRng;
@@ -1075,15 +1093,13 @@
/// Unable to collect enough randomness.
InsufficientRandomness,
-
- /// A concurrency issue with an [`RwLock`].
- LockPoisoned,
}
-impl std::error::Error for HpkeError {}
+#[cfg(feature = "std")]
+impl std::error::Error for HpkeError {}
-impl std::fmt::Display for HpkeError {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+impl core::fmt::Display for HpkeError {
+ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "HPKE Error: {:?}", self)
}
}
@@ -1155,8 +1171,8 @@
AuthPsk = 0x03,
}
-impl std::fmt::Display for Mode {
- fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+impl core::fmt::Display for Mode {
+ fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
write!(f, "{:?}", self)
}
}
@@ -1198,8 +1214,8 @@
}
#[cfg(feature = "hazmat")]
-impl<Crypto: HpkeCrypto> std::fmt::Debug for Context<Crypto> {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+impl<Crypto: HpkeCrypto> core::fmt::Debug for Context<Crypto> {
+ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(
f,
"Context {{\n key: {:?}\n nonce: {:?}\n exporter_secret: {:?}\n seq no: {:?}\n}}",
@@ -1209,8 +1225,8 @@
}
#[cfg(not(feature = "hazmat"))]
-impl<Crypto: HpkeCrypto> std::fmt::Debug for Context<Crypto> {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+impl<Crypto: HpkeCrypto> core::fmt::Debug for Context<Crypto> {
+ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(
f,
"Context {{\n key: {:?}\n nonce: {:?}\n exporter_secret: {:?}\n seq no: {:?}\n}}",
@@ -1327,7 +1343,7 @@
kem_id: KemAlgorithm,
kdf_id: KdfAlgorithm,
aead_id: AeadAlgorithm,
- prng: RwLock<Crypto::HpkePrng>,
+ prng: Crypto::HpkePrng,
}
impl<Crypto: 'static + HpkeCrypto> Clone for Hpke<Crypto> {
@@ -1337,13 +1353,13 @@
kem_id: self.kem_id,
kdf_id: self.kdf_id,
aead_id: self.aead_id,
- prng: RwLock::new(Crypto::prng()),
+ prng: Crypto::prng(),
}
}
}
-impl<Crypto: HpkeCrypto> std::fmt::Display for Hpke<Crypto> {
- fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+impl<Crypto: HpkeCrypto> core::fmt::Display for Hpke<Crypto> {
+ fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
write!(
f,
"{}_{}_{}_{}",
@@ -1368,7 +1384,7 @@
kem_id,
kdf_id,
aead_id,
- prng: RwLock::new(Crypto::prng()),
+ prng: Crypto::prng(),
}
}
@@ -1387,7 +1403,7 @@
/// The encapsulated secret is returned together with the context.
/// If the secret key is missing in an authenticated mode, an error is returned.
pub fn setup_sender(
- &self,
+ &mut self,
pk_r: &HpkePublicKey,
info: &[u8],
psk: Option<&[u8]>,
@@ -1474,7 +1490,7 @@
/// Returns the encapsulated secret and the ciphertext, or an error.
#[allow(clippy::too_many_arguments)]
pub fn seal(
- &self,
+ &mut self,
pk_r: &HpkePublicKey,
info: &[u8],
aad: &[u8],
@@ -1530,7 +1546,7 @@
/// exporter context and length.
#[allow(clippy::too_many_arguments)]
pub fn send_export(
- &self,
+ &mut self,
pk_r: &HpkePublicKey,
info: &[u8],
psk: Option<&[u8]>,
@@ -1670,9 +1686,8 @@
/// This is equivalent to `derive_key_pair(random_vector(sk.len()))`
///
/// Returns an `HpkeKeyPair`.
- pub fn generate_key_pair(&self) -> Result<HpkeKeyPair, HpkeError> {
- let mut prng = self.prng.write().map_err(|_| HpkeError::LockPoisoned)?;
- let (sk, pk) = kem::key_gen::<Crypto>(self.kem_id, &mut prng)?;
+ pub fn generate_key_pair(&mut self) -> Result<HpkeKeyPair, HpkeError> {
+ let (sk, pk) = kem::key_gen::<Crypto>(self.kem_id, &mut self.prng)?;
Ok(HpkeKeyPair::new(sk, pk))
}
@@ -1686,8 +1701,8 @@
}
#[inline]
- pub(crate) fn random(&self, len: usize) -> Result<Vec<u8>, HpkeError> {
- let mut prng = self.prng.write().map_err(|_| HpkeError::LockPoisoned)?;
+ pub(crate) fn random(&mut self, len: usize) -> Result<Vec<u8>, HpkeError> {
+ let prng = &mut self.prng;
let mut out = vec![0u8; len];
#[cfg(feature = "hpke-test-prng")]
@@ -1790,8 +1805,8 @@
}
#[cfg(not(feature = "hazmat"))]
-impl std::fmt::Debug for HpkePrivateKey {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
+impl core::fmt::Debug for HpkePrivateKey {
+ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> Result<(), core::fmt::Error> {
f.debug_struct("HpkePrivateKey")
.field("value", &"***")
.finish()
@@ -1799,8 +1814,8 @@
}
#[cfg(feature = "hazmat")]
-impl std::fmt::Debug for HpkePrivateKey {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
+impl core::fmt::Debug for HpkePrivateKey {
+ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> Result<(), core::fmt::Error> {
f.debug_struct("HpkePrivateKey")
.field("value", &self.value)
.finish()
@@ -1887,14 +1902,15 @@
/// Test util module. Should be moved really.
#[cfg(feature = "hpke-test")]
pub mod test_util {
+ use alloc::{format, string::String, vec, vec::Vec};
+
use crate::HpkeError;
use hpke_rs_crypto::{HpkeCrypto, HpkeTestRng};
impl<Crypto: HpkeCrypto> super::Hpke<Crypto> {
/// Set PRNG state for testing.
- pub fn seed(&self, seed: &[u8]) -> Result<(), HpkeError> {
- let mut prng = self.prng.write().map_err(|_| HpkeError::LockPoisoned)?;
- prng.seed(seed);
+ pub fn seed(&mut self, seed: &[u8]) -> Result<(), HpkeError> {
+ self.prng.seed(seed);
Ok(())
}
}
diff --git a/src/hpke_rs/prelude.rs.html b/src/hpke_rs/prelude.rs.html
index dd7776a..41db4f7 100644
--- a/src/hpke_rs/prelude.rs.html
+++ b/src/hpke_rs/prelude.rs.html
@@ -7,5 +7,5 @@
//! Include this to get access to all the public functions of HPKE.
pub use super::{Mode as HpkeMode, *};
-pub use std::convert::TryFrom;
+pub use core::convert::TryFrom;
\ No newline at end of file
diff --git a/src/hpke_rs/util.rs.html b/src/hpke_rs/util.rs.html
index 5e150a7..f3a73c0 100644
--- a/src/hpke_rs/util.rs.html
+++ b/src/hpke_rs/util.rs.html
@@ -19,7 +19,11 @@
19
20
21
-#[inline]
+22
+23
+
use alloc::vec::Vec;
+
+#[inline]
pub(crate) fn concat(values: &[&[u8]]) -> Vec<u8> {
values.join(&[][..])
}
impl<T> BorrowMut<T> for Twhere
diff --git a/hpke_rs/struct.HpkePublicKey.html b/hpke_rs/struct.HpkePublicKey.html
index fac3457..d162776 100644
--- a/hpke_rs/struct.HpkePublicKey.html
+++ b/hpke_rs/struct.HpkePublicKey.html
@@ -1,20 +1,20 @@
-HpkePublicKey in hpke_rs - Rust Struct hpke_rs::HpkePublicKey
source · pub struct HpkePublicKey { /* private fields */ }
Expand description
An HPKE public key is a byte vector.
-Implementations§
source§impl HpkePublicKey
sourcepub fn new(value: Vec<u8>) -> Self
Create a new HPKE public key.
+
HpkePublicKey in hpke_rs - Rust Struct hpke_rs::HpkePublicKey
source · pub struct HpkePublicKey { /* private fields */ }
Expand description
An HPKE public key is a byte vector.
+Implementations§
Trait Implementations§
source§impl Clone for HpkePublicKey
source§fn clone(&self) -> HpkePublicKey
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkePublicKey
source§impl Default for HpkePublicKey
source§fn default() -> HpkePublicKey
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkePublicKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Deserialize for &HpkePublicKey
source§fn tls_deserialize<R: Read>(_: &mut R) -> Result<Self, Error>
This function deserializes the bytes
from the provided a std::io::Read
-and returns the populated struct. Read moresource§impl Deserialize for HpkePublicKey
Trait Implementations§
source§impl Clone for HpkePublicKey
source§fn clone(&self) -> HpkePublicKey
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkePublicKey
source§impl Default for HpkePublicKey
source§fn default() -> HpkePublicKey
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkePublicKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Deserialize for &HpkePublicKey
source§fn tls_deserialize<R: Read>(_: &mut R) -> Result<Self, Error>
This function deserializes the bytes
from the provided a std::io::Read
and returns the populated struct. Read moresource§impl From<&[u8]> for HpkePublicKey
source§impl PartialEq<HpkePublicKey> for HpkePublicKey
source§impl Deserialize for HpkePublicKey
source§fn tls_deserialize<R: Read>(bytes: &mut R) -> Result<Self, Error>
This function deserializes the bytes
from the provided a std::io::Read
+and returns the populated struct. Read moresource§impl From<&[u8]> for HpkePublicKey
source§impl PartialEq<HpkePublicKey> for HpkePublicKey
source§fn eq(&self, other: &HpkePublicKey) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
.source§impl Serialize for &HpkePublicKey
source§impl Serialize for HpkePublicKey
source§impl Serialize for HpkePublicKey
source§impl Size for &HpkePublicKey
source§fn tls_serialized_len(&self) -> usize
source§impl Size for HpkePublicKey
source§fn tls_serialized_len(&self) -> usize
source§impl StructuralPartialEq for HpkePublicKey
Auto Trait Implementations§
§impl RefUnwindSafe for HpkePublicKey
§impl Send for HpkePublicKey
§impl Sync for HpkePublicKey
§impl Unpin for HpkePublicKey
§impl UnwindSafe for HpkePublicKey
Blanket Implementations§
source§impl Serialize for &HpkePublicKey
source§impl Serialize for HpkePublicKey
source§impl Serialize for HpkePublicKey
source§impl Size for &HpkePublicKey
source§fn tls_serialized_len(&self) -> usize
source§impl Size for HpkePublicKey
source§fn tls_serialized_len(&self) -> usize
source§impl StructuralPartialEq for HpkePublicKey
Auto Trait Implementations§
§impl RefUnwindSafe for HpkePublicKey
§impl Send for HpkePublicKey
§impl Sync for HpkePublicKey
§impl Unpin for HpkePublicKey
§impl UnwindSafe for HpkePublicKey
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moresource§impl<T> From<T> for T
source§fn from(t: T) -> T
Returns the argument unchanged.
diff --git a/hpke_rs/test_util/fn.bytes_to_hex.html b/hpke_rs/test_util/fn.bytes_to_hex.html
index c47028a..a04498e 100644
--- a/hpke_rs/test_util/fn.bytes_to_hex.html
+++ b/hpke_rs/test_util/fn.bytes_to_hex.html
@@ -1,2 +1,2 @@
-bytes_to_hex in hpke_rs::test_util - Rust Function hpke_rs::test_util::bytes_to_hex
source · pub fn bytes_to_hex(bytes: &[u8]) -> String
Expand description
Convert bytes
to a hex string.
+bytes_to_hex in hpke_rs::test_util - Rust
\ No newline at end of file
diff --git a/hpke_rs/test_util/fn.hex_to_bytes.html b/hpke_rs/test_util/fn.hex_to_bytes.html
index 84e2f6e..9cc1035 100644
--- a/hpke_rs/test_util/fn.hex_to_bytes.html
+++ b/hpke_rs/test_util/fn.hex_to_bytes.html
@@ -1,2 +1,2 @@
-hex_to_bytes in hpke_rs::test_util - Rust Function hpke_rs::test_util::hex_to_bytes
source · pub fn hex_to_bytes(hex: &str) -> Vec<u8>
Expand description
Convert a hex string to a byte vector.
+hex_to_bytes in hpke_rs::test_util - Rust
\ No newline at end of file
diff --git a/hpke_rs/test_util/fn.hex_to_bytes_option.html b/hpke_rs/test_util/fn.hex_to_bytes_option.html
index 7240995..d0bf887 100644
--- a/hpke_rs/test_util/fn.hex_to_bytes_option.html
+++ b/hpke_rs/test_util/fn.hex_to_bytes_option.html
@@ -1,3 +1,3 @@
-hex_to_bytes_option in hpke_rs::test_util - Rust Function hpke_rs::test_util::hex_to_bytes_option
source · pub fn hex_to_bytes_option(hex: Option<String>) -> Vec<u8>
Expand description
Convert a hex string to a byte vector.
+
hex_to_bytes_option in hpke_rs::test_util - Rust
\ No newline at end of file
diff --git a/hpke_rs/test_util/fn.vec_to_option_slice.html b/hpke_rs/test_util/fn.vec_to_option_slice.html
index bb11c70..5ddbf28 100644
--- a/hpke_rs/test_util/fn.vec_to_option_slice.html
+++ b/hpke_rs/test_util/fn.vec_to_option_slice.html
@@ -1,3 +1,3 @@
-vec_to_option_slice in hpke_rs::test_util - Rust Function hpke_rs::test_util::vec_to_option_slice
source · pub fn vec_to_option_slice(v: &[u8]) -> Option<&[u8]>
Expand description
Convert a byte slice into byte slice option.
+
vec_to_option_slice in hpke_rs::test_util - Rust
\ No newline at end of file
diff --git a/hpke_rs/test_util/index.html b/hpke_rs/test_util/index.html
index 301a0d6..c48a151 100644
--- a/hpke_rs/test_util/index.html
+++ b/hpke_rs/test_util/index.html
@@ -1,4 +1,4 @@
-hpke_rs::test_util - Rust Expand description
Test util module. Should be moved really.
+hpke_rs::test_util - Rust Expand description
Test util module. Should be moved really.
Functions
- Convert
bytes
to a hex string. - Convert a hex string to a byte vector.
- Convert a hex string to a byte vector.
If the input is
None
, this returns an empty vector. - Convert a byte slice into byte slice option.
Returns
Nonce
if the byte slice is empty and Some(v)
otherwise.
\ No newline at end of file
diff --git a/hpke_rs/type.HPKEKeyPair.html b/hpke_rs/type.HPKEKeyPair.html
index 9a9f9de..e10b94e 100644
--- a/hpke_rs/type.HPKEKeyPair.html
+++ b/hpke_rs/type.HPKEKeyPair.html
@@ -1,9 +1,9 @@
-HPKEKeyPair in hpke_rs - Rust Type Alias hpke_rs::HPKEKeyPair
source · pub type HPKEKeyPair = HpkeKeyPair;
👎Deprecated since 0.0.7: Please use HpkeKeyPair instead. This alias will be removed with the first stable 0.1 release.Aliased Type§
struct HPKEKeyPair { /* private fields */ }
Implementations§
source§impl HpkeKeyPair
sourcepub fn new(sk: Vec<u8>, pk: Vec<u8>) -> Self
Create a new HPKE key pair.
+
HPKEKeyPair in hpke_rs - Rust Type Alias hpke_rs::HPKEKeyPair
source · pub type HPKEKeyPair = HpkeKeyPair;
👎Deprecated since 0.0.7: Please use HpkeKeyPair instead. This alias will be removed with the first stable 0.1 release.Aliased Type§
struct HPKEKeyPair { /* private fields */ }
Implementations§
source§impl HpkeKeyPair
sourcepub fn new(sk: Vec<u8>, pk: Vec<u8>) -> Self
Create a new HPKE key pair.
Consumes the private and public key bytes.
-sourcepub fn private_key(&self) -> &HpkePrivateKey
Get a reference to the HPKE private key of this key pair.
-sourcepub fn public_key(&self) -> &HpkePublicKey
Get a reference to the HPKE public key of this key pair.
-sourcepub fn into_keys(self) -> (HpkePrivateKey, HpkePublicKey)
Split the key pair into the two keys
-sourcepub fn from_keys(private_key: HpkePrivateKey, public_key: HpkePublicKey) -> Self
Build a key pair from two keys
-Trait Implementations§
source§impl Clone for HpkeKeyPair
source§fn clone(&self) -> HpkeKeyPair
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkeKeyPair
source§impl Default for HpkeKeyPair
source§fn default() -> HpkeKeyPair
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkeKeyPair
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Serialize for HpkeKeyPair
sourcepub fn private_key(&self) -> &HpkePrivateKey
Get a reference to the HPKE private key of this key pair.
+sourcepub fn public_key(&self) -> &HpkePublicKey
Get a reference to the HPKE public key of this key pair.
+sourcepub fn into_keys(self) -> (HpkePrivateKey, HpkePublicKey)
Split the key pair into the two keys
+sourcepub fn from_keys(private_key: HpkePrivateKey, public_key: HpkePublicKey) -> Self
Build a key pair from two keys
+Trait Implementations§
source§impl Clone for HpkeKeyPair
source§fn clone(&self) -> HpkeKeyPair
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkeKeyPair
source§impl Default for HpkeKeyPair
source§fn default() -> HpkeKeyPair
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkeKeyPair
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
\ No newline at end of file
diff --git a/hpke_rs/type.HPKEPrivateKey.html b/hpke_rs/type.HPKEPrivateKey.html
index 44660f2..c21fe66 100644
--- a/hpke_rs/type.HPKEPrivateKey.html
+++ b/hpke_rs/type.HPKEPrivateKey.html
@@ -1,11 +1,11 @@
-HPKEPrivateKey in hpke_rs - Rust Type Alias hpke_rs::HPKEPrivateKey
source · pub type HPKEPrivateKey = HpkePrivateKey;
👎Deprecated since 0.0.7: Please use HpkePrivateKey instead. This alias will be removed with the first stable 0.1 release.Aliased Type§
struct HPKEPrivateKey { /* private fields */ }
Implementations§
source§impl HpkePrivateKey
sourcepub fn new(b: Vec<u8>) -> Self
Create a new HPKE private key.
+
HPKEPrivateKey in hpke_rs - Rust Type Alias hpke_rs::HPKEPrivateKey
source · pub type HPKEPrivateKey = HpkePrivateKey;
👎Deprecated since 0.0.7: Please use HpkePrivateKey instead. This alias will be removed with the first stable 0.1 release.Aliased Type§
struct HPKEPrivateKey { /* private fields */ }
Implementations§
Trait Implementations§
source§impl Clone for HpkePrivateKey
source§fn clone(&self) -> HpkePrivateKey
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkePrivateKey
source§impl Default for HpkePrivateKey
source§fn default() -> HpkePrivateKey
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkePrivateKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<&[u8]> for HpkePrivateKey
source§impl PartialEq<HpkePrivateKey> for HpkePrivateKey
Hopefully constant time comparison of the two values as long as they have the
+
Trait Implementations§
source§impl Clone for HpkePrivateKey
source§fn clone(&self) -> HpkePrivateKey
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkePrivateKey
source§impl Default for HpkePrivateKey
source§fn default() -> HpkePrivateKey
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkePrivateKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl From<&[u8]> for HpkePrivateKey
source§impl PartialEq<HpkePrivateKey> for HpkePrivateKey
Hopefully constant time comparison of the two values as long as they have the
same length.
-source§fn eq(&self, other: &Self) -> bool
This method tests for self
and other
values to be equal, and is used
+source§impl Serialize for HpkePrivateKey
source§impl Zeroize for HpkePrivateKey
source§impl Serialize for HpkePrivateKey
\ No newline at end of file
diff --git a/hpke_rs/type.HPKEPublicKey.html b/hpke_rs/type.HPKEPublicKey.html
index 44dc41a..81d662f 100644
--- a/hpke_rs/type.HPKEPublicKey.html
+++ b/hpke_rs/type.HPKEPublicKey.html
@@ -1,12 +1,12 @@
-HPKEPublicKey in hpke_rs - Rust Type Alias hpke_rs::HPKEPublicKey
source · pub type HPKEPublicKey = HpkePublicKey;
👎Deprecated since 0.0.7: Please use HpkePublicKey instead. This alias will be removed with the first stable 0.1 release.Aliased Type§
struct HPKEPublicKey { /* private fields */ }
Implementations§
source§impl HpkePublicKey
sourcepub fn new(value: Vec<u8>) -> Self
Create a new HPKE public key.
+
HPKEPublicKey in hpke_rs - Rust Type Alias hpke_rs::HPKEPublicKey
source · pub type HPKEPublicKey = HpkePublicKey;
👎Deprecated since 0.0.7: Please use HpkePublicKey instead. This alias will be removed with the first stable 0.1 release.Aliased Type§
struct HPKEPublicKey { /* private fields */ }
Implementations§
Trait Implementations§
source§impl Clone for HpkePublicKey
source§fn clone(&self) -> HpkePublicKey
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkePublicKey
source§impl Default for HpkePublicKey
source§fn default() -> HpkePublicKey
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkePublicKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Deserialize for HpkePublicKey
Trait Implementations§
source§impl Clone for HpkePublicKey
source§fn clone(&self) -> HpkePublicKey
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for HpkePublicKey
source§impl Default for HpkePublicKey
source§fn default() -> HpkePublicKey
Returns the “default value” for a type. Read moresource§impl<'de> Deserialize<'de> for HpkePublicKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl Deserialize for HpkePublicKey
source§fn tls_deserialize<R: Read>(bytes: &mut R) -> Result<Self, Error>
This function deserializes the bytes
from the provided a std::io::Read
and returns the populated struct. Read moresource§impl From<&[u8]> for HpkePublicKey
source§impl PartialEq<HpkePublicKey> for HpkePublicKey
source§impl From<&[u8]> for HpkePublicKey
source§impl PartialEq<HpkePublicKey> for HpkePublicKey
source§fn eq(&self, other: &HpkePublicKey) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
.source§impl Serialize for HpkePublicKey
source§impl Serialize for HpkePublicKey
source§impl Size for HpkePublicKey
source§fn tls_serialized_len(&self) -> usize
source§impl StructuralPartialEq for HpkePublicKey
\ No newline at end of file
+sufficient, and should not be overridden without very good reason.source§impl Serialize for HpkePublicKey
source§impl Serialize for HpkePublicKey
source§impl Size for HpkePublicKey
source§fn tls_serialized_len(&self) -> usize
source§impl StructuralPartialEq for HpkePublicKey
\ No newline at end of file
diff --git a/implementors/core/clone/trait.Clone.js b/implementors/core/clone/trait.Clone.js
index 29c3d7e..c7012c5 100644
--- a/implementors/core/clone/trait.Clone.js
+++ b/implementors/core/clone/trait.Clone.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl Clone for HpkePrivateKey"],["impl<Crypto: 'static + HpkeCrypto> Clone for Hpke<Crypto>"],["impl Clone for HpkeKeyPair"],["impl Clone for HpkeError"],["impl Clone for Mode"],["impl Clone for HpkePublicKey"]]
+"hpke_rs":[["impl Clone for HpkePublicKey"],["impl Clone for Mode"],["impl Clone for HpkePrivateKey"],["impl<Crypto: 'static + HpkeCrypto> Clone for Hpke<Crypto>"],["impl Clone for HpkeError"],["impl Clone for HpkeKeyPair"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/cmp/trait.PartialEq.js b/implementors/core/cmp/trait.PartialEq.js
index 5f936b7..57abae6 100644
--- a/implementors/core/cmp/trait.PartialEq.js
+++ b/implementors/core/cmp/trait.PartialEq.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl PartialEq<HpkePrivateKey> for HpkePrivateKey"],["impl PartialEq<HpkePublicKey> for HpkePublicKey"],["impl PartialEq<HpkeError> for HpkeError"],["impl PartialEq<Mode> for Mode"]]
+"hpke_rs":[["impl PartialEq<HpkeError> for HpkeError"],["impl PartialEq<HpkePublicKey> for HpkePublicKey"],["impl PartialEq<HpkePrivateKey> for HpkePrivateKey"],["impl PartialEq<Mode> for Mode"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/convert/trait.From.js b/implementors/core/convert/trait.From.js
index 135811f..f37b9ac 100644
--- a/implementors/core/convert/trait.From.js
+++ b/implementors/core/convert/trait.From.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl From<Error> for HpkeError"],["impl From<Vec<u8, Global>> for HpkePublicKey"],["impl From<(Vec<u8, Global>, Vec<u8, Global>)> for HpkeKeyPair"],["impl From<Vec<u8, Global>> for HpkePrivateKey"],["impl From<&[u8]> for HpkePublicKey"],["impl From<(&[u8], &[u8])> for HpkeKeyPair"],["impl From<&[u8]> for HpkePrivateKey"]]
+"hpke_rs":[["impl From<Vec<u8, Global>> for HpkePublicKey"],["impl From<&[u8]> for HpkePrivateKey"],["impl From<(Vec<u8, Global>, Vec<u8, Global>)> for HpkeKeyPair"],["impl From<&[u8]> for HpkePublicKey"],["impl From<Vec<u8, Global>> for HpkePrivateKey"],["impl From<Error> for HpkeError"],["impl From<(&[u8], &[u8])> for HpkeKeyPair"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/default/trait.Default.js b/implementors/core/default/trait.Default.js
index b470006..af577a2 100644
--- a/implementors/core/default/trait.Default.js
+++ b/implementors/core/default/trait.Default.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl Default for HpkeKeyPair"],["impl Default for HpkePublicKey"],["impl Default for HpkePrivateKey"]]
+"hpke_rs":[["impl Default for HpkeKeyPair"],["impl Default for HpkePrivateKey"],["impl Default for HpkePublicKey"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/fmt/trait.Debug.js b/implementors/core/fmt/trait.Debug.js
index 825f35c..005952f 100644
--- a/implementors/core/fmt/trait.Debug.js
+++ b/implementors/core/fmt/trait.Debug.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl<Crypto: Debug + 'static + HpkeCrypto> Debug for Hpke<Crypto>where\n Crypto::HpkePrng: Debug,"],["impl Debug for HpkeError"],["impl<Crypto: HpkeCrypto> Debug for Context<Crypto>"],["impl Debug for HpkePrivateKey"],["impl Debug for Mode"],["impl Debug for HpkeKeyPair"],["impl Debug for HpkePublicKey"]]
+"hpke_rs":[["impl Debug for HpkePublicKey"],["impl Debug for HpkePrivateKey"],["impl Debug for HpkeKeyPair"],["impl Debug for HpkeError"],["impl<Crypto: Debug + 'static + HpkeCrypto> Debug for Hpke<Crypto>where\n Crypto::HpkePrng: Debug,"],["impl Debug for Mode"],["impl<Crypto: HpkeCrypto> Debug for Context<Crypto>"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/marker/trait.Freeze.js b/implementors/core/marker/trait.Freeze.js
index 0625333..6df983d 100644
--- a/implementors/core/marker/trait.Freeze.js
+++ b/implementors/core/marker/trait.Freeze.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl Freeze for HpkeError",1,["hpke_rs::HpkeError"]],["impl Freeze for HpkePublicKey",1,["hpke_rs::HpkePublicKey"]],["impl Freeze for HpkePrivateKey",1,["hpke_rs::HpkePrivateKey"]],["impl Freeze for HpkeKeyPair",1,["hpke_rs::HpkeKeyPair"]],["impl Freeze for Mode",1,["hpke_rs::Mode"]],["impl<Crypto> !Freeze for Context<Crypto>",1,["hpke_rs::Context"]],["impl<Crypto> !Freeze for Hpke<Crypto>",1,["hpke_rs::Hpke"]]]
+"hpke_rs":[["impl Freeze for HpkeError",1,["hpke_rs::HpkeError"]],["impl Freeze for HpkePublicKey",1,["hpke_rs::HpkePublicKey"]],["impl Freeze for HpkePrivateKey",1,["hpke_rs::HpkePrivateKey"]],["impl Freeze for HpkeKeyPair",1,["hpke_rs::HpkeKeyPair"]],["impl Freeze for Mode",1,["hpke_rs::Mode"]],["impl<Crypto> Freeze for Context<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: Freeze,",1,["hpke_rs::Context"]],["impl<Crypto> Freeze for Hpke<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: Freeze,",1,["hpke_rs::Hpke"]]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/marker/trait.StructuralPartialEq.js b/implementors/core/marker/trait.StructuralPartialEq.js
index 9ad52ad..5e93391 100644
--- a/implementors/core/marker/trait.StructuralPartialEq.js
+++ b/implementors/core/marker/trait.StructuralPartialEq.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl StructuralPartialEq for HpkeError"],["impl StructuralPartialEq for HpkePublicKey"],["impl StructuralPartialEq for Mode"]]
+"hpke_rs":[["impl StructuralPartialEq for HpkePublicKey"],["impl StructuralPartialEq for Mode"],["impl StructuralPartialEq for HpkeError"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/marker/trait.Sync.js b/implementors/core/marker/trait.Sync.js
index 6ff5d31..499ecde 100644
--- a/implementors/core/marker/trait.Sync.js
+++ b/implementors/core/marker/trait.Sync.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl Sync for HpkeError",1,["hpke_rs::HpkeError"]],["impl Sync for HpkePublicKey",1,["hpke_rs::HpkePublicKey"]],["impl Sync for HpkePrivateKey",1,["hpke_rs::HpkePrivateKey"]],["impl Sync for HpkeKeyPair",1,["hpke_rs::HpkeKeyPair"]],["impl Sync for Mode",1,["hpke_rs::Mode"]],["impl<Crypto> Sync for Context<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: Send + Sync,",1,["hpke_rs::Context"]],["impl<Crypto> Sync for Hpke<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: Send + Sync,",1,["hpke_rs::Hpke"]]]
+"hpke_rs":[["impl Sync for HpkeError",1,["hpke_rs::HpkeError"]],["impl Sync for HpkePublicKey",1,["hpke_rs::HpkePublicKey"]],["impl Sync for HpkePrivateKey",1,["hpke_rs::HpkePrivateKey"]],["impl Sync for HpkeKeyPair",1,["hpke_rs::HpkeKeyPair"]],["impl Sync for Mode",1,["hpke_rs::Mode"]],["impl<Crypto> Sync for Context<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: Sync,",1,["hpke_rs::Context"]],["impl<Crypto> Sync for Hpke<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: Sync,",1,["hpke_rs::Hpke"]]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js b/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js
index 9d20887..5bd8bb3 100644
--- a/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js
+++ b/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl RefUnwindSafe for HpkeError",1,["hpke_rs::HpkeError"]],["impl RefUnwindSafe for HpkePublicKey",1,["hpke_rs::HpkePublicKey"]],["impl RefUnwindSafe for HpkePrivateKey",1,["hpke_rs::HpkePrivateKey"]],["impl RefUnwindSafe for HpkeKeyPair",1,["hpke_rs::HpkeKeyPair"]],["impl RefUnwindSafe for Mode",1,["hpke_rs::Mode"]],["impl<Crypto> RefUnwindSafe for Context<Crypto>",1,["hpke_rs::Context"]],["impl<Crypto> RefUnwindSafe for Hpke<Crypto>",1,["hpke_rs::Hpke"]]]
+"hpke_rs":[["impl RefUnwindSafe for HpkeError",1,["hpke_rs::HpkeError"]],["impl RefUnwindSafe for HpkePublicKey",1,["hpke_rs::HpkePublicKey"]],["impl RefUnwindSafe for HpkePrivateKey",1,["hpke_rs::HpkePrivateKey"]],["impl RefUnwindSafe for HpkeKeyPair",1,["hpke_rs::HpkeKeyPair"]],["impl RefUnwindSafe for Mode",1,["hpke_rs::Mode"]],["impl<Crypto> RefUnwindSafe for Context<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: RefUnwindSafe,",1,["hpke_rs::Context"]],["impl<Crypto> RefUnwindSafe for Hpke<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: RefUnwindSafe,",1,["hpke_rs::Hpke"]]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/core/panic/unwind_safe/trait.UnwindSafe.js b/implementors/core/panic/unwind_safe/trait.UnwindSafe.js
index 79979b4..633c214 100644
--- a/implementors/core/panic/unwind_safe/trait.UnwindSafe.js
+++ b/implementors/core/panic/unwind_safe/trait.UnwindSafe.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl UnwindSafe for HpkeError",1,["hpke_rs::HpkeError"]],["impl UnwindSafe for HpkePublicKey",1,["hpke_rs::HpkePublicKey"]],["impl UnwindSafe for HpkePrivateKey",1,["hpke_rs::HpkePrivateKey"]],["impl UnwindSafe for HpkeKeyPair",1,["hpke_rs::HpkeKeyPair"]],["impl UnwindSafe for Mode",1,["hpke_rs::Mode"]],["impl<Crypto> UnwindSafe for Context<Crypto>",1,["hpke_rs::Context"]],["impl<Crypto> UnwindSafe for Hpke<Crypto>",1,["hpke_rs::Hpke"]]]
+"hpke_rs":[["impl UnwindSafe for HpkeError",1,["hpke_rs::HpkeError"]],["impl UnwindSafe for HpkePublicKey",1,["hpke_rs::HpkePublicKey"]],["impl UnwindSafe for HpkePrivateKey",1,["hpke_rs::HpkePrivateKey"]],["impl UnwindSafe for HpkeKeyPair",1,["hpke_rs::HpkeKeyPair"]],["impl UnwindSafe for Mode",1,["hpke_rs::Mode"]],["impl<Crypto> UnwindSafe for Context<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: UnwindSafe,",1,["hpke_rs::Context"]],["impl<Crypto> UnwindSafe for Hpke<Crypto>where\n <Crypto as HpkeCrypto>::HpkePrng: UnwindSafe,",1,["hpke_rs::Hpke"]]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/serde/de/trait.Deserialize.js b/implementors/serde/de/trait.Deserialize.js
index d9a25b3..00387dc 100644
--- a/implementors/serde/de/trait.Deserialize.js
+++ b/implementors/serde/de/trait.Deserialize.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl<'de> Deserialize<'de> for HpkePublicKey"],["impl<'de> Deserialize<'de> for HpkePrivateKey"],["impl<'de> Deserialize<'de> for Mode"],["impl<'de> Deserialize<'de> for HpkeKeyPair"]]
+"hpke_rs":[["impl<'de> Deserialize<'de> for HpkeKeyPair"],["impl<'de> Deserialize<'de> for Mode"],["impl<'de> Deserialize<'de> for HpkePublicKey"],["impl<'de> Deserialize<'de> for HpkePrivateKey"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/serde/ser/trait.Serialize.js b/implementors/serde/ser/trait.Serialize.js
index 81bb575..19adfce 100644
--- a/implementors/serde/ser/trait.Serialize.js
+++ b/implementors/serde/ser/trait.Serialize.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl Serialize for Mode"],["impl Serialize for HpkePublicKey"],["impl Serialize for HpkePrivateKey"],["impl Serialize for HpkeKeyPair"]]
+"hpke_rs":[["impl Serialize for HpkeKeyPair"],["impl Serialize for HpkePrivateKey"],["impl Serialize for Mode"],["impl Serialize for HpkePublicKey"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/tls_codec/trait.Deserialize.js b/implementors/tls_codec/trait.Deserialize.js
index 7555aa8..606c95c 100644
--- a/implementors/tls_codec/trait.Deserialize.js
+++ b/implementors/tls_codec/trait.Deserialize.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl Deserialize for HpkePublicKey"],["impl Deserialize for &HpkePublicKey"]]
+"hpke_rs":[["impl Deserialize for &HpkePublicKey"],["impl Deserialize for HpkePublicKey"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/implementors/tls_codec/trait.Serialize.js b/implementors/tls_codec/trait.Serialize.js
index bcc076f..fa96398 100644
--- a/implementors/tls_codec/trait.Serialize.js
+++ b/implementors/tls_codec/trait.Serialize.js
@@ -1,3 +1,3 @@
(function() {var implementors = {
-"hpke_rs":[["impl Serialize for &HpkePublicKey"],["impl Serialize for HpkePublicKey"]]
+"hpke_rs":[["impl Serialize for HpkePublicKey"],["impl Serialize for &HpkePublicKey"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
\ No newline at end of file
diff --git a/search-index.js b/search-index.js
index 7292a68..e8bd321 100644
--- a/search-index.js
+++ b/search-index.js
@@ -1,5 +1,5 @@
var searchIndex = JSON.parse('{\
-"hpke_rs":{"doc":"HPKE","t":"NNNDNGGGDEDDDNNNNNNNNENNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLALLLLLLLLLLLLLALLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLQCIKFFFF","n":["Auth","AuthPsk","Base","Context","CryptoError","HPKEKeyPair","HPKEPrivateKey","HPKEPublicKey","Hpke","HpkeError","HpkeKeyPair","HpkePrivateKey","HpkePublicKey","InconsistentPsk","InsecurePsk","InsufficientRandomness","InvalidConfig","InvalidInput","LockPoisoned","MessageLimitReached","MissingPsk","Mode","OpenError","Psk","UnknownMode","UnnecessaryPsk","as_slice","as_slice","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","default","default","default","derive_key_pair","deserialize","deserialize","deserialize","deserialize","eq","eq","eq","eq","export","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from_keys","generate_key_pair","into","into","into","into","into","into","into","into_keys","key_schedule","new","new","new","new","open","open","prelude","private_key","public_key","receiver_export","seal","seal","seed","send_export","serialize","serialize","serialize","serialize","setup_receiver","setup_sender","test_util","tls_deserialize","tls_deserialize","tls_serialize","tls_serialize","tls_serialized_len","tls_serialized_len","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","zeroize","Error","HpkeMode","TryFrom","try_from","bytes_to_hex","hex_to_bytes","hex_to_bytes_option","vec_to_option_slice"],"q":[[0,"hpke_rs"],[161,"hpke_rs::prelude"],[165,"hpke_rs::test_util"],[169,"hpke_rs_crypto"],[170,"core::result"],[171,"serde::de"],[172,"alloc::vec"],[173,"core::fmt"],[174,"core::fmt"],[175,"hpke_rs_crypto::types"],[176,"hpke_rs_crypto::types"],[177,"serde::ser"],[178,"tls_codec"],[179,"std::io"],[180,"std::io"],[181,"core::any"]],"d":["Authenticated HPKE.","Authenticated HPKE with PSK.","HPKE Base mode.","The HPKE context. Note that the RFC currently doesn’t …","An error in the crypto library occurred.","","","","The HPKE configuration struct. This holds the …","HPKE Error types.","An HPKE key pair has an HPKE private and public key.","An HPKE private key is a byte vector.","An HPKE public key is a byte vector.","Inconsistent PSK input.","PSK input is too short (needs to be at least 32 bytes).","Unable to collect enough randomness.","Invalid configuration or arguments.","Invalid input.","A concurrency issue with an RwLock
.","The message limit for this AEAD, key, and nonce.","PSK input is required but missing.","HPKE supports four modes.","Error opening an HPKE ciphertext.","HPKE with PSK.","Unknown HPKE mode.","PSK input is provided but not needed.","Get the raw key as byte slice.","Get the raw key as byte slice.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","7.1.2. DeriveKeyPair Derive a key pair for the used KEM …","","","","","","","","","5.3. Secret Export","","","","","","","","","","","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","","","","Returns the argument unchanged.","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Build a key pair from two keys","Cryptographic Dependencies Randomized algorithm to …","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Split the key pair into the two keys","Creating the Encryption Context Generate the HPKE context …","Create a new HPKE public key. Consumes the public key …","Create a new HPKE private key. Consumes the private key …","Create a new HPKE key pair. Consumes the private and …","Set up the configuration for HPKE.","5.2. Encryption and Decryption","Single-Shot APIs 6.1. Encryption and DecryptionSingle shot …","Prelude for HPKE. Include this to get access to all the …","Get a reference to the HPKE private key of this key pair.","Get a reference to the HPKE public key of this key pair.","Single-Shot APIs 6.2. Secret ExportSingle shot API to …","5.2. Encryption and Decryption","Single-Shot APIs 6.1. Encryption and DecryptionSingle shot …","Set PRNG state for testing.","Single-Shot APIs 6.2. Secret ExportSingle shot API to …","","","","","Set up an HPKE receiver.","Set up an HPKE sender.","Test util module. Should be moved really.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","The type returned in the event of a conversion error.","","Simple and safe type conversions that may fail in a …","Performs the conversion.","Convert bytes
to a hex string.","Convert a hex string to a byte vector.","Convert a hex string to a byte vector. If the input is None
…","Convert a byte slice into byte slice option. Returns Nonce
…"],"i":[7,7,7,0,5,0,0,0,0,0,0,0,0,5,5,5,5,5,5,5,5,0,5,7,5,5,1,4,14,5,1,4,6,7,8,14,5,1,4,6,7,8,5,1,4,6,7,8,5,1,4,6,7,8,1,4,6,8,1,4,6,7,5,1,4,7,14,14,5,5,1,4,6,7,7,8,8,14,5,5,1,1,1,4,4,4,6,6,6,7,8,6,8,14,5,1,4,6,7,8,6,8,1,4,6,8,14,8,0,6,6,8,14,8,8,8,1,4,6,7,8,8,0,1,1,1,1,1,1,5,1,4,6,7,8,5,7,8,14,5,1,4,6,7,7,8,14,5,1,4,6,7,8,14,5,1,4,6,7,8,4,33,0,0,33,0,0,0,0],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[1,[[3,[2]]]],[4,[[3,[2]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[5,5],[1,1],[4,4],[6,6],[7,7],[[[8,[-1]]],[[8,[-1]]],9],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[],1],[[],4],[[],6],[[[8,[-1]],[3,[2]]],[[11,[6,5]]],9],[-1,[[11,[1]]],12],[-1,[[11,[4]]],12],[-1,[[11,[6]]],12],[-1,[[11,[7]]],12],[[5,5],13],[[1,1],13],[[4,4],13],[[7,7],13],[[[14,[-1]],[3,[2]],15],[[11,[[16,[2]],5]]],9],[[[14,[-1]],17],18,9],[[5,17],18],[[5,17],18],[[1,17],18],[[4,17],[[11,[10,19]]]],[[6,17],18],[[7,17],18],[[7,17],18],[[[8,[-1]],17],18,9],[[[8,[-1]],17],18,[20,9]],[-1,-1,[]],[21,5],[-1,-1,[]],[-1,-1,[]],[[[16,[2]]],1],[[[3,[2]]],1],[[[3,[2]]],4],[-1,-1,[]],[[[16,[2]]],4],[[[10,[[16,[2]],[16,[2]]]]],6],[[[10,[[3,[2]],[3,[2]]]]],6],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[[4,1],6],[[[8,[-1]]],[[11,[6,5]]],9],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[6,[[10,[4,1]]]],[[[8,[-1]],[3,[2]],[3,[2]],[3,[2]],[3,[2]]],[[11,[[14,[-1]],5]]],9],[[[16,[2]]],1],[[[16,[2]]],4],[[[16,[2]],[16,[2]]],6],[[7,22,23,24],[[8,[-1]]],9],[[[14,[-1]],[3,[2]],[3,[2]]],[[11,[[16,[2]],5]]],9],[[[8,[-1]],[3,[2]],4,[3,[2]],[3,[2]],[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[1]]],[[11,[[16,[2]],5]]],9],0,[6,4],[6,1],[[[8,[-1]],[3,[2]],4,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[1]],[3,[2]],15],[[11,[[16,[2]],5]]],9],[[[14,[-1]],[3,[2]],[3,[2]]],[[11,[[16,[2]],5]]],9],[[[8,[-1]],1,[3,[2]],[3,[2]],[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[4]]],[[11,[[10,[[16,[2]],[16,[2]]]],5]]],9],[[[8,[-1]],[3,[2]]],[[11,[10,5]]],9],[[[8,[-1]],1,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[4]],[3,[2]],15],[[11,[[10,[[16,[2]],[16,[2]]]],5]]],9],[[1,-1],11,26],[[4,-1],11,26],[[6,-1],11,26],[[7,-1],11,26],[[[8,[-1]],[3,[2]],4,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[1]]],[[11,[[14,[-1]],5]]],9],[[[8,[-1]],1,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[4]]],[[11,[[10,[[16,[2]],[14,[-1]]]],5]]],9],0,[-1,[[11,[1,27]]],28],[-1,[[11,[1,27]]],28],[[1,-1],[[11,[15,27]]],29],[[1,-1],[[11,[15,27]]],29],[1,15],[1,15],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,30,[]],[-1,30,[]],[-1,30,[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[2,[[11,[7,5]]]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[4,10],0,0,0,[-1,[[11,[-2]]],[],[]],[[[3,[2]]],30],[32,[[16,[2]]]],[[[25,[30]]],[[16,[2]]]],[[[3,[2]]],[[25,[[3,[2]]]]]]],"c":[5,6,7],"p":[[3,"HpkePublicKey",0],[15,"u8"],[15,"slice"],[3,"HpkePrivateKey",0],[4,"HpkeError",0],[3,"HpkeKeyPair",0],[4,"Mode",0],[3,"Hpke",0],[8,"HpkeCrypto",169],[15,"tuple"],[4,"Result",170],[8,"Deserializer",171],[15,"bool"],[3,"Context",0],[15,"usize"],[3,"Vec",172],[3,"Formatter",173],[6,"Result",173],[3,"Error",173],[8,"Debug",173],[4,"Error",174],[4,"KemAlgorithm",175],[4,"KdfAlgorithm",175],[4,"AeadAlgorithm",175],[4,"Option",176],[8,"Serializer",177],[4,"Error",178],[8,"Read",179],[8,"Write",179],[3,"String",180],[3,"TypeId",181],[15,"str"],[8,"TryFrom",161]]}\
+"hpke_rs":{"doc":"HPKE","t":"NNNDNGGGDEDDDNNNNNNNENNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLALLLLLLLLLLLLLALLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLQCIKFFFF","n":["Auth","AuthPsk","Base","Context","CryptoError","HPKEKeyPair","HPKEPrivateKey","HPKEPublicKey","Hpke","HpkeError","HpkeKeyPair","HpkePrivateKey","HpkePublicKey","InconsistentPsk","InsecurePsk","InsufficientRandomness","InvalidConfig","InvalidInput","MessageLimitReached","MissingPsk","Mode","OpenError","Psk","UnknownMode","UnnecessaryPsk","as_slice","as_slice","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","default","default","default","derive_key_pair","deserialize","deserialize","deserialize","deserialize","eq","eq","eq","eq","export","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from_keys","generate_key_pair","into","into","into","into","into","into","into","into_keys","key_schedule","new","new","new","new","open","open","prelude","private_key","public_key","receiver_export","seal","seal","seed","send_export","serialize","serialize","serialize","serialize","setup_receiver","setup_sender","test_util","tls_deserialize","tls_deserialize","tls_serialize","tls_serialize","tls_serialized_len","tls_serialized_len","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","zeroize","Error","HpkeMode","TryFrom","try_from","bytes_to_hex","hex_to_bytes","hex_to_bytes_option","vec_to_option_slice"],"q":[[0,"hpke_rs"],[160,"hpke_rs::prelude"],[164,"hpke_rs::test_util"],[168,"hpke_rs_crypto"],[169,"core::result"],[170,"serde::de"],[171,"alloc::vec"],[172,"core::fmt"],[173,"core::fmt"],[174,"hpke_rs_crypto::types"],[175,"hpke_rs_crypto::types"],[176,"serde::ser"],[177,"tls_codec"],[178,"std::io"],[179,"std::io"],[180,"core::any"]],"d":["Authenticated HPKE.","Authenticated HPKE with PSK.","HPKE Base mode.","The HPKE context. Note that the RFC currently doesn’t …","An error in the crypto library occurred.","","","","The HPKE configuration struct. This holds the …","HPKE Error types.","An HPKE key pair has an HPKE private and public key.","An HPKE private key is a byte vector.","An HPKE public key is a byte vector.","Inconsistent PSK input.","PSK input is too short (needs to be at least 32 bytes).","Unable to collect enough randomness.","Invalid configuration or arguments.","Invalid input.","The message limit for this AEAD, key, and nonce.","PSK input is required but missing.","HPKE supports four modes.","Error opening an HPKE ciphertext.","HPKE with PSK.","Unknown HPKE mode.","PSK input is provided but not needed.","Get the raw key as byte slice.","Get the raw key as byte slice.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","7.1.2. DeriveKeyPair Derive a key pair for the used KEM …","","","","","","","","","5.3. Secret Export","","","","","","","","","","","Returns the argument unchanged.","","Returns the argument unchanged.","","","Returns the argument unchanged.","","Returns the argument unchanged.","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Build a key pair from two keys","Cryptographic Dependencies Randomized algorithm to …","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Split the key pair into the two keys","Creating the Encryption Context Generate the HPKE context …","Create a new HPKE public key. Consumes the public key …","Create a new HPKE private key. Consumes the private key …","Create a new HPKE key pair. Consumes the private and …","Set up the configuration for HPKE.","5.2. Encryption and Decryption","Single-Shot APIs 6.1. Encryption and DecryptionSingle shot …","Prelude for HPKE. Include this to get access to all the …","Get a reference to the HPKE private key of this key pair.","Get a reference to the HPKE public key of this key pair.","Single-Shot APIs 6.2. Secret ExportSingle shot API to …","5.2. Encryption and Decryption","Single-Shot APIs 6.1. Encryption and DecryptionSingle shot …","Set PRNG state for testing.","Single-Shot APIs 6.2. Secret ExportSingle shot API to …","","","","","Set up an HPKE receiver.","Set up an HPKE sender.","Test util module. Should be moved really.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","The type returned in the event of a conversion error.","","Simple and safe type conversions that may fail in a …","Performs the conversion.","Convert bytes
to a hex string.","Convert a hex string to a byte vector.","Convert a hex string to a byte vector. If the input is None
…","Convert a byte slice into byte slice option. Returns Nonce
…"],"i":[7,7,7,0,5,0,0,0,0,0,0,0,0,5,5,5,5,5,5,5,0,5,7,5,5,1,4,14,5,1,4,6,7,8,14,5,1,4,6,7,8,5,1,4,6,7,8,5,1,4,6,7,8,1,4,6,8,1,4,6,7,5,1,4,7,14,14,5,5,1,4,6,7,7,8,8,14,5,5,1,1,1,4,4,4,6,6,6,7,8,6,8,14,5,1,4,6,7,8,6,8,1,4,6,8,14,8,0,6,6,8,14,8,8,8,1,4,6,7,8,8,0,1,1,1,1,1,1,5,1,4,6,7,8,5,7,8,14,5,1,4,6,7,7,8,14,5,1,4,6,7,8,14,5,1,4,6,7,8,4,33,0,0,33,0,0,0,0],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[1,[[3,[2]]]],[4,[[3,[2]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[5,5],[1,1],[4,4],[6,6],[7,7],[[[8,[-1]]],[[8,[-1]]],9],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[],1],[[],4],[[],6],[[[8,[-1]],[3,[2]]],[[11,[6,5]]],9],[-1,[[11,[1]]],12],[-1,[[11,[4]]],12],[-1,[[11,[6]]],12],[-1,[[11,[7]]],12],[[5,5],13],[[1,1],13],[[4,4],13],[[7,7],13],[[[14,[-1]],[3,[2]],15],[[11,[[16,[2]],5]]],9],[[[14,[-1]],17],18,9],[[5,17],18],[[5,17],18],[[1,17],18],[[4,17],[[11,[10,19]]]],[[6,17],18],[[7,17],18],[[7,17],18],[[[8,[-1]],17],18,9],[[[8,[-1]],17],18,[20,9]],[-1,-1,[]],[21,5],[-1,-1,[]],[[[16,[2]]],1],[[[3,[2]]],1],[-1,-1,[]],[[[3,[2]]],4],[-1,-1,[]],[[[16,[2]]],4],[[[10,[[3,[2]],[3,[2]]]]],6],[[[10,[[16,[2]],[16,[2]]]]],6],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[[4,1],6],[[[8,[-1]]],[[11,[6,5]]],9],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[6,[[10,[4,1]]]],[[[8,[-1]],[3,[2]],[3,[2]],[3,[2]],[3,[2]]],[[11,[[14,[-1]],5]]],9],[[[16,[2]]],1],[[[16,[2]]],4],[[[16,[2]],[16,[2]]],6],[[7,22,23,24],[[8,[-1]]],9],[[[14,[-1]],[3,[2]],[3,[2]]],[[11,[[16,[2]],5]]],9],[[[8,[-1]],[3,[2]],4,[3,[2]],[3,[2]],[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[1]]],[[11,[[16,[2]],5]]],9],0,[6,4],[6,1],[[[8,[-1]],[3,[2]],4,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[1]],[3,[2]],15],[[11,[[16,[2]],5]]],9],[[[14,[-1]],[3,[2]],[3,[2]]],[[11,[[16,[2]],5]]],9],[[[8,[-1]],1,[3,[2]],[3,[2]],[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[4]]],[[11,[[10,[[16,[2]],[16,[2]]]],5]]],9],[[[8,[-1]],[3,[2]]],[[11,[10,5]]],9],[[[8,[-1]],1,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[4]],[3,[2]],15],[[11,[[10,[[16,[2]],[16,[2]]]],5]]],9],[[1,-1],11,26],[[4,-1],11,26],[[6,-1],11,26],[[7,-1],11,26],[[[8,[-1]],[3,[2]],4,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[1]]],[[11,[[14,[-1]],5]]],9],[[[8,[-1]],1,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[4]]],[[11,[[10,[[16,[2]],[14,[-1]]]],5]]],9],0,[-1,[[11,[1,27]]],28],[-1,[[11,[1,27]]],28],[[1,-1],[[11,[15,27]]],29],[[1,-1],[[11,[15,27]]],29],[1,15],[1,15],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,30,[]],[-1,30,[]],[-1,30,[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[2,[[11,[7,5]]]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[4,10],0,0,0,[-1,[[11,[-2]]],[],[]],[[[3,[2]]],30],[32,[[16,[2]]]],[[[25,[30]]],[[16,[2]]]],[[[3,[2]]],[[25,[[3,[2]]]]]]],"c":[5,6,7],"p":[[3,"HpkePublicKey",0],[15,"u8"],[15,"slice"],[3,"HpkePrivateKey",0],[4,"HpkeError",0],[3,"HpkeKeyPair",0],[4,"Mode",0],[3,"Hpke",0],[8,"HpkeCrypto",168],[15,"tuple"],[4,"Result",169],[8,"Deserializer",170],[15,"bool"],[3,"Context",0],[15,"usize"],[3,"Vec",171],[3,"Formatter",172],[6,"Result",172],[3,"Error",172],[8,"Debug",172],[4,"Error",173],[4,"KemAlgorithm",174],[4,"KdfAlgorithm",174],[4,"AeadAlgorithm",174],[4,"Option",175],[8,"Serializer",176],[4,"Error",177],[8,"Read",178],[8,"Write",178],[3,"String",179],[3,"TypeId",180],[15,"str"],[8,"TryFrom",160]]}\
}');
if (typeof window !== 'undefined' && window.initSearch) {window.initSearch(searchIndex)};
if (typeof exports !== 'undefined') {exports.searchIndex = searchIndex};
diff --git a/src/hpke_rs/dh_kem.rs.html b/src/hpke_rs/dh_kem.rs.html
index 76d229d..e626cdb 100644
--- a/src/hpke_rs/dh_kem.rs.html
+++ b/src/hpke_rs/dh_kem.rs.html
@@ -175,9 +175,13 @@
175
176
177
+178
+179
//! DH KEM as described in §4.1. DH-Based KEM.
-use hpke_rs_crypto::{error::Error, types::KemAlgorithm, HpkeCrypto};
+use alloc::{string::ToString, vec::Vec};
+
+use hpke_rs_crypto::{error::Error, types::KemAlgorithm, HpkeCrypto};
use crate::util::*;
use crate::{
diff --git a/src/hpke_rs/kdf.rs.html b/src/hpke_rs/kdf.rs.html
index e71827a..63956d6 100644
--- a/src/hpke_rs/kdf.rs.html
+++ b/src/hpke_rs/kdf.rs.html
@@ -28,7 +28,11 @@
28
29
30
-
use hpke_rs_crypto::{error::Error, types::KdfAlgorithm, HpkeCrypto};
+31
+32
+
use alloc::vec::Vec;
+
+use hpke_rs_crypto::{error::Error, types::KdfAlgorithm, HpkeCrypto};
use crate::util::concat;
diff --git a/src/hpke_rs/kem.rs.html b/src/hpke_rs/kem.rs.html
index 3fbf089..e860613 100644
--- a/src/hpke_rs/kem.rs.html
+++ b/src/hpke_rs/kem.rs.html
@@ -97,7 +97,11 @@
97
98
99
-
use hpke_rs_crypto::{error::Error, types::KemAlgorithm, HpkeCrypto};
+100
+101
+
use alloc::vec::Vec;
+
+use hpke_rs_crypto::{error::Error, types::KemAlgorithm, HpkeCrypto};
use crate::dh_kem;
use crate::util;
diff --git a/src/hpke_rs/lib.rs.html b/src/hpke_rs/lib.rs.html
index e14bd4b..18ff4d7 100644
--- a/src/hpke_rs/lib.rs.html
+++ b/src/hpke_rs/lib.rs.html
@@ -994,6 +994,14 @@
994
995
996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
#![doc = include_str!("../Readme.md")]
#![forbid(unsafe_code, unused_must_use, unstable_features)]
#![deny(
@@ -1004,8 +1012,18 @@
unused_extern_crates,
unused_qualifications
)]
+#![cfg_attr(not(test), no_std)]
-use std::sync::RwLock;
+extern crate alloc;
+#[cfg(feature = "std")]
+extern crate std;
+
+use alloc::{
+ format,
+ string::{String, ToString},
+ vec,
+ vec::Vec,
+};
#[cfg(feature = "hpke-test-prng")]
use hpke_rs_crypto::HpkeTestRng;
@@ -1075,15 +1093,13 @@
/// Unable to collect enough randomness.
InsufficientRandomness,
-
- /// A concurrency issue with an [`RwLock`].
- LockPoisoned,
}
-impl std::error::Error for HpkeError {}
+#[cfg(feature = "std")]
+impl std::error::Error for HpkeError {}
-impl std::fmt::Display for HpkeError {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+impl core::fmt::Display for HpkeError {
+ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "HPKE Error: {:?}", self)
}
}
@@ -1155,8 +1171,8 @@
AuthPsk = 0x03,
}
-impl std::fmt::Display for Mode {
- fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+impl core::fmt::Display for Mode {
+ fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
write!(f, "{:?}", self)
}
}
@@ -1198,8 +1214,8 @@
}
#[cfg(feature = "hazmat")]
-impl<Crypto: HpkeCrypto> std::fmt::Debug for Context<Crypto> {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+impl<Crypto: HpkeCrypto> core::fmt::Debug for Context<Crypto> {
+ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(
f,
"Context {{\n key: {:?}\n nonce: {:?}\n exporter_secret: {:?}\n seq no: {:?}\n}}",
@@ -1209,8 +1225,8 @@
}
#[cfg(not(feature = "hazmat"))]
-impl<Crypto: HpkeCrypto> std::fmt::Debug for Context<Crypto> {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+impl<Crypto: HpkeCrypto> core::fmt::Debug for Context<Crypto> {
+ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(
f,
"Context {{\n key: {:?}\n nonce: {:?}\n exporter_secret: {:?}\n seq no: {:?}\n}}",
@@ -1327,7 +1343,7 @@
kem_id: KemAlgorithm,
kdf_id: KdfAlgorithm,
aead_id: AeadAlgorithm,
- prng: RwLock<Crypto::HpkePrng>,
+ prng: Crypto::HpkePrng,
}
impl<Crypto: 'static + HpkeCrypto> Clone for Hpke<Crypto> {
@@ -1337,13 +1353,13 @@
kem_id: self.kem_id,
kdf_id: self.kdf_id,
aead_id: self.aead_id,
- prng: RwLock::new(Crypto::prng()),
+ prng: Crypto::prng(),
}
}
}
-impl<Crypto: HpkeCrypto> std::fmt::Display for Hpke<Crypto> {
- fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+impl<Crypto: HpkeCrypto> core::fmt::Display for Hpke<Crypto> {
+ fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
write!(
f,
"{}_{}_{}_{}",
@@ -1368,7 +1384,7 @@
kem_id,
kdf_id,
aead_id,
- prng: RwLock::new(Crypto::prng()),
+ prng: Crypto::prng(),
}
}
@@ -1387,7 +1403,7 @@
/// The encapsulated secret is returned together with the context.
/// If the secret key is missing in an authenticated mode, an error is returned.
pub fn setup_sender(
- &self,
+ &mut self,
pk_r: &HpkePublicKey,
info: &[u8],
psk: Option<&[u8]>,
@@ -1474,7 +1490,7 @@
/// Returns the encapsulated secret and the ciphertext, or an error.
#[allow(clippy::too_many_arguments)]
pub fn seal(
- &self,
+ &mut self,
pk_r: &HpkePublicKey,
info: &[u8],
aad: &[u8],
@@ -1530,7 +1546,7 @@
/// exporter context and length.
#[allow(clippy::too_many_arguments)]
pub fn send_export(
- &self,
+ &mut self,
pk_r: &HpkePublicKey,
info: &[u8],
psk: Option<&[u8]>,
@@ -1670,9 +1686,8 @@
/// This is equivalent to `derive_key_pair(random_vector(sk.len()))`
///
/// Returns an `HpkeKeyPair`.
- pub fn generate_key_pair(&self) -> Result<HpkeKeyPair, HpkeError> {
- let mut prng = self.prng.write().map_err(|_| HpkeError::LockPoisoned)?;
- let (sk, pk) = kem::key_gen::<Crypto>(self.kem_id, &mut prng)?;
+ pub fn generate_key_pair(&mut self) -> Result<HpkeKeyPair, HpkeError> {
+ let (sk, pk) = kem::key_gen::<Crypto>(self.kem_id, &mut self.prng)?;
Ok(HpkeKeyPair::new(sk, pk))
}
@@ -1686,8 +1701,8 @@
}
#[inline]
- pub(crate) fn random(&self, len: usize) -> Result<Vec<u8>, HpkeError> {
- let mut prng = self.prng.write().map_err(|_| HpkeError::LockPoisoned)?;
+ pub(crate) fn random(&mut self, len: usize) -> Result<Vec<u8>, HpkeError> {
+ let prng = &mut self.prng;
let mut out = vec![0u8; len];
#[cfg(feature = "hpke-test-prng")]
@@ -1790,8 +1805,8 @@
}
#[cfg(not(feature = "hazmat"))]
-impl std::fmt::Debug for HpkePrivateKey {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
+impl core::fmt::Debug for HpkePrivateKey {
+ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> Result<(), core::fmt::Error> {
f.debug_struct("HpkePrivateKey")
.field("value", &"***")
.finish()
@@ -1799,8 +1814,8 @@
}
#[cfg(feature = "hazmat")]
-impl std::fmt::Debug for HpkePrivateKey {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
+impl core::fmt::Debug for HpkePrivateKey {
+ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> Result<(), core::fmt::Error> {
f.debug_struct("HpkePrivateKey")
.field("value", &self.value)
.finish()
@@ -1887,14 +1902,15 @@
/// Test util module. Should be moved really.
#[cfg(feature = "hpke-test")]
pub mod test_util {
+ use alloc::{format, string::String, vec, vec::Vec};
+
use crate::HpkeError;
use hpke_rs_crypto::{HpkeCrypto, HpkeTestRng};
impl<Crypto: HpkeCrypto> super::Hpke<Crypto> {
/// Set PRNG state for testing.
- pub fn seed(&self, seed: &[u8]) -> Result<(), HpkeError> {
- let mut prng = self.prng.write().map_err(|_| HpkeError::LockPoisoned)?;
- prng.seed(seed);
+ pub fn seed(&mut self, seed: &[u8]) -> Result<(), HpkeError> {
+ self.prng.seed(seed);
Ok(())
}
}
diff --git a/src/hpke_rs/prelude.rs.html b/src/hpke_rs/prelude.rs.html
index dd7776a..41db4f7 100644
--- a/src/hpke_rs/prelude.rs.html
+++ b/src/hpke_rs/prelude.rs.html
@@ -7,5 +7,5 @@
//! Include this to get access to all the public functions of HPKE.
pub use super::{Mode as HpkeMode, *};
-pub use std::convert::TryFrom;
+pub use core::convert::TryFrom;
\ No newline at end of file
diff --git a/src/hpke_rs/util.rs.html b/src/hpke_rs/util.rs.html
index 5e150a7..f3a73c0 100644
--- a/src/hpke_rs/util.rs.html
+++ b/src/hpke_rs/util.rs.html
@@ -19,7 +19,11 @@
19
20
21
-#[inline]
+22
+23
+
use alloc::vec::Vec;
+
+#[inline]
pub(crate) fn concat(values: &[&[u8]]) -> Vec<u8> {
values.join(&[][..])
}
Struct hpke_rs::HpkePublicKey
source · pub struct HpkePublicKey { /* private fields */ }
Expand description
An HPKE public key is a byte vector.
-Implementations§
source§impl HpkePublicKey
impl HpkePublicKey
sourcepub fn new(value: Vec<u8>) -> Self
pub fn new(value: Vec<u8>) -> Self
Create a new HPKE public key. +
Struct hpke_rs::HpkePublicKey
source · pub struct HpkePublicKey { /* private fields */ }
Expand description
An HPKE public key is a byte vector.
+Implementations§
Trait Implementations§
source§impl Clone for HpkePublicKey
impl Clone for HpkePublicKey
source§fn clone(&self) -> HpkePublicKey
fn clone(&self) -> HpkePublicKey
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for HpkePublicKey
impl Debug for HpkePublicKey
source§impl Default for HpkePublicKey
impl Default for HpkePublicKey
source§fn default() -> HpkePublicKey
fn default() -> HpkePublicKey
source§impl<'de> Deserialize<'de> for HpkePublicKey
impl<'de> Deserialize<'de> for HpkePublicKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where - __D: Deserializer<'de>,
source§impl Deserialize for &HpkePublicKey
impl Deserialize for &HpkePublicKey
source§fn tls_deserialize<R: Read>(_: &mut R) -> Result<Self, Error>
fn tls_deserialize<R: Read>(_: &mut R) -> Result<Self, Error>
bytes
from the provided a std::io::Read
-and returns the populated struct. Read moresource§impl Deserialize for HpkePublicKey
impl Deserialize for HpkePublicKey
Trait Implementations§
source§impl Clone for HpkePublicKey
impl Clone for HpkePublicKey
source§fn clone(&self) -> HpkePublicKey
fn clone(&self) -> HpkePublicKey
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for HpkePublicKey
impl Debug for HpkePublicKey
source§impl Default for HpkePublicKey
impl Default for HpkePublicKey
source§fn default() -> HpkePublicKey
fn default() -> HpkePublicKey
source§impl<'de> Deserialize<'de> for HpkePublicKey
impl<'de> Deserialize<'de> for HpkePublicKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,
source§impl Deserialize for &HpkePublicKey
impl Deserialize for &HpkePublicKey
source§fn tls_deserialize<R: Read>(_: &mut R) -> Result<Self, Error>
fn tls_deserialize<R: Read>(_: &mut R) -> Result<Self, Error>
bytes
from the provided a std::io::Read
and returns the populated struct. Read moresource§impl From<&[u8]> for HpkePublicKey
impl From<&[u8]> for HpkePublicKey
source§impl PartialEq<HpkePublicKey> for HpkePublicKey
impl PartialEq<HpkePublicKey> for HpkePublicKey
source§impl Deserialize for HpkePublicKey
impl Deserialize for HpkePublicKey
source§fn tls_deserialize<R: Read>(bytes: &mut R) -> Result<Self, Error>
fn tls_deserialize<R: Read>(bytes: &mut R) -> Result<Self, Error>
bytes
from the provided a std::io::Read
+and returns the populated struct. Read moresource§impl From<&[u8]> for HpkePublicKey
impl From<&[u8]> for HpkePublicKey
source§impl PartialEq<HpkePublicKey> for HpkePublicKey
impl PartialEq<HpkePublicKey> for HpkePublicKey
source§fn eq(&self, other: &HpkePublicKey) -> bool
fn eq(&self, other: &HpkePublicKey) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for &HpkePublicKey
impl Serialize for &HpkePublicKey
source§impl Serialize for HpkePublicKey
impl Serialize for HpkePublicKey
source§impl Serialize for HpkePublicKey
impl Serialize for HpkePublicKey
source§impl Size for &HpkePublicKey
impl Size for &HpkePublicKey
fn tls_serialized_len(&self) -> usize
source§impl Size for HpkePublicKey
impl Size for HpkePublicKey
fn tls_serialized_len(&self) -> usize
impl StructuralPartialEq for HpkePublicKey
Auto Trait Implementations§
impl RefUnwindSafe for HpkePublicKey
impl Send for HpkePublicKey
impl Sync for HpkePublicKey
impl Unpin for HpkePublicKey
impl UnwindSafe for HpkePublicKey
Blanket Implementations§
source§impl Serialize for &HpkePublicKey
impl Serialize for &HpkePublicKey
source§impl Serialize for HpkePublicKey
impl Serialize for HpkePublicKey
source§impl Serialize for HpkePublicKey
impl Serialize for HpkePublicKey
source§impl Size for &HpkePublicKey
impl Size for &HpkePublicKey
fn tls_serialized_len(&self) -> usize
source§impl Size for HpkePublicKey
impl Size for HpkePublicKey
fn tls_serialized_len(&self) -> usize
impl StructuralPartialEq for HpkePublicKey
Auto Trait Implementations§
impl RefUnwindSafe for HpkePublicKey
impl Send for HpkePublicKey
impl Sync for HpkePublicKey
impl Unpin for HpkePublicKey
impl UnwindSafe for HpkePublicKey
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> From<T> for T
impl<T> From<T> for T
source§fn from(t: T) -> T
fn from(t: T) -> T
Returns the argument unchanged.
diff --git a/hpke_rs/test_util/fn.bytes_to_hex.html b/hpke_rs/test_util/fn.bytes_to_hex.html index c47028a..a04498e 100644 --- a/hpke_rs/test_util/fn.bytes_to_hex.html +++ b/hpke_rs/test_util/fn.bytes_to_hex.html @@ -1,2 +1,2 @@ -Function hpke_rs::test_util::bytes_to_hex
source · pub fn bytes_to_hex(bytes: &[u8]) -> String
Expand description
Convert bytes
to a hex string.
Function hpke_rs::test_util::hex_to_bytes
source · pub fn hex_to_bytes(hex: &str) -> Vec<u8>
Expand description
Convert a hex string to a byte vector.
+Function hpke_rs::test_util::hex_to_bytes_option
source · pub fn hex_to_bytes_option(hex: Option<String>) -> Vec<u8>
Expand description
Convert a hex string to a byte vector. +
Function hpke_rs::test_util::vec_to_option_slice
source · pub fn vec_to_option_slice(v: &[u8]) -> Option<&[u8]>
Expand description
Convert a byte slice into byte slice option. +
Expand description
Test util module. Should be moved really.
+Expand description
Test util module. Should be moved really.
Functions
- Convert
bytes
to a hex string. - Convert a hex string to a byte vector.
- Convert a hex string to a byte vector. If the input is
None
, this returns an empty vector. - Convert a byte slice into byte slice option. Returns
Nonce
if the byte slice is empty andSome(v)
otherwise.
Type Alias hpke_rs::HPKEKeyPair
source · pub type HPKEKeyPair = HpkeKeyPair;
Aliased Type§
struct HPKEKeyPair { /* private fields */ }
Implementations§
source§impl HpkeKeyPair
impl HpkeKeyPair
sourcepub fn new(sk: Vec<u8>, pk: Vec<u8>) -> Self
pub fn new(sk: Vec<u8>, pk: Vec<u8>) -> Self
Create a new HPKE key pair. +
Type Alias hpke_rs::HPKEKeyPair
source · pub type HPKEKeyPair = HpkeKeyPair;
Aliased Type§
struct HPKEKeyPair { /* private fields */ }
Implementations§
source§impl HpkeKeyPair
impl HpkeKeyPair
sourcepub fn new(sk: Vec<u8>, pk: Vec<u8>) -> Self
pub fn new(sk: Vec<u8>, pk: Vec<u8>) -> Self
Create a new HPKE key pair. Consumes the private and public key bytes.
-sourcepub fn private_key(&self) -> &HpkePrivateKey
pub fn private_key(&self) -> &HpkePrivateKey
Get a reference to the HPKE private key of this key pair.
-sourcepub fn public_key(&self) -> &HpkePublicKey
pub fn public_key(&self) -> &HpkePublicKey
Get a reference to the HPKE public key of this key pair.
-sourcepub fn into_keys(self) -> (HpkePrivateKey, HpkePublicKey)
pub fn into_keys(self) -> (HpkePrivateKey, HpkePublicKey)
Split the key pair into the two keys
-sourcepub fn from_keys(private_key: HpkePrivateKey, public_key: HpkePublicKey) -> Self
pub fn from_keys(private_key: HpkePrivateKey, public_key: HpkePublicKey) -> Self
Build a key pair from two keys
-Trait Implementations§
source§impl Clone for HpkeKeyPair
impl Clone for HpkeKeyPair
source§fn clone(&self) -> HpkeKeyPair
fn clone(&self) -> HpkeKeyPair
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for HpkeKeyPair
impl Debug for HpkeKeyPair
source§impl Default for HpkeKeyPair
impl Default for HpkeKeyPair
source§fn default() -> HpkeKeyPair
fn default() -> HpkeKeyPair
source§impl<'de> Deserialize<'de> for HpkeKeyPair
impl<'de> Deserialize<'de> for HpkeKeyPair
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where - __D: Deserializer<'de>,
source§impl Serialize for HpkeKeyPair
impl Serialize for HpkeKeyPair
sourcepub fn private_key(&self) -> &HpkePrivateKey
pub fn private_key(&self) -> &HpkePrivateKey
Get a reference to the HPKE private key of this key pair.
+sourcepub fn public_key(&self) -> &HpkePublicKey
pub fn public_key(&self) -> &HpkePublicKey
Get a reference to the HPKE public key of this key pair.
+sourcepub fn into_keys(self) -> (HpkePrivateKey, HpkePublicKey)
pub fn into_keys(self) -> (HpkePrivateKey, HpkePublicKey)
Split the key pair into the two keys
+sourcepub fn from_keys(private_key: HpkePrivateKey, public_key: HpkePublicKey) -> Self
pub fn from_keys(private_key: HpkePrivateKey, public_key: HpkePublicKey) -> Self
Build a key pair from two keys
+Trait Implementations§
source§impl Clone for HpkeKeyPair
impl Clone for HpkeKeyPair
source§fn clone(&self) -> HpkeKeyPair
fn clone(&self) -> HpkeKeyPair
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for HpkeKeyPair
impl Debug for HpkeKeyPair
source§impl Default for HpkeKeyPair
impl Default for HpkeKeyPair
source§fn default() -> HpkeKeyPair
fn default() -> HpkeKeyPair
source§impl<'de> Deserialize<'de> for HpkeKeyPair
impl<'de> Deserialize<'de> for HpkeKeyPair
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,
Type Alias hpke_rs::HPKEPrivateKey
source · pub type HPKEPrivateKey = HpkePrivateKey;
Aliased Type§
struct HPKEPrivateKey { /* private fields */ }
Implementations§
source§impl HpkePrivateKey
impl HpkePrivateKey
sourcepub fn new(b: Vec<u8>) -> Self
pub fn new(b: Vec<u8>) -> Self
Create a new HPKE private key. +
Type Alias hpke_rs::HPKEPrivateKey
source · pub type HPKEPrivateKey = HpkePrivateKey;
Aliased Type§
struct HPKEPrivateKey { /* private fields */ }
Implementations§
Trait Implementations§
source§impl Clone for HpkePrivateKey
impl Clone for HpkePrivateKey
source§fn clone(&self) -> HpkePrivateKey
fn clone(&self) -> HpkePrivateKey
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for HpkePrivateKey
impl Debug for HpkePrivateKey
source§impl Default for HpkePrivateKey
impl Default for HpkePrivateKey
source§fn default() -> HpkePrivateKey
fn default() -> HpkePrivateKey
source§impl<'de> Deserialize<'de> for HpkePrivateKey
impl<'de> Deserialize<'de> for HpkePrivateKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where - __D: Deserializer<'de>,
source§impl From<&[u8]> for HpkePrivateKey
impl From<&[u8]> for HpkePrivateKey
source§impl PartialEq<HpkePrivateKey> for HpkePrivateKey
impl PartialEq<HpkePrivateKey> for HpkePrivateKey
Hopefully constant time comparison of the two values as long as they have the +
Trait Implementations§
source§impl Clone for HpkePrivateKey
impl Clone for HpkePrivateKey
source§fn clone(&self) -> HpkePrivateKey
fn clone(&self) -> HpkePrivateKey
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for HpkePrivateKey
impl Debug for HpkePrivateKey
source§impl Default for HpkePrivateKey
impl Default for HpkePrivateKey
source§fn default() -> HpkePrivateKey
fn default() -> HpkePrivateKey
source§impl<'de> Deserialize<'de> for HpkePrivateKey
impl<'de> Deserialize<'de> for HpkePrivateKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,
source§impl From<&[u8]> for HpkePrivateKey
impl From<&[u8]> for HpkePrivateKey
source§impl PartialEq<HpkePrivateKey> for HpkePrivateKey
impl PartialEq<HpkePrivateKey> for HpkePrivateKey
Hopefully constant time comparison of the two values as long as they have the same length.
-source§fn eq(&self, other: &Self) -> bool
fn eq(&self, other: &Self) -> bool
self
and other
values to be equal, and is used
+source§impl Serialize for HpkePrivateKey
impl Serialize for HpkePrivateKey
source§impl Zeroize for HpkePrivateKey
impl Zeroize for HpkePrivateKey
source§impl Serialize for HpkePrivateKey
impl Serialize for HpkePrivateKey
Type Alias hpke_rs::HPKEPublicKey
source · pub type HPKEPublicKey = HpkePublicKey;
Aliased Type§
struct HPKEPublicKey { /* private fields */ }
Implementations§
source§impl HpkePublicKey
impl HpkePublicKey
sourcepub fn new(value: Vec<u8>) -> Self
pub fn new(value: Vec<u8>) -> Self
Create a new HPKE public key. +
Type Alias hpke_rs::HPKEPublicKey
source · pub type HPKEPublicKey = HpkePublicKey;
Aliased Type§
struct HPKEPublicKey { /* private fields */ }
Implementations§
Trait Implementations§
source§impl Clone for HpkePublicKey
impl Clone for HpkePublicKey
source§fn clone(&self) -> HpkePublicKey
fn clone(&self) -> HpkePublicKey
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for HpkePublicKey
impl Debug for HpkePublicKey
source§impl Default for HpkePublicKey
impl Default for HpkePublicKey
source§fn default() -> HpkePublicKey
fn default() -> HpkePublicKey
source§impl<'de> Deserialize<'de> for HpkePublicKey
impl<'de> Deserialize<'de> for HpkePublicKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where - __D: Deserializer<'de>,
source§impl Deserialize for HpkePublicKey
impl Deserialize for HpkePublicKey
Trait Implementations§
source§impl Clone for HpkePublicKey
impl Clone for HpkePublicKey
source§fn clone(&self) -> HpkePublicKey
fn clone(&self) -> HpkePublicKey
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for HpkePublicKey
impl Debug for HpkePublicKey
source§impl Default for HpkePublicKey
impl Default for HpkePublicKey
source§fn default() -> HpkePublicKey
fn default() -> HpkePublicKey
source§impl<'de> Deserialize<'de> for HpkePublicKey
impl<'de> Deserialize<'de> for HpkePublicKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
+ __D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,
source§impl Deserialize for HpkePublicKey
impl Deserialize for HpkePublicKey
source§fn tls_deserialize<R: Read>(bytes: &mut R) -> Result<Self, Error>
fn tls_deserialize<R: Read>(bytes: &mut R) -> Result<Self, Error>
bytes
from the provided a std::io::Read
and returns the populated struct. Read moresource§impl From<&[u8]> for HpkePublicKey
impl From<&[u8]> for HpkePublicKey
source§impl PartialEq<HpkePublicKey> for HpkePublicKey
impl PartialEq<HpkePublicKey> for HpkePublicKey
source§impl From<&[u8]> for HpkePublicKey
impl From<&[u8]> for HpkePublicKey
source§impl PartialEq<HpkePublicKey> for HpkePublicKey
impl PartialEq<HpkePublicKey> for HpkePublicKey
source§fn eq(&self, other: &HpkePublicKey) -> bool
fn eq(&self, other: &HpkePublicKey) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for HpkePublicKey
impl Serialize for HpkePublicKey
source§impl Serialize for HpkePublicKey
impl Serialize for HpkePublicKey
source§impl Size for HpkePublicKey
impl Size for HpkePublicKey
fn tls_serialized_len(&self) -> usize
impl StructuralPartialEq for HpkePublicKey
source§impl Serialize for HpkePublicKey
impl Serialize for HpkePublicKey
source§impl Serialize for HpkePublicKey
impl Serialize for HpkePublicKey
source§impl Size for HpkePublicKey
impl Size for HpkePublicKey
fn tls_serialized_len(&self) -> usize
impl StructuralPartialEq for HpkePublicKey
RwLock
.","The message limit for this AEAD, key, and nonce.","PSK input is required but missing.","HPKE supports four modes.","Error opening an HPKE ciphertext.","HPKE with PSK.","Unknown HPKE mode.","PSK input is provided but not needed.","Get the raw key as byte slice.","Get the raw key as byte slice.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","7.1.2. DeriveKeyPair Derive a key pair for the used KEM …","","","","","","","","","5.3. Secret Export","","","","","","","","","","","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","","","","Returns the argument unchanged.","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Build a key pair from two keys","Cryptographic Dependencies Randomized algorithm to …","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Split the key pair into the two keys","Creating the Encryption Context Generate the HPKE context …","Create a new HPKE public key. Consumes the public key …","Create a new HPKE private key. Consumes the private key …","Create a new HPKE key pair. Consumes the private and …","Set up the configuration for HPKE.","5.2. Encryption and Decryption","Single-Shot APIs 6.1. Encryption and DecryptionSingle shot …","Prelude for HPKE. Include this to get access to all the …","Get a reference to the HPKE private key of this key pair.","Get a reference to the HPKE public key of this key pair.","Single-Shot APIs 6.2. Secret ExportSingle shot API to …","5.2. Encryption and Decryption","Single-Shot APIs 6.1. Encryption and DecryptionSingle shot …","Set PRNG state for testing.","Single-Shot APIs 6.2. Secret ExportSingle shot API to …","","","","","Set up an HPKE receiver.","Set up an HPKE sender.","Test util module. Should be moved really.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","The type returned in the event of a conversion error.","","Simple and safe type conversions that may fail in a …","Performs the conversion.","Convert bytes
to a hex string.","Convert a hex string to a byte vector.","Convert a hex string to a byte vector. If the input is None
…","Convert a byte slice into byte slice option. Returns Nonce
…"],"i":[7,7,7,0,5,0,0,0,0,0,0,0,0,5,5,5,5,5,5,5,5,0,5,7,5,5,1,4,14,5,1,4,6,7,8,14,5,1,4,6,7,8,5,1,4,6,7,8,5,1,4,6,7,8,1,4,6,8,1,4,6,7,5,1,4,7,14,14,5,5,1,4,6,7,7,8,8,14,5,5,1,1,1,4,4,4,6,6,6,7,8,6,8,14,5,1,4,6,7,8,6,8,1,4,6,8,14,8,0,6,6,8,14,8,8,8,1,4,6,7,8,8,0,1,1,1,1,1,1,5,1,4,6,7,8,5,7,8,14,5,1,4,6,7,7,8,14,5,1,4,6,7,8,14,5,1,4,6,7,8,4,33,0,0,33,0,0,0,0],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[1,[[3,[2]]]],[4,[[3,[2]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[5,5],[1,1],[4,4],[6,6],[7,7],[[[8,[-1]]],[[8,[-1]]],9],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[],1],[[],4],[[],6],[[[8,[-1]],[3,[2]]],[[11,[6,5]]],9],[-1,[[11,[1]]],12],[-1,[[11,[4]]],12],[-1,[[11,[6]]],12],[-1,[[11,[7]]],12],[[5,5],13],[[1,1],13],[[4,4],13],[[7,7],13],[[[14,[-1]],[3,[2]],15],[[11,[[16,[2]],5]]],9],[[[14,[-1]],17],18,9],[[5,17],18],[[5,17],18],[[1,17],18],[[4,17],[[11,[10,19]]]],[[6,17],18],[[7,17],18],[[7,17],18],[[[8,[-1]],17],18,9],[[[8,[-1]],17],18,[20,9]],[-1,-1,[]],[21,5],[-1,-1,[]],[-1,-1,[]],[[[16,[2]]],1],[[[3,[2]]],1],[[[3,[2]]],4],[-1,-1,[]],[[[16,[2]]],4],[[[10,[[16,[2]],[16,[2]]]]],6],[[[10,[[3,[2]],[3,[2]]]]],6],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[[4,1],6],[[[8,[-1]]],[[11,[6,5]]],9],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[6,[[10,[4,1]]]],[[[8,[-1]],[3,[2]],[3,[2]],[3,[2]],[3,[2]]],[[11,[[14,[-1]],5]]],9],[[[16,[2]]],1],[[[16,[2]]],4],[[[16,[2]],[16,[2]]],6],[[7,22,23,24],[[8,[-1]]],9],[[[14,[-1]],[3,[2]],[3,[2]]],[[11,[[16,[2]],5]]],9],[[[8,[-1]],[3,[2]],4,[3,[2]],[3,[2]],[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[1]]],[[11,[[16,[2]],5]]],9],0,[6,4],[6,1],[[[8,[-1]],[3,[2]],4,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[1]],[3,[2]],15],[[11,[[16,[2]],5]]],9],[[[14,[-1]],[3,[2]],[3,[2]]],[[11,[[16,[2]],5]]],9],[[[8,[-1]],1,[3,[2]],[3,[2]],[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[4]]],[[11,[[10,[[16,[2]],[16,[2]]]],5]]],9],[[[8,[-1]],[3,[2]]],[[11,[10,5]]],9],[[[8,[-1]],1,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[4]],[3,[2]],15],[[11,[[10,[[16,[2]],[16,[2]]]],5]]],9],[[1,-1],11,26],[[4,-1],11,26],[[6,-1],11,26],[[7,-1],11,26],[[[8,[-1]],[3,[2]],4,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[1]]],[[11,[[14,[-1]],5]]],9],[[[8,[-1]],1,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[4]]],[[11,[[10,[[16,[2]],[14,[-1]]]],5]]],9],0,[-1,[[11,[1,27]]],28],[-1,[[11,[1,27]]],28],[[1,-1],[[11,[15,27]]],29],[[1,-1],[[11,[15,27]]],29],[1,15],[1,15],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,30,[]],[-1,30,[]],[-1,30,[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[2,[[11,[7,5]]]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[4,10],0,0,0,[-1,[[11,[-2]]],[],[]],[[[3,[2]]],30],[32,[[16,[2]]]],[[[25,[30]]],[[16,[2]]]],[[[3,[2]]],[[25,[[3,[2]]]]]]],"c":[5,6,7],"p":[[3,"HpkePublicKey",0],[15,"u8"],[15,"slice"],[3,"HpkePrivateKey",0],[4,"HpkeError",0],[3,"HpkeKeyPair",0],[4,"Mode",0],[3,"Hpke",0],[8,"HpkeCrypto",169],[15,"tuple"],[4,"Result",170],[8,"Deserializer",171],[15,"bool"],[3,"Context",0],[15,"usize"],[3,"Vec",172],[3,"Formatter",173],[6,"Result",173],[3,"Error",173],[8,"Debug",173],[4,"Error",174],[4,"KemAlgorithm",175],[4,"KdfAlgorithm",175],[4,"AeadAlgorithm",175],[4,"Option",176],[8,"Serializer",177],[4,"Error",178],[8,"Read",179],[8,"Write",179],[3,"String",180],[3,"TypeId",181],[15,"str"],[8,"TryFrom",161]]}\
+"hpke_rs":{"doc":"HPKE","t":"NNNDNGGGDEDDDNNNNNNNENNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLALLLLLLLLLLLLLALLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLQCIKFFFF","n":["Auth","AuthPsk","Base","Context","CryptoError","HPKEKeyPair","HPKEPrivateKey","HPKEPublicKey","Hpke","HpkeError","HpkeKeyPair","HpkePrivateKey","HpkePublicKey","InconsistentPsk","InsecurePsk","InsufficientRandomness","InvalidConfig","InvalidInput","MessageLimitReached","MissingPsk","Mode","OpenError","Psk","UnknownMode","UnnecessaryPsk","as_slice","as_slice","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","default","default","default","derive_key_pair","deserialize","deserialize","deserialize","deserialize","eq","eq","eq","eq","export","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from_keys","generate_key_pair","into","into","into","into","into","into","into","into_keys","key_schedule","new","new","new","new","open","open","prelude","private_key","public_key","receiver_export","seal","seal","seed","send_export","serialize","serialize","serialize","serialize","setup_receiver","setup_sender","test_util","tls_deserialize","tls_deserialize","tls_serialize","tls_serialize","tls_serialized_len","tls_serialized_len","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","zeroize","Error","HpkeMode","TryFrom","try_from","bytes_to_hex","hex_to_bytes","hex_to_bytes_option","vec_to_option_slice"],"q":[[0,"hpke_rs"],[160,"hpke_rs::prelude"],[164,"hpke_rs::test_util"],[168,"hpke_rs_crypto"],[169,"core::result"],[170,"serde::de"],[171,"alloc::vec"],[172,"core::fmt"],[173,"core::fmt"],[174,"hpke_rs_crypto::types"],[175,"hpke_rs_crypto::types"],[176,"serde::ser"],[177,"tls_codec"],[178,"std::io"],[179,"std::io"],[180,"core::any"]],"d":["Authenticated HPKE.","Authenticated HPKE with PSK.","HPKE Base mode.","The HPKE context. Note that the RFC currently doesn’t …","An error in the crypto library occurred.","","","","The HPKE configuration struct. This holds the …","HPKE Error types.","An HPKE key pair has an HPKE private and public key.","An HPKE private key is a byte vector.","An HPKE public key is a byte vector.","Inconsistent PSK input.","PSK input is too short (needs to be at least 32 bytes).","Unable to collect enough randomness.","Invalid configuration or arguments.","Invalid input.","The message limit for this AEAD, key, and nonce.","PSK input is required but missing.","HPKE supports four modes.","Error opening an HPKE ciphertext.","HPKE with PSK.","Unknown HPKE mode.","PSK input is provided but not needed.","Get the raw key as byte slice.","Get the raw key as byte slice.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","7.1.2. DeriveKeyPair Derive a key pair for the used KEM …","","","","","","","","","5.3. Secret Export","","","","","","","","","","","Returns the argument unchanged.","","Returns the argument unchanged.","","","Returns the argument unchanged.","","Returns the argument unchanged.","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Build a key pair from two keys","Cryptographic Dependencies Randomized algorithm to …","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Split the key pair into the two keys","Creating the Encryption Context Generate the HPKE context …","Create a new HPKE public key. Consumes the public key …","Create a new HPKE private key. Consumes the private key …","Create a new HPKE key pair. Consumes the private and …","Set up the configuration for HPKE.","5.2. Encryption and Decryption","Single-Shot APIs 6.1. Encryption and DecryptionSingle shot …","Prelude for HPKE. Include this to get access to all the …","Get a reference to the HPKE private key of this key pair.","Get a reference to the HPKE public key of this key pair.","Single-Shot APIs 6.2. Secret ExportSingle shot API to …","5.2. Encryption and Decryption","Single-Shot APIs 6.1. Encryption and DecryptionSingle shot …","Set PRNG state for testing.","Single-Shot APIs 6.2. Secret ExportSingle shot API to …","","","","","Set up an HPKE receiver.","Set up an HPKE sender.","Test util module. Should be moved really.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","The type returned in the event of a conversion error.","","Simple and safe type conversions that may fail in a …","Performs the conversion.","Convert bytes
to a hex string.","Convert a hex string to a byte vector.","Convert a hex string to a byte vector. If the input is None
…","Convert a byte slice into byte slice option. Returns Nonce
…"],"i":[7,7,7,0,5,0,0,0,0,0,0,0,0,5,5,5,5,5,5,5,0,5,7,5,5,1,4,14,5,1,4,6,7,8,14,5,1,4,6,7,8,5,1,4,6,7,8,5,1,4,6,7,8,1,4,6,8,1,4,6,7,5,1,4,7,14,14,5,5,1,4,6,7,7,8,8,14,5,5,1,1,1,4,4,4,6,6,6,7,8,6,8,14,5,1,4,6,7,8,6,8,1,4,6,8,14,8,0,6,6,8,14,8,8,8,1,4,6,7,8,8,0,1,1,1,1,1,1,5,1,4,6,7,8,5,7,8,14,5,1,4,6,7,7,8,14,5,1,4,6,7,8,14,5,1,4,6,7,8,4,33,0,0,33,0,0,0,0],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[1,[[3,[2]]]],[4,[[3,[2]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[5,5],[1,1],[4,4],[6,6],[7,7],[[[8,[-1]]],[[8,[-1]]],9],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[-1,-2],10,[],[]],[[],1],[[],4],[[],6],[[[8,[-1]],[3,[2]]],[[11,[6,5]]],9],[-1,[[11,[1]]],12],[-1,[[11,[4]]],12],[-1,[[11,[6]]],12],[-1,[[11,[7]]],12],[[5,5],13],[[1,1],13],[[4,4],13],[[7,7],13],[[[14,[-1]],[3,[2]],15],[[11,[[16,[2]],5]]],9],[[[14,[-1]],17],18,9],[[5,17],18],[[5,17],18],[[1,17],18],[[4,17],[[11,[10,19]]]],[[6,17],18],[[7,17],18],[[7,17],18],[[[8,[-1]],17],18,9],[[[8,[-1]],17],18,[20,9]],[-1,-1,[]],[21,5],[-1,-1,[]],[[[16,[2]]],1],[[[3,[2]]],1],[-1,-1,[]],[[[3,[2]]],4],[-1,-1,[]],[[[16,[2]]],4],[[[10,[[3,[2]],[3,[2]]]]],6],[[[10,[[16,[2]],[16,[2]]]]],6],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[[4,1],6],[[[8,[-1]]],[[11,[6,5]]],9],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[6,[[10,[4,1]]]],[[[8,[-1]],[3,[2]],[3,[2]],[3,[2]],[3,[2]]],[[11,[[14,[-1]],5]]],9],[[[16,[2]]],1],[[[16,[2]]],4],[[[16,[2]],[16,[2]]],6],[[7,22,23,24],[[8,[-1]]],9],[[[14,[-1]],[3,[2]],[3,[2]]],[[11,[[16,[2]],5]]],9],[[[8,[-1]],[3,[2]],4,[3,[2]],[3,[2]],[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[1]]],[[11,[[16,[2]],5]]],9],0,[6,4],[6,1],[[[8,[-1]],[3,[2]],4,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[1]],[3,[2]],15],[[11,[[16,[2]],5]]],9],[[[14,[-1]],[3,[2]],[3,[2]]],[[11,[[16,[2]],5]]],9],[[[8,[-1]],1,[3,[2]],[3,[2]],[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[4]]],[[11,[[10,[[16,[2]],[16,[2]]]],5]]],9],[[[8,[-1]],[3,[2]]],[[11,[10,5]]],9],[[[8,[-1]],1,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[4]],[3,[2]],15],[[11,[[10,[[16,[2]],[16,[2]]]],5]]],9],[[1,-1],11,26],[[4,-1],11,26],[[6,-1],11,26],[[7,-1],11,26],[[[8,[-1]],[3,[2]],4,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[1]]],[[11,[[14,[-1]],5]]],9],[[[8,[-1]],1,[3,[2]],[25,[[3,[2]]]],[25,[[3,[2]]]],[25,[4]]],[[11,[[10,[[16,[2]],[14,[-1]]]],5]]],9],0,[-1,[[11,[1,27]]],28],[-1,[[11,[1,27]]],28],[[1,-1],[[11,[15,27]]],29],[[1,-1],[[11,[15,27]]],29],[1,15],[1,15],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,30,[]],[-1,30,[]],[-1,30,[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[2,[[11,[7,5]]]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,[[11,[-2]]],[],[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[-1,31,[]],[4,10],0,0,0,[-1,[[11,[-2]]],[],[]],[[[3,[2]]],30],[32,[[16,[2]]]],[[[25,[30]]],[[16,[2]]]],[[[3,[2]]],[[25,[[3,[2]]]]]]],"c":[5,6,7],"p":[[3,"HpkePublicKey",0],[15,"u8"],[15,"slice"],[3,"HpkePrivateKey",0],[4,"HpkeError",0],[3,"HpkeKeyPair",0],[4,"Mode",0],[3,"Hpke",0],[8,"HpkeCrypto",168],[15,"tuple"],[4,"Result",169],[8,"Deserializer",170],[15,"bool"],[3,"Context",0],[15,"usize"],[3,"Vec",171],[3,"Formatter",172],[6,"Result",172],[3,"Error",172],[8,"Debug",172],[4,"Error",173],[4,"KemAlgorithm",174],[4,"KdfAlgorithm",174],[4,"AeadAlgorithm",174],[4,"Option",175],[8,"Serializer",176],[4,"Error",177],[8,"Read",178],[8,"Write",178],[3,"String",179],[3,"TypeId",180],[15,"str"],[8,"TryFrom",160]]}\
}');
if (typeof window !== 'undefined' && window.initSearch) {window.initSearch(searchIndex)};
if (typeof exports !== 'undefined') {exports.searchIndex = searchIndex};
diff --git a/src/hpke_rs/dh_kem.rs.html b/src/hpke_rs/dh_kem.rs.html
index 76d229d..e626cdb 100644
--- a/src/hpke_rs/dh_kem.rs.html
+++ b/src/hpke_rs/dh_kem.rs.html
@@ -175,9 +175,13 @@
175
176
177
+178
+179
//! DH KEM as described in §4.1. DH-Based KEM.
-use hpke_rs_crypto::{error::Error, types::KemAlgorithm, HpkeCrypto};
+use alloc::{string::ToString, vec::Vec};
+
+use hpke_rs_crypto::{error::Error, types::KemAlgorithm, HpkeCrypto};
use crate::util::*;
use crate::{
diff --git a/src/hpke_rs/kdf.rs.html b/src/hpke_rs/kdf.rs.html
index e71827a..63956d6 100644
--- a/src/hpke_rs/kdf.rs.html
+++ b/src/hpke_rs/kdf.rs.html
@@ -28,7 +28,11 @@
28
29
30
-
use hpke_rs_crypto::{error::Error, types::KdfAlgorithm, HpkeCrypto};
+31
+32
+
use alloc::vec::Vec;
+
+use hpke_rs_crypto::{error::Error, types::KdfAlgorithm, HpkeCrypto};
use crate::util::concat;
diff --git a/src/hpke_rs/kem.rs.html b/src/hpke_rs/kem.rs.html
index 3fbf089..e860613 100644
--- a/src/hpke_rs/kem.rs.html
+++ b/src/hpke_rs/kem.rs.html
@@ -97,7 +97,11 @@
97
98
99
-
use hpke_rs_crypto::{error::Error, types::KemAlgorithm, HpkeCrypto};
+100
+101
+
use alloc::vec::Vec;
+
+use hpke_rs_crypto::{error::Error, types::KemAlgorithm, HpkeCrypto};
use crate::dh_kem;
use crate::util;
diff --git a/src/hpke_rs/lib.rs.html b/src/hpke_rs/lib.rs.html
index e14bd4b..18ff4d7 100644
--- a/src/hpke_rs/lib.rs.html
+++ b/src/hpke_rs/lib.rs.html
@@ -994,6 +994,14 @@
994
995
996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
#![doc = include_str!("../Readme.md")]
#![forbid(unsafe_code, unused_must_use, unstable_features)]
#![deny(
@@ -1004,8 +1012,18 @@
unused_extern_crates,
unused_qualifications
)]
+#![cfg_attr(not(test), no_std)]
-use std::sync::RwLock;
+extern crate alloc;
+#[cfg(feature = "std")]
+extern crate std;
+
+use alloc::{
+ format,
+ string::{String, ToString},
+ vec,
+ vec::Vec,
+};
#[cfg(feature = "hpke-test-prng")]
use hpke_rs_crypto::HpkeTestRng;
@@ -1075,15 +1093,13 @@
/// Unable to collect enough randomness.
InsufficientRandomness,
-
- /// A concurrency issue with an [`RwLock`].
- LockPoisoned,
}
-impl std::error::Error for HpkeError {}
+#[cfg(feature = "std")]
+impl std::error::Error for HpkeError {}
-impl std::fmt::Display for HpkeError {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+impl core::fmt::Display for HpkeError {
+ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "HPKE Error: {:?}", self)
}
}
@@ -1155,8 +1171,8 @@
AuthPsk = 0x03,
}
-impl std::fmt::Display for Mode {
- fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+impl core::fmt::Display for Mode {
+ fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
write!(f, "{:?}", self)
}
}
@@ -1198,8 +1214,8 @@
}
#[cfg(feature = "hazmat")]
-impl<Crypto: HpkeCrypto> std::fmt::Debug for Context<Crypto> {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+impl<Crypto: HpkeCrypto> core::fmt::Debug for Context<Crypto> {
+ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(
f,
"Context {{\n key: {:?}\n nonce: {:?}\n exporter_secret: {:?}\n seq no: {:?}\n}}",
@@ -1209,8 +1225,8 @@
}
#[cfg(not(feature = "hazmat"))]
-impl<Crypto: HpkeCrypto> std::fmt::Debug for Context<Crypto> {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+impl<Crypto: HpkeCrypto> core::fmt::Debug for Context<Crypto> {
+ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(
f,
"Context {{\n key: {:?}\n nonce: {:?}\n exporter_secret: {:?}\n seq no: {:?}\n}}",
@@ -1327,7 +1343,7 @@
kem_id: KemAlgorithm,
kdf_id: KdfAlgorithm,
aead_id: AeadAlgorithm,
- prng: RwLock<Crypto::HpkePrng>,
+ prng: Crypto::HpkePrng,
}
impl<Crypto: 'static + HpkeCrypto> Clone for Hpke<Crypto> {
@@ -1337,13 +1353,13 @@
kem_id: self.kem_id,
kdf_id: self.kdf_id,
aead_id: self.aead_id,
- prng: RwLock::new(Crypto::prng()),
+ prng: Crypto::prng(),
}
}
}
-impl<Crypto: HpkeCrypto> std::fmt::Display for Hpke<Crypto> {
- fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+impl<Crypto: HpkeCrypto> core::fmt::Display for Hpke<Crypto> {
+ fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
write!(
f,
"{}_{}_{}_{}",
@@ -1368,7 +1384,7 @@
kem_id,
kdf_id,
aead_id,
- prng: RwLock::new(Crypto::prng()),
+ prng: Crypto::prng(),
}
}
@@ -1387,7 +1403,7 @@
/// The encapsulated secret is returned together with the context.
/// If the secret key is missing in an authenticated mode, an error is returned.
pub fn setup_sender(
- &self,
+ &mut self,
pk_r: &HpkePublicKey,
info: &[u8],
psk: Option<&[u8]>,
@@ -1474,7 +1490,7 @@
/// Returns the encapsulated secret and the ciphertext, or an error.
#[allow(clippy::too_many_arguments)]
pub fn seal(
- &self,
+ &mut self,
pk_r: &HpkePublicKey,
info: &[u8],
aad: &[u8],
@@ -1530,7 +1546,7 @@
/// exporter context and length.
#[allow(clippy::too_many_arguments)]
pub fn send_export(
- &self,
+ &mut self,
pk_r: &HpkePublicKey,
info: &[u8],
psk: Option<&[u8]>,
@@ -1670,9 +1686,8 @@
/// This is equivalent to `derive_key_pair(random_vector(sk.len()))`
///
/// Returns an `HpkeKeyPair`.
- pub fn generate_key_pair(&self) -> Result<HpkeKeyPair, HpkeError> {
- let mut prng = self.prng.write().map_err(|_| HpkeError::LockPoisoned)?;
- let (sk, pk) = kem::key_gen::<Crypto>(self.kem_id, &mut prng)?;
+ pub fn generate_key_pair(&mut self) -> Result<HpkeKeyPair, HpkeError> {
+ let (sk, pk) = kem::key_gen::<Crypto>(self.kem_id, &mut self.prng)?;
Ok(HpkeKeyPair::new(sk, pk))
}
@@ -1686,8 +1701,8 @@
}
#[inline]
- pub(crate) fn random(&self, len: usize) -> Result<Vec<u8>, HpkeError> {
- let mut prng = self.prng.write().map_err(|_| HpkeError::LockPoisoned)?;
+ pub(crate) fn random(&mut self, len: usize) -> Result<Vec<u8>, HpkeError> {
+ let prng = &mut self.prng;
let mut out = vec![0u8; len];
#[cfg(feature = "hpke-test-prng")]
@@ -1790,8 +1805,8 @@
}
#[cfg(not(feature = "hazmat"))]
-impl std::fmt::Debug for HpkePrivateKey {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
+impl core::fmt::Debug for HpkePrivateKey {
+ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> Result<(), core::fmt::Error> {
f.debug_struct("HpkePrivateKey")
.field("value", &"***")
.finish()
@@ -1799,8 +1814,8 @@
}
#[cfg(feature = "hazmat")]
-impl std::fmt::Debug for HpkePrivateKey {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
+impl core::fmt::Debug for HpkePrivateKey {
+ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> Result<(), core::fmt::Error> {
f.debug_struct("HpkePrivateKey")
.field("value", &self.value)
.finish()
@@ -1887,14 +1902,15 @@
/// Test util module. Should be moved really.
#[cfg(feature = "hpke-test")]
pub mod test_util {
+ use alloc::{format, string::String, vec, vec::Vec};
+
use crate::HpkeError;
use hpke_rs_crypto::{HpkeCrypto, HpkeTestRng};
impl<Crypto: HpkeCrypto> super::Hpke<Crypto> {
/// Set PRNG state for testing.
- pub fn seed(&self, seed: &[u8]) -> Result<(), HpkeError> {
- let mut prng = self.prng.write().map_err(|_| HpkeError::LockPoisoned)?;
- prng.seed(seed);
+ pub fn seed(&mut self, seed: &[u8]) -> Result<(), HpkeError> {
+ self.prng.seed(seed);
Ok(())
}
}
diff --git a/src/hpke_rs/prelude.rs.html b/src/hpke_rs/prelude.rs.html
index dd7776a..41db4f7 100644
--- a/src/hpke_rs/prelude.rs.html
+++ b/src/hpke_rs/prelude.rs.html
@@ -7,5 +7,5 @@
//! Include this to get access to all the public functions of HPKE.
pub use super::{Mode as HpkeMode, *};
-pub use std::convert::TryFrom;
+pub use core::convert::TryFrom;
#[inline]
+22
+23
+
use alloc::vec::Vec;
+
+#[inline]
pub(crate) fn concat(values: &[&[u8]]) -> Vec<u8> {
values.join(&[][..])
}