ams-libs: AMS_ASSERT no longer invokes expression
This commit is contained in:
@@ -71,6 +71,7 @@ namespace ams::crypto::impl {
|
||||
this->count += num;
|
||||
|
||||
AMS_ASSERT(words == this->buffer);
|
||||
AMS_UNUSED(words);
|
||||
}
|
||||
public:
|
||||
constexpr ALWAYS_INLINE WordAllocator(Word *buf, size_t c) : buffer(buf), count(c), max_count(c), min_count(c) { /* ... */ }
|
||||
|
||||
@@ -96,6 +96,7 @@ namespace ams::crypto::impl {
|
||||
size_t Update(void *_dst, size_t dst_size, const void *_src, size_t src_size) {
|
||||
AMS_ASSERT(this->state == State_Initialized);
|
||||
AMS_ASSERT(dst_size >= src_size);
|
||||
AMS_UNUSED(dst_size);
|
||||
|
||||
u8 *dst = static_cast<u8 *>(_dst);
|
||||
const u8 *src = static_cast<const u8 *>(_src);
|
||||
|
||||
@@ -99,6 +99,7 @@ namespace ams::crypto::impl {
|
||||
inline void HmacImpl<Hash>::GetMac(void *dst, size_t dst_size) {
|
||||
AMS_ASSERT(this->state == State_Initialized || this->state == State_Done);
|
||||
AMS_ASSERT(dst_size >= MacSize);
|
||||
AMS_UNUSED(dst_size);
|
||||
|
||||
/* If we're not already finalized, get the final mac. */
|
||||
if (this->state == State_Initialized) {
|
||||
|
||||
@@ -85,6 +85,7 @@ namespace ams::crypto::impl {
|
||||
AMS_ASSERT(salt_size > 0);
|
||||
AMS_ASSERT(salt_size == HashSize);
|
||||
AMS_ASSERT(label_digest_size == HashSize);
|
||||
AMS_UNUSED(salt_size, label_digest_size);
|
||||
|
||||
u8 *buf = static_cast<u8 *>(dst);
|
||||
buf[0] = HeadMagic;
|
||||
@@ -109,6 +110,7 @@ namespace ams::crypto::impl {
|
||||
AMS_ABORT_UNLESS(dst_size > 0);
|
||||
AMS_ABORT_UNLESS(buf_size >= 2 * HashSize + 3);
|
||||
AMS_ABORT_UNLESS(label_digest_size == HashSize);
|
||||
AMS_UNUSED(label_digest_size);
|
||||
|
||||
/* Validate sanity byte. */
|
||||
bool is_valid = buf[0] == HeadMagic;
|
||||
|
||||
@@ -33,6 +33,7 @@ namespace ams::crypto::impl {
|
||||
private:
|
||||
static void ComputeHashWithPadding(void *dst, const u8 *user_hash, size_t user_hash_size, const void *salt, size_t salt_size) {
|
||||
AMS_ASSERT(user_hash_size == HashSize);
|
||||
AMS_UNUSED(user_hash_size);
|
||||
|
||||
/* Initialize our buffer. */
|
||||
u8 buf[8 + HashSize];
|
||||
|
||||
@@ -61,6 +61,7 @@ namespace ams::crypto::impl {
|
||||
|
||||
void GetBufferedData(void *dst, size_t dst_size) const {
|
||||
AMS_ASSERT(dst_size >= this->GetBufferedDataSize());
|
||||
AMS_UNUSED(dst_size);
|
||||
|
||||
std::memcpy(dst, this->state.buffer, this->GetBufferedDataSize());
|
||||
}
|
||||
|
||||
@@ -65,6 +65,7 @@ namespace ams::crypto::impl {
|
||||
template<typename BlockCipher>
|
||||
void Initialize(const BlockCipher *cipher, const void *tweak, size_t tweak_size) {
|
||||
AMS_ASSERT(tweak_size == IvSize);
|
||||
AMS_UNUSED(tweak_size);
|
||||
|
||||
cipher->EncryptBlock(this->tweak, IvSize, tweak, IvSize);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user