| 14 | } |
| 15 | |
| 16 | void CBC_MAC_Base::Update(const byte *input, size_t length) |
| 17 | { |
| 18 | unsigned int blockSize = AccessCipher().BlockSize(); |
| 19 | |
| 20 | while (m_counter && length) |
| 21 | { |
| 22 | m_reg[m_counter++] ^= *input++; |
| 23 | if (m_counter == blockSize) |
| 24 | ProcessBuf(); |
| 25 | length--; |
| 26 | } |
| 27 | |
| 28 | if (length >= blockSize) |
| 29 | { |
| 30 | size_t leftOver = AccessCipher().AdvancedProcessBlocks(m_reg, input, m_reg, length, BlockTransformation::BT_DontIncrementInOutPointers|BlockTransformation::BT_XorInput); |
| 31 | input += (length - leftOver); |
| 32 | length = leftOver; |
| 33 | } |
| 34 | |
| 35 | while (length--) |
| 36 | { |
| 37 | m_reg[m_counter++] ^= *input++; |
| 38 | if (m_counter == blockSize) |
| 39 | ProcessBuf(); |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | void CBC_MAC_Base::TruncatedFinal(byte *mac, size_t size) |
| 44 | { |
nothing calls this directly
no test coverage detected