MCPcopy Create free account
hub / github.com/LUX-Core/lux / Resync

Method Resync

src/cryptopp/ccm.cpp:28–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28void CCM_Base::Resync(const byte *iv, size_t len)
29{
30 BlockCipher &cipher = AccessBlockCipher();
31
32 m_L = REQUIRED_BLOCKSIZE-1-(int)len;
33 CRYPTOPP_ASSERT(m_L >= 2);
34 if (m_L > 8)
35 m_L = 8;
36
37 m_buffer[0] = byte(m_L-1); // flag
38 memcpy(m_buffer+1, iv, len);
39 memset(m_buffer+1+len, 0, REQUIRED_BLOCKSIZE-1-len);
40
41 if (m_state >= State_IVSet)
42 m_ctr.Resynchronize(m_buffer, REQUIRED_BLOCKSIZE);
43 else
44 m_ctr.SetCipherWithIV(cipher, m_buffer);
45
46 m_ctr.Seek(REQUIRED_BLOCKSIZE);
47 m_aadLength = 0;
48 m_messageLength = 0;
49}
50
51void CCM_Base::UncheckedSpecifyDataLengths(lword headerLength, lword messageLength, lword /*footerLength*/)
52{

Callers

nothing calls this directly

Calls 3

memcpyFunction · 0.85
ResynchronizeMethod · 0.45
SeekMethod · 0.45

Tested by

no test coverage detected