mirror of
https://github.com/openai/codex.git
synced 2026-10-30 19:18:49 +00:00
refactor(exec-server): inline Noise public key construction
Co-authored-by: Codex noreply@openai.com
This commit is contained in:
co-authored by
Codex noreply@openai.com
parent
2e437487b0
commit
0ec082d602
@@ -47,16 +47,6 @@ impl std::fmt::Debug for NoiseChannelPublicKey {
|
||||
}
|
||||
}
|
||||
|
||||
impl NoiseChannelPublicKey {
|
||||
fn from_keypairs(dh: &DhKeyPair, kem: &KemKeyPair) -> Self {
|
||||
Self {
|
||||
suite: NOISE_CHANNEL_SUITE.to_string(),
|
||||
x25519_public_key: STANDARD.encode(dh.public),
|
||||
mlkem768_public_key: STANDARD.encode(kem.public.as_slice()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Static Noise identity kept for the lifetime of an executor or harness process.
|
||||
#[derive(Clone)]
|
||||
pub struct NoiseChannelIdentity {
|
||||
@@ -74,7 +64,11 @@ impl NoiseChannelIdentity {
|
||||
}
|
||||
|
||||
pub fn public_key(&self) -> NoiseChannelPublicKey {
|
||||
NoiseChannelPublicKey::from_keypairs(&self.dh, &self.kem)
|
||||
NoiseChannelPublicKey {
|
||||
suite: NOISE_CHANNEL_SUITE.to_string(),
|
||||
x25519_public_key: STANDARD.encode(self.dh.public),
|
||||
mlkem768_public_key: STANDARD.encode(self.kem.public.as_slice()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user