| 210 | } |
| 211 | |
| 212 | StreamCipher::IV AsyncFileEncrypted::getIV(uint32_t block) const { |
| 213 | auto iv = firstBlockIV; |
| 214 | |
| 215 | auto pBlock = reinterpret_cast<unsigned char*>(&block); |
| 216 | std::copy(pBlock, pBlock + 4, &iv[12]); |
| 217 | |
| 218 | return iv; |
| 219 | } |
| 220 | |
| 221 | Future<Void> AsyncFileEncrypted::writeLastBlockToFile() { |
| 222 | // The source buffer for the write is owned by *this so this must be kept alive by reference count until the write |