* Generate a pseudo-random byte stream of length `dstlen` from key `k` and * store it in `dst`. `dst must be at least `dstlen` bytes long. */
| 234 | * store it in `dst`. `dst must be at least `dstlen` bytes long. |
| 235 | */ |
| 236 | static void generate_cipher_stream(void *dst, const struct secret *k, size_t dstlen) |
| 237 | { |
| 238 | const u8 nonce[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 239 | |
| 240 | crypto_stream_chacha20(dst, dstlen, nonce, k->data); |
| 241 | } |
| 242 | |
| 243 | /* xor cipher stream into dst */ |
| 244 | static void xor_cipher_stream(void *dst, const struct secret *k, size_t dstlen) |
no outgoing calls
no test coverage detected