From a7d552ecb276330c0c6cb69a154ea230acfbcfd2 Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Tue, 16 May 2023 15:04:23 +0200 Subject: [PATCH] renaming common module --- src/{common => common_plex}/mod.rs | 2 +- .../common.rs => common_plex/printing.rs} | 0 src/main.rs | 18 +++++++++--------- 3 files changed, 10 insertions(+), 10 deletions(-) rename src/{common => common_plex}/mod.rs (93%) rename src/{common/common.rs => common_plex/printing.rs} (100%) diff --git a/src/common/mod.rs b/src/common_plex/mod.rs similarity index 93% rename from src/common/mod.rs rename to src/common_plex/mod.rs index 92d1ca3..68f6893 100644 --- a/src/common/mod.rs +++ b/src/common_plex/mod.rs @@ -6,4 +6,4 @@ /// Author: Christoph J. Scherr /// License: MIT /// Source: -pub mod common; +pub mod printing; diff --git a/src/common/common.rs b/src/common_plex/printing.rs similarity index 100% rename from src/common/common.rs rename to src/common_plex/printing.rs diff --git a/src/main.rs b/src/main.rs index 4080b22..3e27a58 100644 --- a/src/main.rs +++ b/src/main.rs @@ -21,7 +21,7 @@ mod binary; mod math; mod algo; -mod common; +mod common_plex; use std::{str::FromStr, fmt::Debug}; @@ -180,11 +180,11 @@ pub fn main() { let e = num_bigint::BigInt::from_str(&mod_exp_args.exp.as_str()).expect("could not make bigint"); let f = num_bigint::BigInt::from_str(&mod_exp_args.field.as_str()).expect("could not make bigint"); let num = math::modexp::modular_exponentiation(b.clone(), e, f, args.verbose); - common::common::proc_num(num, args); + common_plex::printing::proc_num(num, args); } MathActions::Modred(mod_red_args) => { let result = math::modred::modred(mod_red_args.polynomial, mod_red_args.relation, args.verbose); - common::common::proc_result(result, args); + common_plex::printing::proc_result(result, args); } MathActions::Pm1(pm1_args) => { let vec: Result, String> = math::pm1::p_minus_one( @@ -192,7 +192,7 @@ pub fn main() { pm1_args.max_prime, args.verbose ); - common::common::proc_result_vec(vec, args); + common_plex::printing::proc_result_vec(vec, args); } } } @@ -206,11 +206,11 @@ pub fn main() { else { result = binary::rotr32(bin_rot_args.base, bin_rot_args.shift_width); } - common::common::proc_num(result, args); + common_plex::printing::proc_num(result, args); }, BinaryActions::Xor(bin_xor_args) => { let result: u128 = binary::xor(bin_xor_args.a, bin_xor_args.b); - common::common::proc_num(result, args); + common_plex::printing::proc_num(result, args); } } } @@ -218,11 +218,11 @@ pub fn main() { match action.action { AlgoActions::Feistel0Inner(alg_fei_args) => { let result: u16 = algo::feistel0::inner(alg_fei_args.input, alg_fei_args.key, args.verbose); - common::common::proc_num(result, args); + common_plex::printing::proc_num(result, args); } AlgoActions::Feistel0SBOX(alg_fsb_args) => { let result: u8 = algo::feistel0::sbox(alg_fsb_args.index); - common::common::proc_num(result, args); + common_plex::printing::proc_num(result, args); } AlgoActions::Feistel0(alg_fe0_args) => { let keys = algo::feistel0::key_scheduler(alg_fe0_args.key); @@ -233,7 +233,7 @@ pub fn main() { else { result = algo::feistel0::encrypt(alg_fe0_args.input, keys, args.verbose); } - common::common::proc_num(result, args); + common_plex::printing::proc_num(result, args); } } }