Code reformatting.

This commit is contained in:
Revertron
2021-06-09 20:36:36 +02:00
parent 2d12fd0447
commit d513c29cfe
40 changed files with 546 additions and 815 deletions
+5 -4
View File
@@ -1,7 +1,8 @@
use chacha20poly1305::{ChaCha20Poly1305, Key, Nonce};
use chacha20poly1305::aead::{Aead, NewAead, Error};
use std::fmt::{Debug, Formatter};
use std::fmt;
use std::fmt::{Debug, Formatter};
use chacha20poly1305::aead::{Aead, Error, NewAead};
use chacha20poly1305::{ChaCha20Poly1305, Key, Nonce};
pub const ZERO_NONCE: [u8; 12] = [0u8; 12];
@@ -45,7 +46,7 @@ impl Debug for Chacha {
#[cfg(test)]
mod tests {
use crate::crypto::Chacha;
use crate::{to_hex};
use crate::to_hex;
#[test]
pub fn test_chacha() {
+8 -5
View File
@@ -1,12 +1,14 @@
use ecies_ed25519::{SecretKey, PublicKey, Error, encrypt, decrypt};
use rand_old::{CryptoRng, RngCore};
use std::fmt::{Debug, Formatter};
use crate::{to_hex, from_hex};
use std::fmt;
use std::fmt::{Debug, Formatter};
use ecies_ed25519::{decrypt, encrypt, Error, PublicKey, SecretKey};
use rand_old::{CryptoRng, RngCore};
use crate::{from_hex, to_hex};
pub struct CryptoBox {
pub(crate) secret: SecretKey,
pub(crate) public: PublicKey,
pub(crate) public: PublicKey
}
impl CryptoBox {
@@ -67,6 +69,7 @@ impl Clone for CryptoBox {
#[cfg(test)]
mod tests {
use rand::RngCore;
use crate::crypto::CryptoBox;
const TEXT: &str = "Some very secret message";
+2 -3
View File
@@ -1,6 +1,5 @@
mod crypto_box;
mod chacha;
mod crypto_box;
pub use chacha::{Chacha, ZERO_NONCE};
pub use crypto_box::CryptoBox;
pub use chacha::Chacha;
pub use chacha::ZERO_NONCE;