* 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. */
| 206 | * store it in `dst`. `dst must be at least `dstlen` bytes long. |
| 207 | */ |
| 208 | static void generate_cipher_stream(void *dst, const struct secret *k, size_t dstlen) |
| 209 | { |
| 210 | const u8 nonce[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 211 | |
| 212 | crypto_stream_chacha20(dst, dstlen, nonce, k->data); |
| 213 | } |
| 214 | |
| 215 | /* xor cipher stream into dst */ |
| 216 | static void xor_cipher_stream(void *dst, const struct secret *k, size_t dstlen) |
no outgoing calls
no test coverage detected