Add tests for asymmetric keys, add public key export

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
This commit is contained in:
Lee Smet
2025-05-16 15:05:45 +02:00
parent 365814b424
commit 7f55cf4fba
3 changed files with 67 additions and 12 deletions

View File

@@ -69,8 +69,8 @@ impl SymmetricKey {
// Extract nonce from the end of ciphertext
let ciphertext_len = ciphertext.len() - NONCE_SIZE;
let ciphertext = &ciphertext[0..ciphertext_len];
let nonce_bytes = &ciphertext[ciphertext_len..];
let ciphertext = &ciphertext[0..ciphertext_len];
// Create cipher
let cipher = ChaCha20Poly1305::new_from_slice(&self.0)