Added tests and fixed some issues.

I also added documentation.
This commit is contained in:
Hannes 2021-05-14 18:11:48 +02:00
commit 76d7312a9a
6 changed files with 47 additions and 37 deletions

View file

@ -4,7 +4,7 @@ use alloc::vec::Vec;
use serde::{Serialize, Deserialize};
use crate::aead::encrypt;
use aes_gcm_siv::{Key, Nonce, Aes256GcmSiv};
use aes_gcm_siv::aead::{NewAead, AeadInPlace, Error};
use aes_gcm_siv::aead::{NewAead, AeadInPlace};
#[cfg(test)]
use crate::dh::gen_key_pair;
@ -93,9 +93,9 @@ impl From<&[u8]> for Header {
}
}
impl Into<Vec<u8>> for Header {
fn into(self) -> Vec<u8> {
self.concat()
impl From<Header> for Vec<u8> {
fn from(s: Header) -> Self {
s.concat()
}
}