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 28, 2024
1 parent ec80684 commit 46f3737
Show file tree
Hide file tree
Showing 5 changed files with 19,732 additions and 36 deletions.
7 changes: 6 additions & 1 deletion src/aead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,11 @@ 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)
}

#[cfg(test)]
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 +360,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 46f3737

Please sign in to comment.