diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/block/sm4/sm4_armv8/sm4_armv8.cpp | 8 | ||||
-rw-r--r-- | src/lib/modes/aead/gcm/gcm.cpp | 9 | ||||
-rw-r--r-- | src/lib/tls/tls_blocking.cpp | 8 | ||||
-rw-r--r-- | src/lib/utils/compiler.h | 6 |
4 files changed, 16 insertions, 15 deletions
diff --git a/src/lib/block/sm4/sm4_armv8/sm4_armv8.cpp b/src/lib/block/sm4/sm4_armv8/sm4_armv8.cpp index b91004aea..a0326f211 100644 --- a/src/lib/block/sm4/sm4_armv8/sm4_armv8.cpp +++ b/src/lib/block/sm4/sm4_armv8/sm4_armv8.cpp @@ -41,8 +41,8 @@ inline uint32x4_t bqswap_32(uint32x4_t B) } -BOTAN_FUNC_ISA("+sm4") -void SM4::sm4_armv8_encrypt(const uint8_t input8[], uint8_t output8[], size_t blocks) const +void BOTAN_FUNC_ISA("arch=armv8.2-a+sm4") +SM4::sm4_armv8_encrypt(const uint8_t input8[], uint8_t output8[], size_t blocks) const { const uint32x4_t K0 = vld1q_u32(&m_RK[ 0]); const uint32x4_t K1 = vld1q_u32(&m_RK[ 4]); @@ -102,8 +102,8 @@ void SM4::sm4_armv8_encrypt(const uint8_t input8[], uint8_t output8[], size_t bl } } -BOTAN_FUNC_ISA("+sm4") -void SM4::sm4_armv8_decrypt(const uint8_t input8[], uint8_t output8[], size_t blocks) const +void BOTAN_FUNC_ISA("arch=armv8.2-a+sm4") +SM4::sm4_armv8_decrypt(const uint8_t input8[], uint8_t output8[], size_t blocks) const { const uint32x4_t K0 = qswap_32(vld1q_u32(&m_RK[ 0])); const uint32x4_t K1 = qswap_32(vld1q_u32(&m_RK[ 4])); diff --git a/src/lib/modes/aead/gcm/gcm.cpp b/src/lib/modes/aead/gcm/gcm.cpp index 5dd6408d8..4e4b26f31 100644 --- a/src/lib/modes/aead/gcm/gcm.cpp +++ b/src/lib/modes/aead/gcm/gcm.cpp @@ -95,7 +95,10 @@ void GCM_Mode::start_msg(const uint8_t nonce[], size_t nonce_len) if(!valid_nonce_length(nonce_len)) throw Invalid_IV_Length(name(), nonce_len); - m_y0.resize(GCM_BS); + if(m_y0.size() != GCM_BS) + m_y0.resize(GCM_BS); + + clear_mem(m_y0.data(), m_y0.size()); if(nonce_len == 12) { @@ -109,11 +112,11 @@ void GCM_Mode::start_msg(const uint8_t nonce[], size_t nonce_len) m_ctr->set_iv(m_y0.data(), m_y0.size()); - zeroise(m_y0); + clear_mem(m_y0.data(), m_y0.size()); m_ctr->encipher(m_y0); m_ghash->start(m_y0.data(), m_y0.size()); - m_y0.clear(); + clear_mem(m_y0.data(), m_y0.size()); } size_t GCM_Encryption::process(uint8_t buf[], size_t sz) diff --git a/src/lib/tls/tls_blocking.cpp b/src/lib/tls/tls_blocking.cpp index d89c11a2c..b9c699dc0 100644 --- a/src/lib/tls/tls_blocking.cpp +++ b/src/lib/tls/tls_blocking.cpp @@ -12,8 +12,6 @@ namespace Botan { namespace TLS { -using namespace std::placeholders; - Blocking_Client::Blocking_Client(read_fn reader, write_fn writer, Session_Manager& session_manager, @@ -31,9 +29,9 @@ Blocking_Client::Blocking_Client(read_fn reader, */ TLS::Compat_Callbacks::SILENCE_DEPRECATION_WARNING::PLEASE, writer, - std::bind(&Blocking_Client::data_cb, this, _1, _2), - std::function<void (Alert)>(std::bind(&Blocking_Client::alert_cb, this, _1)), - std::bind(&Blocking_Client::handshake_cb, this, _1) + std::bind(&Blocking_Client::data_cb, this, std::placeholders::_1, std::placeholders::_2), + std::function<void (Alert)>(std::bind(&Blocking_Client::alert_cb, this, std::placeholders::_1)), + std::bind(&Blocking_Client::handshake_cb, this, std::placeholders::_1) )), m_channel(*m_callbacks.get(), session_manager, diff --git a/src/lib/utils/compiler.h b/src/lib/utils/compiler.h index 3f1dc4f8b..e30ecda71 100644 --- a/src/lib/utils/compiler.h +++ b/src/lib/utils/compiler.h @@ -103,7 +103,7 @@ #define BOTAN_DEPRECATED(msg) __attribute__ ((deprecated(msg))) #define BOTAN_DEPRECATED_HEADER(hdr) _Pragma("message \"this header is deprecated\"") - #if !defined(BOTAN_IS_BEING_BUILT) + #if !defined(BOTAN_IS_BEING_BUILT) && !defined(BOTAN_AMALGAMATION_H_) #define BOTAN_FUTURE_INTERNAL_HEADER(hdr) _Pragma("message \"this header will be made internal in the future\"") #endif @@ -111,7 +111,7 @@ #define BOTAN_DEPRECATED(msg) __declspec(deprecated(msg)) #define BOTAN_DEPRECATED_HEADER(hdr) __pragma(message("this header is deprecated")) - #if !defined(BOTAN_IS_BEING_BUILT) + #if !defined(BOTAN_IS_BEING_BUILT) && !defined(BOTAN_AMALGAMATION_H_) #define BOTAN_FUTURE_INTERNAL_HEADER(hdr) __pragma(message("this header will be made internal in the future")) #endif @@ -120,7 +120,7 @@ #define BOTAN_DEPRECATED(msg) __attribute__ ((deprecated(msg))) #define BOTAN_DEPRECATED_HEADER(hdr) _Pragma("GCC warning \"this header is deprecated\"") - #if !defined(BOTAN_IS_BEING_BUILT) + #if !defined(BOTAN_IS_BEING_BUILT) && !defined(BOTAN_AMALGAMATION_H_) #define BOTAN_FUTURE_INTERNAL_HEADER(hdr) _Pragma("GCC warning \"this header will be made internal in the future\"") #endif #endif |