MCPcopy Create free account
hub / github.com/DNSCrypt/encrypted-dns-server / decapsulate

Method decapsulate

src/pq.rs:98–105  ·  view source on GitHub ↗
(&self, ct_bytes: &[u8])

Source from the content-addressed store, hash-verified

96 }
97
98 pub fn decapsulate(&self, ct_bytes: &[u8]) -> Result<[u8; 32], Error> {
99 ensure!(ct_bytes.len() == XWING_CT_SIZE, "Bad ciphertext length");
100 let mut ss = [0u8; 32];
101 let rc =
102 unsafe { crypto_kem_xwing_dec(ss.as_mut_ptr(), ct_bytes.as_ptr(), self.seed.as_ptr()) };
103 ensure!(rc == 0, "X-Wing decapsulation failed");
104 Ok(ss)
105 }
106}
107
108/// The HKDF context that binds the PQ shared key to the exact signed

Callers 1

decrypt_pq_ciphertextFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected