diff --git a/Userland/Libraries/LibCrypto/Hash/MD5.cpp b/Userland/Libraries/LibCrypto/Hash/MD5.cpp index c526bb80000..de4d529882b 100644 --- a/Userland/Libraries/LibCrypto/Hash/MD5.cpp +++ b/Userland/Libraries/LibCrypto/Hash/MD5.cpp @@ -6,6 +6,7 @@ #include #include +#include static constexpr u32 F(u32 x, u32 y, u32 z) { return (x & y) | ((~x) & z); }; static constexpr u32 G(u32 x, u32 y, u32 z) { return (x & z) | ((~z) & y); }; @@ -199,7 +200,7 @@ void MD5::transform(const u8* block) m_C += c; m_D += d; - __builtin_memset(x, 0, sizeof(x)); + explicit_bzero(x, sizeof(x)); } } diff --git a/Userland/Libraries/LibCrypto/Hash/SHA1.cpp b/Userland/Libraries/LibCrypto/Hash/SHA1.cpp index 9d6147687c6..58b1db96e45 100644 --- a/Userland/Libraries/LibCrypto/Hash/SHA1.cpp +++ b/Userland/Libraries/LibCrypto/Hash/SHA1.cpp @@ -7,6 +7,7 @@ #include #include #include +#include namespace Crypto { namespace Hash { @@ -63,7 +64,7 @@ inline void SHA1::transform(const u8* data) c = 0; d = 0; e = 0; - __builtin_memset(blocks, 0, 16 * sizeof(u32)); + explicit_bzero(blocks, 16 * sizeof(u32)); } void SHA1::update(const u8* message, size_t length)