diff --git a/src/algo_suite.cpp b/src/algo_suite.cpp index 02ea6fc..2de614a 100644 --- a/src/algo_suite.cpp +++ b/src/algo_suite.cpp @@ -23,10 +23,12 @@ void fill_algorithm_suite (algorithm_suite&s) { - static algo_mceqd128 mce128; mce128.register_into_suite (s); + static algo_mceqd192 mce192; + mce192.register_into_suite (s); + static algo_mceqd256 mce256; mce256.register_into_suite (s); diff --git a/src/algos_enc.cpp b/src/algos_enc.cpp index 83d35f7..f34e781 100644 --- a/src/algos_enc.cpp +++ b/src/algos_enc.cpp @@ -37,6 +37,19 @@ int algo_mceqd128::create_keypair (sencode**pub, sencode**priv, prng&rng) return 0; } +int algo_mceqd192::create_keypair (sencode**pub, sencode**priv, prng&rng) +{ + mce_qd::pubkey Pub; + mce_qd::privkey Priv; + + if (mce_qd::generate (Pub, Priv, rng, 16, 8, 27, 4) ) + return 1; + + *pub = Pub.serialize(); + *priv = Priv.serialize(); + return 0; +} + int algo_mceqd256::create_keypair (sencode**pub, sencode**priv, prng&rng) { mce_qd::pubkey Pub; @@ -377,6 +390,17 @@ int algo_mceqd128::encrypt (const bvector&plain, bvector&cipher, (plain, cipher, pubkey, rng); } +int algo_mceqd192::encrypt (const bvector&plain, bvector&cipher, + sencode* pubkey, prng&rng) +{ + return fo_encrypt + < mce_qd::pubkey, + 2816, 6912, 256, + sha384hash, + 1574 > + (plain, cipher, pubkey, rng); +} + int algo_mceqd256::encrypt (const bvector&plain, bvector&cipher, sencode* pubkey, prng&rng) { @@ -399,6 +423,17 @@ int algo_mceqd128::decrypt (const bvector&cipher, bvector&plain, (cipher, plain, privkey); } +int algo_mceqd192::decrypt (const bvector&cipher, bvector&plain, + sencode* privkey) +{ + return fo_decrypt + < mce_qd::privkey, + 2816, 6912, 256, + sha384hash, + 1574 > + (cipher, plain, privkey); +} + int algo_mceqd256::decrypt (const bvector&cipher, bvector&plain, sencode* privkey) { diff --git a/src/algos_enc.h b/src/algos_enc.h index 0c50c43..109dc66 100644 --- a/src/algos_enc.h +++ b/src/algos_enc.h @@ -43,6 +43,28 @@ public: int create_keypair (sencode**pub, sencode**priv, prng&rng); }; +class algo_mceqd192 : public algorithm +{ +public: + bool provides_signatures() { + return false; + } + + bool provides_encryption() { + return true; + } + + std::string get_alg_id() { + return "MCEQD192FO-SHA384-ARCFOUR"; + } + + int encrypt (const bvector&plain, bvector&cipher, + sencode* pubkey, prng&rng); + int decrypt (const bvector&cipher, bvector&plain, + sencode* privkey); + int create_keypair (sencode**pub, sencode**priv, prng&rng); +}; + class algo_mceqd256 : public algorithm { public: