Browse Source

darkirc: Move crypto module into a separate directory.

parazyd 2 years ago
parent
commit
3951152d30

+ 22 - 0
bin/darkirc/src/crypto/mod.rs

@@ -0,0 +1,22 @@
+/* This file is part of DarkFi (https://dark.fi)
+ *
+ * Copyright (C) 2020-2023 Dyne.org foundation
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+
+//! Cryptographic implementations
+
+/// ChaCha box, used for channel encryption, and optionally DM encryption.
+pub mod saltbox;

+ 0 - 0
bin/darkirc/src/crypto.rs → bin/darkirc/src/crypto/saltbox.rs


+ 1 - 1
bin/darkirc/src/irc/client.rs

@@ -32,7 +32,7 @@ use smol::{
 };
 
 use crate::{
-    crypto::{decrypt_privmsg, decrypt_target, encrypt_privmsg},
+    crypto::saltbox::{decrypt_privmsg, decrypt_target, encrypt_privmsg},
     settings,
     settings::{Nick, UserMode, RPL},
     ChannelInfo, PrivMsgEvent,

+ 1 - 1
bin/darkirc/src/main.rs

@@ -54,7 +54,7 @@ pub mod rpc;
 pub mod settings;
 
 use crate::{
-    crypto::KeyPair,
+    crypto::saltbox::KeyPair,
     irc::{IrcConfig, IrcServer},
     privmsg::PrivMsgEvent,
     rpc::JsonRpcInterface,