diff --git a/Libraries/LibCrypto/BigInt/SignedBigInteger.h b/Libraries/LibCrypto/BigInt/SignedBigInteger.h index 1ff220daa1..b76ed51c2d 100644 --- a/Libraries/LibCrypto/BigInt/SignedBigInteger.h +++ b/Libraries/LibCrypto/BigInt/SignedBigInteger.h @@ -67,8 +67,9 @@ public: static SignedBigInteger import_data(const u8* ptr, size_t length); size_t export_data(AK::ByteBuffer& data) const; - size_t export_data(const u8* ptr, size_t length) const + size_t export_data(u8* ptr, size_t length) const { + // Note: ByteBuffer::wrap() does a const_cast! auto buffer = ByteBuffer::wrap(ptr, length); return export_data(buffer); } diff --git a/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h b/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h index b63409543f..b4e995e602 100644 --- a/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h +++ b/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h @@ -59,8 +59,9 @@ public: } size_t export_data(AK::ByteBuffer& data) const; - size_t export_data(const u8* ptr, size_t length) const + size_t export_data(u8* ptr, size_t length) const { + // Note: ByteBuffer::wrap() does a const_cast! auto buffer = ByteBuffer::wrap(ptr, length); return export_data(buffer); }