diff --git a/src/openpgp/hash.h b/src/openpgp/hash.h index 0952c602..4f69851b 100644 --- a/src/openpgp/hash.h +++ b/src/openpgp/hash.h @@ -48,10 +48,10 @@ public: hash &operator=(const hash &) = delete; hash(uint8_t algorithm) - : algorithm(algorithm) + : algo(algorithm) , consumed(0) { - if (gcry_md_open(&md, algorithm, 0) != GPG_ERR_NO_ERROR) + if (gcry_md_open(&md, algo, 0) != GPG_ERR_NO_ERROR) { throw std::runtime_error("failed to create message digest object"); } @@ -83,8 +83,8 @@ public: std::vector finish() const { - std::vector result(gcry_md_get_algo_dlen(algorithm)); - const void *digest = gcry_md_read(md, algorithm); + std::vector result(gcry_md_get_algo_dlen(algo)); + const void *digest = gcry_md_read(md, algo); if (digest == nullptr) { throw std::runtime_error("failed to read the digest"); @@ -99,7 +99,7 @@ public: } private: - const uint8_t algorithm; + const uint8_t algo; gcry_md_hd_t md; size_t consumed; }; diff --git a/src/openpgp/openpgp.cpp b/src/openpgp/openpgp.cpp index 437e0d99..fa503015 100644 --- a/src/openpgp/openpgp.cpp +++ b/src/openpgp/openpgp.cpp @@ -139,7 +139,7 @@ public_key_block::public_key_block(const epee::span buffer) /* const auto timestamp = */ serialized.read_big_endian(); const auto algorithm = serialized.read_big_endian(); - if (algorithm != algorithm::rsa) + if (algorithm != openpgp::algorithm::rsa) { throw std::runtime_error("unsupported public key algorithm"); } @@ -219,7 +219,7 @@ signature_rsa signature_rsa::from_buffer(const epee::span input) const auto signature_type = static_cast(buffer.read_big_endian()); const auto algorithm = buffer.read_big_endian(); - if (algorithm != algorithm::rsa) + if (algorithm != openpgp::algorithm::rsa) { throw std::runtime_error("unsupported signature algorithm"); }