Skip to content

Commit

Permalink
Generate k256 test vectors
Browse files Browse the repository at this point in the history
  • Loading branch information
DanGould committed Aug 27, 2024
1 parent ec80684 commit 51ad4d0
Show file tree
Hide file tree
Showing 5 changed files with 19,731 additions and 36 deletions.
6 changes: 5 additions & 1 deletion src/aead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ impl<A: Aead, Kdf: KdfTrait, Kem: KemTrait> AeadCtx<A, Kdf, Kem> {
.labeled_expand(&self.suite_id, b"sec", exporter_ctx, out_buf)
.map_err(|_| HpkeError::KdfOutputTooLong)
}

pub(crate) fn current_nonce(&self) -> AeadNonce<A> {
mix_nonce::<A>(&self.base_nonce, &self.seq)
}
}

/// The HPKE receiver's context. This is what you use to `open` ciphertexts and `export` secrets.
Expand Down Expand Up @@ -355,7 +359,7 @@ impl<A: Aead, Kdf: KdfTrait, Kem: KemTrait> AeadCtxR<A, Kdf, Kem> {
}

/// The HPKE senders's context. This is what you use to `seal` plaintexts and `export` secrets.
pub struct AeadCtxS<A: Aead, Kdf: KdfTrait, Kem: KemTrait>(AeadCtx<A, Kdf, Kem>);
pub struct AeadCtxS<A: Aead, Kdf: KdfTrait, Kem: KemTrait>(pub(crate) AeadCtx<A, Kdf, Kem>);

// AeadCtx -> AeadCtxS via wrapping
impl<A: Aead, Kdf: KdfTrait, Kem: KemTrait> From<AeadCtx<A, Kdf, Kem>> for AeadCtxS<A, Kdf, Kem> {
Expand Down
Loading

0 comments on commit 51ad4d0

Please sign in to comment.