| 127 | } |
| 128 | |
| 129 | void Key_file::Entry::store (std::ostream& out) const |
| 130 | { |
| 131 | // Version |
| 132 | write_be32(out, KEY_FIELD_VERSION); |
| 133 | write_be32(out, 4); |
| 134 | write_be32(out, version); |
| 135 | |
| 136 | // AES key |
| 137 | write_be32(out, KEY_FIELD_AES_KEY); |
| 138 | write_be32(out, AES_KEY_LEN); |
| 139 | out.write(reinterpret_cast<const char*>(aes_key), AES_KEY_LEN); |
| 140 | |
| 141 | // HMAC key |
| 142 | write_be32(out, KEY_FIELD_HMAC_KEY); |
| 143 | write_be32(out, HMAC_KEY_LEN); |
| 144 | out.write(reinterpret_cast<const char*>(hmac_key), HMAC_KEY_LEN); |
| 145 | |
| 146 | // End |
| 147 | write_be32(out, KEY_FIELD_END); |
| 148 | } |
| 149 | |
| 150 | void Key_file::Entry::generate (uint32_t arg_version) |
| 151 | { |
no test coverage detected