tabulateL - calculate L_i for messages up to a length of m cipher blocks
| 147 | |
| 148 | // tabulateL - calculate L_i for messages up to a length of m cipher blocks |
| 149 | void EmeCryptContext::tabulateL(int m, CryptConfig *pConfig){ |
| 150 | |
| 151 | /* set L0 = 2*AESenc(K; 0) */ |
| 152 | BYTE eZero[16]; |
| 153 | memset(eZero, 0, sizeof(eZero)); |
| 154 | |
| 155 | LockZeroBuffer<BYTE> Li(16, true); |
| 156 | |
| 157 | AesEncrypt(Li.m_buf, eZero, 16, this); |
| 158 | |
| 159 | m_LTable = new LPBYTE[m]; |
| 160 | |
| 161 | // Allocate pool once and slice into m pieces in the loop |
| 162 | |
| 163 | m_pLTableBuf = new LockZeroBuffer<BYTE>(m * 16, true); |
| 164 | |
| 165 | pConfig->m_keybuf_manager.RegisterBuf(m_pLTableBuf); |
| 166 | |
| 167 | BYTE *pool = m_pLTableBuf->m_buf; |
| 168 | |
| 169 | for (int i = 0; i < m; i++) { |
| 170 | multByTwo(Li.m_buf, Li.m_buf, 16); |
| 171 | m_LTable[i] = pool + i * 16; |
| 172 | memcpy(m_LTable[i], Li.m_buf, 16); |
| 173 | } |
| 174 | |
| 175 | } |
| 176 | |
| 177 | |
| 178 |
nothing calls this directly
no test coverage detected