diff options
author | Jack Lloyd <[email protected]> | 2016-10-08 13:32:51 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-10-08 13:32:51 -0400 |
commit | b0e003b6e4f4a51851e4f2097079669027f7aa8d (patch) | |
tree | 50027040757da73bd0b50e6ebf2fcee583657993 /src/lib/pubkey/gost_3410/gost_3410.cpp | |
parent | 62cd6e3651711f759f870460599596ff5be904a5 (diff) | |
parent | 2747e8e23aec43162009e4d281ca5e7e50d5a003 (diff) |
Merge GH #625 Remove static init from PK operations code
Also removes hidden RNG in Blinder (GH #615)
Diffstat (limited to 'src/lib/pubkey/gost_3410/gost_3410.cpp')
-rw-r--r-- | src/lib/pubkey/gost_3410/gost_3410.cpp | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/lib/pubkey/gost_3410/gost_3410.cpp b/src/lib/pubkey/gost_3410/gost_3410.cpp index 51db47619..7fde29bc5 100644 --- a/src/lib/pubkey/gost_3410/gost_3410.cpp +++ b/src/lib/pubkey/gost_3410/gost_3410.cpp @@ -7,8 +7,9 @@ * Botan is released under the Simplified BSD License (see license.txt) */ -#include <botan/internal/pk_utils.h> #include <botan/gost_3410.h> +#include <botan/internal/pk_ops_impl.h> +#include <botan/reducer.h> #include <botan/der_enc.h> #include <botan/ber_dec.h> @@ -212,7 +213,23 @@ bool GOST_3410_Verification_Operation::verify(const byte msg[], size_t msg_len, } -BOTAN_REGISTER_PK_SIGNATURE_OP("GOST-34.10", GOST_3410_Signature_Operation); -BOTAN_REGISTER_PK_VERIFY_OP("GOST-34.10", GOST_3410_Verification_Operation); +std::unique_ptr<PK_Ops::Verification> +GOST_3410_PublicKey::create_verification_op(const std::string& params, + const std::string& provider) const + { + if(provider == "base" || provider.empty()) + return std::unique_ptr<PK_Ops::Verification>(new GOST_3410_Verification_Operation(*this, params)); + throw Provider_Not_Found(algo_name(), provider); + } + +std::unique_ptr<PK_Ops::Signature> +GOST_3410_PrivateKey::create_signature_op(RandomNumberGenerator& /*rng*/, + const std::string& params, + const std::string& provider) const + { + if(provider == "base" || provider.empty()) + return std::unique_ptr<PK_Ops::Signature>(new GOST_3410_Signature_Operation(*this, params)); + throw Provider_Not_Found(algo_name(), provider); + } } |