aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/3rdparty/botan/src/lib/pubkey/dl_algo
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/3rdparty/botan/src/lib/pubkey/dl_algo')
-rw-r--r--src/libs/3rdparty/botan/src/lib/pubkey/dl_algo/dl_algo.cpp84
-rw-r--r--src/libs/3rdparty/botan/src/lib/pubkey/dl_algo/dl_algo.h140
-rw-r--r--src/libs/3rdparty/botan/src/lib/pubkey/dl_algo/info.txt10
3 files changed, 0 insertions, 234 deletions
diff --git a/src/libs/3rdparty/botan/src/lib/pubkey/dl_algo/dl_algo.cpp b/src/libs/3rdparty/botan/src/lib/pubkey/dl_algo/dl_algo.cpp
deleted file mode 100644
index 15b0b175e4..0000000000
--- a/src/libs/3rdparty/botan/src/lib/pubkey/dl_algo/dl_algo.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
-* DL Scheme
-* (C) 1999-2007 Jack Lloyd
-*
-* Botan is released under the Simplified BSD License (see license.txt)
-*/
-
-#include <botan/dl_algo.h>
-#include <botan/numthry.h>
-#include <botan/der_enc.h>
-#include <botan/ber_dec.h>
-
-namespace Botan {
-
-size_t DL_Scheme_PublicKey::key_length() const
- {
- return m_group.p_bits();
- }
-
-size_t DL_Scheme_PublicKey::estimated_strength() const
- {
- return m_group.estimated_strength();
- }
-
-AlgorithmIdentifier DL_Scheme_PublicKey::algorithm_identifier() const
- {
- return AlgorithmIdentifier(get_oid(),
- m_group.DER_encode(group_format()));
- }
-
-std::vector<uint8_t> DL_Scheme_PublicKey::public_key_bits() const
- {
- std::vector<uint8_t> output;
- DER_Encoder(output).encode(m_y);
- return output;
- }
-
-DL_Scheme_PublicKey::DL_Scheme_PublicKey(const DL_Group& group, const BigInt& y) :
- m_y(y),
- m_group(group)
- {
- }
-
-DL_Scheme_PublicKey::DL_Scheme_PublicKey(const AlgorithmIdentifier& alg_id,
- const std::vector<uint8_t>& key_bits,
- DL_Group::Format format) :
- m_group(alg_id.get_parameters(), format)
- {
- BER_Decoder(key_bits).decode(m_y);
- }
-
-secure_vector<uint8_t> DL_Scheme_PrivateKey::private_key_bits() const
- {
- return DER_Encoder().encode(m_x).get_contents();
- }
-
-DL_Scheme_PrivateKey::DL_Scheme_PrivateKey(const AlgorithmIdentifier& alg_id,
- const secure_vector<uint8_t>& key_bits,
- DL_Group::Format format)
- {
- m_group.BER_decode(alg_id.get_parameters(), format);
-
- BER_Decoder(key_bits).decode(m_x);
- }
-
-/*
-* Check Public DL Parameters
-*/
-bool DL_Scheme_PublicKey::check_key(RandomNumberGenerator& rng,
- bool strong) const
- {
- return m_group.verify_group(rng, strong) && m_group.verify_public_element(m_y);
- }
-
-/*
-* Check DL Scheme Private Parameters
-*/
-bool DL_Scheme_PrivateKey::check_key(RandomNumberGenerator& rng,
- bool strong) const
- {
- return m_group.verify_group(rng, strong) && m_group.verify_element_pair(m_y, m_x);
- }
-
-}
diff --git a/src/libs/3rdparty/botan/src/lib/pubkey/dl_algo/dl_algo.h b/src/libs/3rdparty/botan/src/lib/pubkey/dl_algo/dl_algo.h
deleted file mode 100644
index af01bc217a..0000000000
--- a/src/libs/3rdparty/botan/src/lib/pubkey/dl_algo/dl_algo.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
-* DL Scheme
-* (C) 1999-2007 Jack Lloyd
-*
-* Botan is released under the Simplified BSD License (see license.txt)
-*/
-
-#ifndef BOTAN_DL_ALGO_H_
-#define BOTAN_DL_ALGO_H_
-
-#include <botan/dl_group.h>
-#include <botan/pk_keys.h>
-
-namespace Botan {
-
-/**
-* This class represents discrete logarithm (DL) public keys.
-*/
-class BOTAN_PUBLIC_API(2,0) DL_Scheme_PublicKey : public virtual Public_Key
- {
- public:
- bool check_key(RandomNumberGenerator& rng, bool) const override;
-
- AlgorithmIdentifier algorithm_identifier() const override;
-
- std::vector<uint8_t> public_key_bits() const override;
-
- /**
- * Get the DL domain parameters of this key.
- * @return DL domain parameters of this key
- */
- const DL_Group& get_domain() const { return m_group; }
-
- /**
- * Get the DL domain parameters of this key.
- * @return DL domain parameters of this key
- */
- const DL_Group& get_group() const { return m_group; }
-
- /**
- * Get the public value y with y = g^x mod p where x is the secret key.
- */
- const BigInt& get_y() const { return m_y; }
-
- /**
- * Get the prime p of the underlying DL group.
- * @return prime p
- */
- const BigInt& group_p() const { return m_group.get_p(); }
-
- /**
- * Get the prime q of the underlying DL group.
- * @return prime q
- */
- const BigInt& group_q() const { return m_group.get_q(); }
-
- /**
- * Get the generator g of the underlying DL group.
- * @return generator g
- */
- const BigInt& group_g() const { return m_group.get_g(); }
-
- /**
- * Get the underlying groups encoding format.
- * @return encoding format
- */
- virtual DL_Group::Format group_format() const = 0;
-
- size_t key_length() const override;
- size_t estimated_strength() const override;
-
- DL_Scheme_PublicKey& operator=(const DL_Scheme_PublicKey& other) = default;
-
- protected:
- DL_Scheme_PublicKey() = default;
-
- /**
- * Create a public key.
- * @param alg_id the X.509 algorithm identifier
- * @param key_bits DER encoded public key bits
- * @param group_format the underlying groups encoding format
- */
- DL_Scheme_PublicKey(const AlgorithmIdentifier& alg_id,
- const std::vector<uint8_t>& key_bits,
- DL_Group::Format group_format);
-
- DL_Scheme_PublicKey(const DL_Group& group, const BigInt& y);
-
- /**
- * The DL public key
- */
- BigInt m_y;
-
- /**
- * The DL group
- */
- DL_Group m_group;
- };
-
-/**
-* This class represents discrete logarithm (DL) private keys.
-*/
-class BOTAN_PUBLIC_API(2,0) DL_Scheme_PrivateKey : public virtual DL_Scheme_PublicKey,
- public virtual Private_Key
- {
- public:
- bool check_key(RandomNumberGenerator& rng, bool) const override;
-
- /**
- * Get the secret key x.
- * @return secret key
- */
- const BigInt& get_x() const { return m_x; }
-
- secure_vector<uint8_t> private_key_bits() const override;
-
- DL_Scheme_PrivateKey& operator=(const DL_Scheme_PrivateKey& other) = default;
-
- protected:
- /**
- * Create a private key.
- * @param alg_id the X.509 algorithm identifier
- * @param key_bits DER encoded private key bits
- * @param group_format the underlying groups encoding format
- */
- DL_Scheme_PrivateKey(const AlgorithmIdentifier& alg_id,
- const secure_vector<uint8_t>& key_bits,
- DL_Group::Format group_format);
-
- DL_Scheme_PrivateKey() = default;
-
- /**
- * The DL private key
- */
- BigInt m_x;
- };
-
-}
-
-#endif
diff --git a/src/libs/3rdparty/botan/src/lib/pubkey/dl_algo/info.txt b/src/libs/3rdparty/botan/src/lib/pubkey/dl_algo/info.txt
deleted file mode 100644
index 44e649cd67..0000000000
--- a/src/libs/3rdparty/botan/src/lib/pubkey/dl_algo/info.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-<defines>
-DL_PUBLIC_KEY_FAMILY -> 20131128
-</defines>
-
-<requires>
-asn1
-dl_group
-numbertheory
-rng
-</requires>