exo/vapours: refactor member variables to m_ over this->
This commit is contained in:
@@ -31,10 +31,10 @@ namespace ams::crypto::impl {
|
||||
static constexpr size_t RoundKeySize = BlockSize * (RoundCount + 1);
|
||||
private:
|
||||
#ifdef ATMOSPHERE_IS_EXOSPHERE
|
||||
int slot;
|
||||
int m_slot;
|
||||
#endif
|
||||
#ifdef ATMOSPHERE_IS_STRATOSPHERE
|
||||
u32 round_keys[RoundKeySize / sizeof(u32)];
|
||||
u32 m_round_keys[RoundKeySize / sizeof(u32)];
|
||||
#endif
|
||||
public:
|
||||
~AesImpl();
|
||||
@@ -45,7 +45,7 @@ namespace ams::crypto::impl {
|
||||
|
||||
#ifdef ATMOSPHERE_IS_STRATOSPHERE
|
||||
const u8 *GetRoundKey() const {
|
||||
return reinterpret_cast<const u8 *>(this->round_keys);
|
||||
return reinterpret_cast<const u8 *>(m_round_keys);
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -46,43 +46,43 @@ namespace ams::crypto::impl {
|
||||
private:
|
||||
friend class WordAllocator;
|
||||
private:
|
||||
WordAllocator *allocator;
|
||||
Word *buffer;
|
||||
size_t count;
|
||||
WordAllocator *m_allocator;
|
||||
Word *m_buffer;
|
||||
size_t m_count;
|
||||
private:
|
||||
constexpr ALWAYS_INLINE Allocation(WordAllocator *a, Word *w, size_t c) : allocator(a), buffer(w), count(c) { /* ... */ }
|
||||
constexpr ALWAYS_INLINE Allocation(WordAllocator *a, Word *w, size_t c) : m_allocator(a), m_buffer(w), m_count(c) { /* ... */ }
|
||||
public:
|
||||
ALWAYS_INLINE ~Allocation() { if (allocator) { allocator->Free(this->buffer, this->count); } }
|
||||
ALWAYS_INLINE ~Allocation() { if (m_allocator) { m_allocator->Free(m_buffer, m_count); } }
|
||||
|
||||
constexpr ALWAYS_INLINE Word *GetBuffer() const { return this->buffer; }
|
||||
constexpr ALWAYS_INLINE size_t GetCount() const { return this->count; }
|
||||
constexpr ALWAYS_INLINE bool IsValid() const { return this->buffer != nullptr; }
|
||||
constexpr ALWAYS_INLINE Word *GetBuffer() const { return m_buffer; }
|
||||
constexpr ALWAYS_INLINE size_t GetCount() const { return m_count; }
|
||||
constexpr ALWAYS_INLINE bool IsValid() const { return m_buffer != nullptr; }
|
||||
};
|
||||
|
||||
friend class Allocation;
|
||||
private:
|
||||
Word *buffer;
|
||||
size_t count;
|
||||
size_t max_count;
|
||||
size_t min_count;
|
||||
Word *m_buffer;
|
||||
size_t m_count;
|
||||
size_t m_max_count;
|
||||
size_t m_min_count;
|
||||
private:
|
||||
ALWAYS_INLINE void Free(void *words, size_t num) {
|
||||
this->buffer -= num;
|
||||
this->count += num;
|
||||
m_buffer -= num;
|
||||
m_count += num;
|
||||
|
||||
AMS_ASSERT(words == this->buffer);
|
||||
AMS_ASSERT(words == m_buffer);
|
||||
AMS_UNUSED(words);
|
||||
}
|
||||
public:
|
||||
constexpr ALWAYS_INLINE WordAllocator(Word *buf, size_t c) : buffer(buf), count(c), max_count(c), min_count(c) { /* ... */ }
|
||||
constexpr ALWAYS_INLINE WordAllocator(Word *buf, size_t c) : m_buffer(buf), m_count(c), m_max_count(c), m_min_count(c) { /* ... */ }
|
||||
|
||||
ALWAYS_INLINE Allocation Allocate(size_t num) {
|
||||
if (num <= this->count) {
|
||||
Word *allocated = this->buffer;
|
||||
if (num <= m_count) {
|
||||
Word *allocated = m_buffer;
|
||||
|
||||
this->buffer += num;
|
||||
this->count -= num;
|
||||
this->min_count = std::min(this->count, this->min_count);
|
||||
m_buffer += num;
|
||||
m_count -= num;
|
||||
m_min_count = std::min(m_count, m_min_count);
|
||||
|
||||
return Allocation(this, allocated, num);
|
||||
} else {
|
||||
@@ -91,23 +91,23 @@ namespace ams::crypto::impl {
|
||||
}
|
||||
|
||||
constexpr ALWAYS_INLINE size_t GetMaxUsedSize() const {
|
||||
return (this->max_count - this->min_count) * sizeof(Word);
|
||||
return (m_max_count - m_min_count) * sizeof(Word);
|
||||
}
|
||||
};
|
||||
private:
|
||||
Word *words;
|
||||
size_t num_words;
|
||||
size_t max_words;
|
||||
Word *m_words;
|
||||
size_t m_num_words;
|
||||
size_t m_max_words;
|
||||
private:
|
||||
static void ImportImpl(Word *out, size_t out_size, const u8 *src, size_t src_size);
|
||||
static void ExportImpl(u8 *out, size_t out_size, const Word *src, size_t src_size);
|
||||
public:
|
||||
constexpr BigNum() : words(), num_words(), max_words() { /* ... */ }
|
||||
constexpr BigNum() : m_words(), m_num_words(), m_max_words() { /* ... */ }
|
||||
~BigNum() { /* ... */ }
|
||||
|
||||
constexpr void ReserveStatic(Word *buf, size_t capacity) {
|
||||
this->words = buf;
|
||||
this->max_words = capacity;
|
||||
m_words = buf;
|
||||
m_max_words = capacity;
|
||||
}
|
||||
|
||||
bool Import(const void *src, size_t src_size);
|
||||
@@ -116,7 +116,7 @@ namespace ams::crypto::impl {
|
||||
size_t GetSize() const;
|
||||
|
||||
bool IsZero() const {
|
||||
return this->num_words == 0;
|
||||
return m_num_words == 0;
|
||||
}
|
||||
|
||||
bool ExpMod(void *dst, const void *src, size_t size, const BigNum &exp, u32 *work_buf, size_t work_buf_size) const;
|
||||
@@ -154,10 +154,10 @@ namespace ams::crypto::impl {
|
||||
static constexpr size_t NumWords = util::AlignUp(NumBits, BitsPerWord) / BitsPerWord;
|
||||
static constexpr size_t NumBytes = NumWords * sizeof(Word);
|
||||
private:
|
||||
Word word_buf[NumWords];
|
||||
Word m_word_buf[NumWords];
|
||||
public:
|
||||
constexpr StaticBigNum() : word_buf() {
|
||||
this->ReserveStatic(word_buf, NumWords);
|
||||
constexpr StaticBigNum() : m_word_buf() {
|
||||
this->ReserveStatic(m_word_buf, NumWords);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -37,13 +37,13 @@ namespace ams::crypto::impl {
|
||||
State_Initialized,
|
||||
};
|
||||
private:
|
||||
const BlockCipher *block_cipher;
|
||||
u8 counter[IvSize];
|
||||
u8 encrypted_counter[BlockSize];
|
||||
size_t buffer_offset;
|
||||
State state;
|
||||
const BlockCipher *m_block_cipher;
|
||||
u8 m_counter[IvSize];
|
||||
u8 m_encrypted_counter[BlockSize];
|
||||
size_t m_buffer_offset;
|
||||
State m_state;
|
||||
public:
|
||||
CtrModeImpl() : state(State_None) { /* ... */ }
|
||||
CtrModeImpl() : m_state(State_None) { /* ... */ }
|
||||
|
||||
~CtrModeImpl() {
|
||||
ClearMemory(this, sizeof(*this));
|
||||
@@ -57,8 +57,8 @@ namespace ams::crypto::impl {
|
||||
AMS_ASSERT(iv_size == IvSize);
|
||||
AMS_ASSERT(offset >= 0);
|
||||
|
||||
this->block_cipher = block_cipher;
|
||||
this->state = State_Initialized;
|
||||
m_block_cipher = block_cipher;
|
||||
m_state = State_Initialized;
|
||||
|
||||
this->SwitchMessage(iv, iv_size);
|
||||
|
||||
@@ -69,32 +69,32 @@ namespace ams::crypto::impl {
|
||||
}
|
||||
|
||||
if (size_t remaining = static_cast<size_t>(offset % BlockSize); remaining != 0) {
|
||||
this->block_cipher->EncryptBlock(this->encrypted_counter, sizeof(this->encrypted_counter), this->counter, sizeof(this->counter));
|
||||
m_block_cipher->EncryptBlock(m_encrypted_counter, sizeof(m_encrypted_counter), m_counter, sizeof(m_counter));
|
||||
this->IncrementCounter();
|
||||
|
||||
this->buffer_offset = remaining;
|
||||
m_buffer_offset = remaining;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SwitchMessage(const void *iv, size_t iv_size) {
|
||||
AMS_ASSERT(this->state == State_Initialized);
|
||||
AMS_ASSERT(m_state == State_Initialized);
|
||||
AMS_ASSERT(iv_size == IvSize);
|
||||
|
||||
std::memcpy(this->counter, iv, iv_size);
|
||||
this->buffer_offset = 0;
|
||||
std::memcpy(m_counter, iv, iv_size);
|
||||
m_buffer_offset = 0;
|
||||
}
|
||||
|
||||
void IncrementCounter() {
|
||||
for (s32 i = IvSize - 1; i >= 0; --i) {
|
||||
if (++this->counter[i] != 0) {
|
||||
if (++m_counter[i] != 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
size_t Update(void *_dst, size_t dst_size, const void *_src, size_t src_size) {
|
||||
AMS_ASSERT(this->state == State_Initialized);
|
||||
AMS_ASSERT(m_state == State_Initialized);
|
||||
AMS_ASSERT(dst_size >= src_size);
|
||||
AMS_UNUSED(dst_size);
|
||||
|
||||
@@ -102,10 +102,10 @@ namespace ams::crypto::impl {
|
||||
const u8 *src = static_cast<const u8 *>(_src);
|
||||
size_t remaining = src_size;
|
||||
|
||||
if (this->buffer_offset > 0) {
|
||||
const size_t xor_size = std::min(BlockSize - this->buffer_offset, remaining);
|
||||
if (m_buffer_offset > 0) {
|
||||
const size_t xor_size = std::min(BlockSize - m_buffer_offset, remaining);
|
||||
|
||||
const u8 *ctr = this->encrypted_counter + this->buffer_offset;
|
||||
const u8 *ctr = m_encrypted_counter + m_buffer_offset;
|
||||
for (size_t i = 0; i < xor_size; i++) {
|
||||
dst[i] = src[i] ^ ctr[i];
|
||||
}
|
||||
@@ -113,10 +113,10 @@ namespace ams::crypto::impl {
|
||||
src += xor_size;
|
||||
dst += xor_size;
|
||||
remaining -= xor_size;
|
||||
this->buffer_offset += xor_size;
|
||||
m_buffer_offset += xor_size;
|
||||
|
||||
if (this->buffer_offset == BlockSize) {
|
||||
this->buffer_offset = 0;
|
||||
if (m_buffer_offset == BlockSize) {
|
||||
m_buffer_offset = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace ams::crypto::impl {
|
||||
|
||||
if (remaining > 0) {
|
||||
this->ProcessBlock(dst, src, remaining);
|
||||
this->buffer_offset = remaining;
|
||||
m_buffer_offset = remaining;
|
||||
}
|
||||
|
||||
return src_size;
|
||||
@@ -146,18 +146,18 @@ namespace ams::crypto::impl {
|
||||
u16 acc = 0;
|
||||
const u8 *block = reinterpret_cast<const u8 *>(_block);
|
||||
for (s32 i = IvSize - 1; i >= 0; --i) {
|
||||
acc += (this->counter[i] + block[i]);
|
||||
this->counter[i] = acc & 0xFF;
|
||||
acc += (m_counter[i] + block[i]);
|
||||
m_counter[i] = acc & 0xFF;
|
||||
acc >>= 8;
|
||||
}
|
||||
}
|
||||
|
||||
void ProcessBlock(u8 *dst, const u8 *src, size_t src_size) {
|
||||
this->block_cipher->EncryptBlock(this->encrypted_counter, BlockSize, this->counter, IvSize);
|
||||
m_block_cipher->EncryptBlock(m_encrypted_counter, BlockSize, m_counter, IvSize);
|
||||
this->IncrementCounter();
|
||||
|
||||
for (size_t i = 0; i < src_size; i++) {
|
||||
dst[i] = src[i] ^ this->encrypted_counter[i];
|
||||
dst[i] = src[i] ^ m_encrypted_counter[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -63,23 +63,23 @@ namespace ams::crypto::impl {
|
||||
|
||||
using CipherFunction = void (*)(void *dst_block, const void *src_block, const void *ctx);
|
||||
private:
|
||||
State state;
|
||||
const BlockCipher *block_cipher;
|
||||
CipherFunction cipher_func;
|
||||
u8 pad[sizeof(u64)];
|
||||
Block block_x;
|
||||
Block block_y;
|
||||
Block block_ek;
|
||||
Block block_ek0;
|
||||
Block block_tmp;
|
||||
size_t aad_size;
|
||||
size_t msg_size;
|
||||
u32 aad_remaining;
|
||||
u32 msg_remaining;
|
||||
u32 counter;
|
||||
Block h_mult_blocks[16];
|
||||
State m_state;
|
||||
const BlockCipher *m_block_cipher;
|
||||
CipherFunction m_cipher_func;
|
||||
u8 m_pad[sizeof(u64)];
|
||||
Block m_block_x;
|
||||
Block m_block_y;
|
||||
Block m_block_ek;
|
||||
Block m_block_ek0;
|
||||
Block m_block_tmp;
|
||||
size_t m_aad_size;
|
||||
size_t m_msg_size;
|
||||
u32 m_aad_remaining;
|
||||
u32 m_msg_remaining;
|
||||
u32 m_counter;
|
||||
Block m_h_mult_blocks[16];
|
||||
public:
|
||||
GcmModeImpl() : state(State_None) { /* ... */ }
|
||||
GcmModeImpl() : m_state(State_None) { /* ... */ }
|
||||
|
||||
~GcmModeImpl() {
|
||||
ClearMemory(this, sizeof(*this));
|
||||
|
||||
@@ -43,17 +43,17 @@ namespace ams::crypto::impl {
|
||||
State_Done = 2,
|
||||
};
|
||||
private:
|
||||
Hash hash_function;
|
||||
u32 key[BlockSize / sizeof(u32)];
|
||||
u32 mac[MacSize / sizeof(u32)];
|
||||
State state;
|
||||
Hash m_hash_function;
|
||||
u32 m_key[BlockSize / sizeof(u32)];
|
||||
u32 m_mac[MacSize / sizeof(u32)];
|
||||
State m_state;
|
||||
public:
|
||||
HmacImpl() : state(State_None) { /* ... */ }
|
||||
HmacImpl() : m_state(State_None) { /* ... */ }
|
||||
~HmacImpl() {
|
||||
static_assert(offsetof(HmacImpl, hash_function) == 0);
|
||||
static_assert(offsetof(HmacImpl, m_hash_function) == 0);
|
||||
|
||||
/* Clear everything except for the hash function. */
|
||||
ClearMemory(reinterpret_cast<u8 *>(this) + sizeof(this->hash_function), sizeof(*this) - sizeof(this->hash_function));
|
||||
ClearMemory(reinterpret_cast<u8 *>(this) + sizeof(m_hash_function), sizeof(*this) - sizeof(m_hash_function));
|
||||
}
|
||||
|
||||
void Initialize(const void *key, size_t key_size);
|
||||
@@ -64,64 +64,64 @@ namespace ams::crypto::impl {
|
||||
template<typename Hash>
|
||||
inline void HmacImpl<Hash>::Initialize(const void *key, size_t key_size) {
|
||||
/* Clear the key storage. */
|
||||
std::memset(this->key, 0, sizeof(this->key));
|
||||
std::memset(m_key, 0, sizeof(m_key));
|
||||
|
||||
/* Set the key storage. */
|
||||
if (key_size > BlockSize) {
|
||||
this->hash_function.Initialize();
|
||||
this->hash_function.Update(key, key_size);
|
||||
this->hash_function.GetHash(this->key, this->hash_function.HashSize);
|
||||
m_hash_function.Initialize();
|
||||
m_hash_function.Update(key, key_size);
|
||||
m_hash_function.GetHash(m_key, m_hash_function.HashSize);
|
||||
} else {
|
||||
std::memcpy(this->key, key, key_size);
|
||||
std::memcpy(m_key, key, key_size);
|
||||
}
|
||||
|
||||
/* Xor the key with the ipad. */
|
||||
for (size_t i = 0; i < util::size(this->key); i++) {
|
||||
this->key[i] ^= IpadMagic;
|
||||
for (size_t i = 0; i < util::size(m_key); i++) {
|
||||
m_key[i] ^= IpadMagic;
|
||||
}
|
||||
|
||||
/* Update the hash function with the xor'd key. */
|
||||
this->hash_function.Initialize();
|
||||
this->hash_function.Update(this->key, BlockSize);
|
||||
m_hash_function.Initialize();
|
||||
m_hash_function.Update(m_key, BlockSize);
|
||||
|
||||
/* Mark initialized. */
|
||||
this->state = State_Initialized;
|
||||
m_state = State_Initialized;
|
||||
}
|
||||
|
||||
template<typename Hash>
|
||||
inline void HmacImpl<Hash>::Update(const void *data, size_t data_size) {
|
||||
AMS_ASSERT(this->state == State_Initialized);
|
||||
AMS_ASSERT(m_state == State_Initialized);
|
||||
|
||||
this->hash_function.Update(data, data_size);
|
||||
m_hash_function.Update(data, data_size);
|
||||
}
|
||||
|
||||
template<typename Hash>
|
||||
inline void HmacImpl<Hash>::GetMac(void *dst, size_t dst_size) {
|
||||
AMS_ASSERT(this->state == State_Initialized || this->state == State_Done);
|
||||
AMS_ASSERT(m_state == State_Initialized || m_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) {
|
||||
if (m_state == State_Initialized) {
|
||||
/* Get the hash of ((key ^ ipad) || data). */
|
||||
this->hash_function.GetHash(this->mac, MacSize);
|
||||
m_hash_function.GetHash(m_mac, MacSize);
|
||||
|
||||
/* Xor the key with the opad. */
|
||||
for (size_t i = 0; i < util::size(this->key); i++) {
|
||||
this->key[i] ^= IpadMagicXorOpadMagic;
|
||||
for (size_t i = 0; i < util::size(m_key); i++) {
|
||||
m_key[i] ^= IpadMagicXorOpadMagic;
|
||||
}
|
||||
|
||||
/* Calculate the final mac as hash of ((key ^ opad) || hash((key ^ ipad) || data)) */
|
||||
this->hash_function.Initialize();
|
||||
this->hash_function.Update(this->key, BlockSize);
|
||||
this->hash_function.Update(this->mac, MacSize);
|
||||
this->hash_function.GetHash(this->mac, MacSize);
|
||||
m_hash_function.Initialize();
|
||||
m_hash_function.Update(m_key, BlockSize);
|
||||
m_hash_function.Update(m_mac, MacSize);
|
||||
m_hash_function.GetHash(m_mac, MacSize);
|
||||
|
||||
/* Set our state as done. */
|
||||
this->state = State_Done;
|
||||
m_state = State_Done;
|
||||
}
|
||||
|
||||
std::memcpy(dst, this->mac, MacSize);
|
||||
std::memcpy(dst, m_mac, MacSize);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -37,12 +37,12 @@ namespace ams::crypto::impl {
|
||||
bool finalized;
|
||||
};
|
||||
private:
|
||||
State state;
|
||||
State m_state;
|
||||
public:
|
||||
Sha1Impl() { /* ... */ }
|
||||
~Sha1Impl() {
|
||||
static_assert(std::is_trivially_destructible<State>::value);
|
||||
ClearMemory(std::addressof(this->state), sizeof(this->state));
|
||||
ClearMemory(std::addressof(m_state), sizeof(m_state));
|
||||
}
|
||||
|
||||
void Initialize();
|
||||
|
||||
@@ -42,12 +42,12 @@ namespace ams::crypto::impl {
|
||||
bool finalized;
|
||||
};
|
||||
private:
|
||||
State state;
|
||||
State m_state;
|
||||
public:
|
||||
Sha256Impl() { /* ... */ }
|
||||
~Sha256Impl() {
|
||||
static_assert(std::is_trivially_destructible<State>::value);
|
||||
ClearMemory(std::addressof(this->state), sizeof(this->state));
|
||||
ClearMemory(std::addressof(m_state), sizeof(m_state));
|
||||
}
|
||||
|
||||
void Initialize();
|
||||
@@ -57,13 +57,13 @@ namespace ams::crypto::impl {
|
||||
void InitializeWithContext(const Sha256Context *context);
|
||||
size_t GetContext(Sha256Context *context) const;
|
||||
|
||||
size_t GetBufferedDataSize() const { return this->state.num_buffered; }
|
||||
size_t GetBufferedDataSize() const { return m_state.num_buffered; }
|
||||
|
||||
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());
|
||||
std::memcpy(dst, m_state.buffer, this->GetBufferedDataSize());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -38,15 +38,15 @@ namespace ams::crypto::impl {
|
||||
State_Done
|
||||
};
|
||||
private:
|
||||
u8 buffer[BlockSize];
|
||||
u8 tweak[BlockSize];
|
||||
u8 last_block[BlockSize];
|
||||
size_t num_buffered;
|
||||
const void *cipher_ctx;
|
||||
void (*cipher_func)(void *dst_block, const void *src_block, const void *cipher_ctx);
|
||||
State state;
|
||||
u8 m_buffer[BlockSize];
|
||||
u8 m_tweak[BlockSize];
|
||||
u8 m_last_block[BlockSize];
|
||||
size_t m_num_buffered;
|
||||
const void *m_cipher_ctx;
|
||||
void (*m_cipher_func)(void *dst_block, const void *src_block, const void *cipher_ctx);
|
||||
State m_state;
|
||||
public:
|
||||
XtsModeImpl() : num_buffered(0), state(State_None) { /* ... */ }
|
||||
XtsModeImpl() : m_num_buffered(0), m_state(State_None) { /* ... */ }
|
||||
|
||||
~XtsModeImpl() {
|
||||
ClearMemory(this, sizeof(*this));
|
||||
@@ -67,10 +67,10 @@ namespace ams::crypto::impl {
|
||||
AMS_ASSERT(tweak_size == IvSize);
|
||||
AMS_UNUSED(tweak_size);
|
||||
|
||||
cipher->EncryptBlock(this->tweak, IvSize, tweak, IvSize);
|
||||
cipher->EncryptBlock(m_tweak, IvSize, tweak, IvSize);
|
||||
|
||||
this->num_buffered = 0;
|
||||
this->state = State_Initialized;
|
||||
m_num_buffered = 0;
|
||||
m_state = State_Initialized;
|
||||
}
|
||||
|
||||
void ProcessBlock(u8 *dst, const u8 *src);
|
||||
@@ -80,8 +80,8 @@ namespace ams::crypto::impl {
|
||||
static_assert(BlockCipher1::BlockSize == BlockSize);
|
||||
static_assert(BlockCipher2::BlockSize == BlockSize);
|
||||
|
||||
this->cipher_ctx = cipher1;
|
||||
this->cipher_func = EncryptBlockCallback<BlockCipher1>;
|
||||
m_cipher_ctx = cipher1;
|
||||
m_cipher_func = EncryptBlockCallback<BlockCipher1>;
|
||||
|
||||
this->Initialize(cipher2, tweak, tweak_size);
|
||||
}
|
||||
@@ -91,8 +91,8 @@ namespace ams::crypto::impl {
|
||||
static_assert(BlockCipher1::BlockSize == BlockSize);
|
||||
static_assert(BlockCipher2::BlockSize == BlockSize);
|
||||
|
||||
this->cipher_ctx = cipher1;
|
||||
this->cipher_func = DecryptBlockCallback<BlockCipher1>;
|
||||
m_cipher_ctx = cipher1;
|
||||
m_cipher_func = DecryptBlockCallback<BlockCipher1>;
|
||||
|
||||
this->Initialize(cipher2, tweak, tweak_size);
|
||||
}
|
||||
@@ -108,7 +108,7 @@ namespace ams::crypto::impl {
|
||||
}
|
||||
|
||||
size_t GetBufferedDataSize() const {
|
||||
return this->num_buffered;
|
||||
return m_num_buffered;
|
||||
}
|
||||
|
||||
constexpr size_t GetBlockSize() const {
|
||||
|
||||
Reference in New Issue
Block a user