Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bit of a refactor #1

Merged
merged 10 commits into from
Oct 24, 2022
Prev Previous commit
Next Next commit
Use slice instead of vec
  • Loading branch information
Speykious committed Oct 24, 2022
commit 672f79e04d8956e533d1bbc2c9e17b66255ec8ba
4 changes: 2 additions & 2 deletions src/encryption.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ impl Keys {
self.signature = bincode::serialize(&signature).unwrap();
}

pub fn verify(&self, data: &[u8], signature: Vec<u8>) {
let decoded_signature: Signature = bincode::deserialize(&signature).unwrap();
pub fn verify(&self, data: &[u8], signature: &[u8]) {
let decoded_signature: Signature = bincode::deserialize(signature).unwrap();
let verification = self.keypair.public.verify_strict(data, &decoded_signature);

// TODO: Do this better
Expand Down