Skip to content

Commit

Permalink
abbility to import types Keypair, PublicKey and SecretKey from crate
Browse files Browse the repository at this point in the history
  • Loading branch information
Nichokas authored Jan 30, 2025
1 parent 9ba5fb9 commit 56b0273
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ mod tests;
pub use encryption::*;
pub use key_exchange::*;

pub use kyberlib::{PublicKey, SecretKey, Keypair};
pub use key_exchange::Keypair;
use anyhow::{anyhow, Context, Error, Result};
use base64::Engine as _;
use bincode::serialize;
use kyberlib::{decapsulate, encapsulate, Keypair, PublicKey, SecretKey, KYBER_CIPHERTEXT_BYTES};
use kyberlib::{decapsulate, encapsulate, KYBER_CIPHERTEXT_BYTES};
use serde::{Deserialize, Serialize};
use zerocopy::AsBytes;

Expand Down Expand Up @@ -87,4 +89,4 @@ pub fn decrypt(encrypted_data: &[u8], server_kp: &Keypair) -> Result<String> {

let plaintext = decrypt_with_key(&chacha_key, &data.nonce, &data.encrypted_msg)?;
String::from_utf8(plaintext).context("UTF-8 inválido")
}
}

0 comments on commit 56b0273

Please sign in to comment.