From 9c5248d101033cbb47739248ddff6e638aa97235 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 23 Apr 2021 09:58:38 -0400 Subject: aes_util: Make use of std::span Allows us to simplify the interface quite a bit as it will handle contiguous sequences for us. --- src/core/crypto/aes_util.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/core/crypto/aes_util.cpp') diff --git a/src/core/crypto/aes_util.cpp b/src/core/crypto/aes_util.cpp index cb7506241..85a666de9 100644 --- a/src/core/crypto/aes_util.cpp +++ b/src/core/crypto/aes_util.cpp @@ -119,9 +119,9 @@ void AESCipher::XTSTranscode(const u8* src, std::size_t size, u8* } template -void AESCipher::SetIVImpl(const u8* data, std::size_t size) { - ASSERT_MSG((mbedtls_cipher_set_iv(&ctx->encryption_context, data, size) || - mbedtls_cipher_set_iv(&ctx->decryption_context, data, size)) == 0, +void AESCipher::SetIV(std::span data) { + ASSERT_MSG((mbedtls_cipher_set_iv(&ctx->encryption_context, data.data(), data.size()) || + mbedtls_cipher_set_iv(&ctx->decryption_context, data.data(), data.size())) == 0, "Failed to set IV on mbedtls ciphers."); } -- cgit v1.2.3