(&self, ct_bytes: &[u8])
| 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 |
no outgoing calls
no test coverage detected