MCPcopy Create free account
hub / github.com/Tencent/MMKV / CodedInputDataCrypt

Method CodedInputDataCrypt

Core/CodedInputDataCrypt.cpp:41–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39namespace mmkv {
40
41CodedInputDataCrypt::CodedInputDataCrypt(const void *oData, size_t length, AESCrypt &crypt)
42 : m_ptr((uint8_t *) oData), m_size(length), m_position(0), m_decryptPosition(0), m_decrypter(crypt) {
43 m_decryptBufferSize = AES_IV_LEN * 2;
44 m_decryptBufferPosition = static_cast<size_t>(crypt.m_number);
45 m_decryptBufferDiscardPosition = m_decryptBufferPosition;
46 m_decryptBufferDecryptLength = m_decryptBufferPosition;
47
48 m_decryptBuffer = (uint8_t *) malloc(m_decryptBufferSize);
49 if (!m_decryptBuffer) {
50 throw runtime_error(strerror(errno));
51 }
52}
53
54CodedInputDataCrypt::~CodedInputDataCrypt() {
55 if (m_decryptBuffer) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected