From fbe0dc71b02feb720b8e118252467bdbb294d4b6 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Mon, 5 Apr 2021 14:47:25 -0400 Subject: More make_unique --- src/lib/pbkdf/pbkdf.cpp | 6 +++--- src/lib/pubkey/mce/code_based_key_gen.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/lib') diff --git a/src/lib/pbkdf/pbkdf.cpp b/src/lib/pbkdf/pbkdf.cpp index 5e28d3e47..e80f46cfe 100644 --- a/src/lib/pbkdf/pbkdf.cpp +++ b/src/lib/pbkdf/pbkdf.cpp @@ -32,10 +32,10 @@ std::unique_ptr PBKDF::create(const std::string& algo_spec, if(provider.empty() || provider == "base") { if(auto mac = MessageAuthenticationCode::create("HMAC(" + req.arg(0) + ")")) - return std::unique_ptr(new PKCS5_PBKDF2(mac.release())); + return std::make_unique(mac.release()); if(auto mac = MessageAuthenticationCode::create(req.arg(0))) - return std::unique_ptr(new PKCS5_PBKDF2(mac.release())); + return std::make_unique(mac.release()); } return nullptr; @@ -46,7 +46,7 @@ std::unique_ptr PBKDF::create(const std::string& algo_spec, if(req.algo_name() == "OpenPGP-S2K" && req.arg_count() == 1) { if(auto hash = HashFunction::create(req.arg(0))) - return std::unique_ptr(new OpenPGP_S2K(hash.release())); + return std::make_unique(hash.release()); } #endif diff --git a/src/lib/pubkey/mce/code_based_key_gen.cpp b/src/lib/pubkey/mce/code_based_key_gen.cpp index c6fe3e2a5..ab965eff7 100644 --- a/src/lib/pubkey/mce/code_based_key_gen.cpp +++ b/src/lib/pubkey/mce/code_based_key_gen.cpp @@ -187,7 +187,7 @@ std::unique_ptr generate_R(std::vector &L, polyn_gf2m* g, c throw Invalid_State("McEliece keygen failed - could not bring matrix to row reduced echelon form"); } - std::unique_ptr result(new binary_matrix(code_length-r, r)) ; + auto result = std::make_unique(code_length - r, r); for(size_t i = 0; i < result->rows(); ++i) { for(size_t j = 0; j < result->columns(); ++j) -- cgit v1.2.3