libstrat: enable -Wextra, -Werror
This caught an embarrassingly large number of bugs.
This commit is contained in:
@@ -36,6 +36,7 @@ namespace ams::crypto::impl {
|
||||
void AesImpl<KeySize>::Initialize(const void *key, size_t key_size, bool is_encrypt) {
|
||||
static_assert(IsSupportedKeySize(KeySize));
|
||||
AMS_ASSERT(key_size == KeySize);
|
||||
AMS_UNUSED(key_size);
|
||||
|
||||
if constexpr (KeySize == 16) {
|
||||
/* Aes 128. */
|
||||
@@ -60,6 +61,7 @@ namespace ams::crypto::impl {
|
||||
static_assert(IsSupportedKeySize(KeySize));
|
||||
AMS_ASSERT(src_size >= BlockSize);
|
||||
AMS_ASSERT(dst_size >= BlockSize);
|
||||
AMS_UNUSED(src_size, dst_size);
|
||||
|
||||
if constexpr (KeySize == 16) {
|
||||
/* Aes 128. */
|
||||
@@ -84,6 +86,7 @@ namespace ams::crypto::impl {
|
||||
static_assert(IsSupportedKeySize(KeySize));
|
||||
AMS_ASSERT(src_size >= BlockSize);
|
||||
AMS_ASSERT(dst_size >= BlockSize);
|
||||
AMS_UNUSED(src_size, dst_size);
|
||||
|
||||
if constexpr (KeySize == 16) {
|
||||
/* Aes 128. */
|
||||
|
||||
@@ -32,6 +32,7 @@ namespace ams::crypto::impl {
|
||||
void Sha1Impl::GetHash(void *dst, size_t size) {
|
||||
static_assert(sizeof(this->state) == sizeof(::Sha1Context));
|
||||
AMS_ASSERT(size >= HashSize);
|
||||
AMS_UNUSED(size);
|
||||
::sha1ContextGetHash(reinterpret_cast<::Sha1Context *>(std::addressof(this->state)), dst);
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,8 @@ namespace ams::crypto::impl {
|
||||
void Sha256Impl::GetHash(void *dst, size_t size) {
|
||||
static_assert(sizeof(this->state) == sizeof(::Sha256Context));
|
||||
AMS_ASSERT(size >= HashSize);
|
||||
AMS_UNUSED(size);
|
||||
|
||||
::sha256ContextGetHash(reinterpret_cast<::Sha256Context *>(std::addressof(this->state)), dst);
|
||||
}
|
||||
|
||||
|
||||
@@ -50,6 +50,8 @@ namespace ams::crypto::impl {
|
||||
|
||||
template<typename Cipher, typename Self>
|
||||
size_t UpdateImpl(Self *self, void *dst, size_t dst_size, const void *src, size_t src_size) {
|
||||
AMS_UNUSED(dst_size);
|
||||
|
||||
const size_t BlockSize = self->GetBlockSize();
|
||||
|
||||
const u8 *src_u8 = static_cast<const u8 *>(src);
|
||||
|
||||
Reference in New Issue
Block a user