===== impl. =====
| 325 | |
| 326 | // ===== impl. ===== |
| 327 | void KeyBlock::Generate() { |
| 328 | _offset_data = butil::fast_rand() & 0xFFFFFFFF; |
| 329 | const uint8_t* p = (const uint8_t*)&_offset_data; |
| 330 | _offset = ((uint32_t)p[0] + p[1] + p[2] + p[3]) % (SIZE - KEY_SIZE - 4); |
| 331 | for (size_t i = 0; i < sizeof(_buf) / 8; ++i) { |
| 332 | ((uint64_t*)_buf)[i] = butil::fast_rand(); |
| 333 | } |
| 334 | } |
| 335 | |
| 336 | void KeyBlock::Load(const void* buf) { |
| 337 | // Layout of key (764 bytes) |
no test coverage detected