| 175 | } |
| 176 | |
| 177 | int decrypt(const uint8_t iv[16], const uint8_t* inData, uint8_t* outData, size_t dataLength) { |
| 178 | check(dataLength % 16 == 0, "Length is not a multiple of 16 bytes (for AES 256)"); |
| 179 | uint8_t key[32]; |
| 180 | getKey(key); |
| 181 | |
| 182 | // TODO: Is this still needed after switching to regular AES functions? |
| 183 | uint8_t iv_copy[16]; |
| 184 | memcpy(iv_copy, iv, sizeof(iv_copy)); |
| 185 | |
| 186 | return aes256CryptCbc(key, MBEDTLS_AES_DECRYPT, dataLength, iv_copy, inData, outData); |
| 187 | } |
| 188 | |
| 189 | } // namespace |
nothing calls this directly
no test coverage detected