Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/libressl/src/crypto/evp/e_chacha.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | - | |||||||
4 | - | |||||||
5 | - | |||||||
6 | - | |||||||
7 | static int chacha_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | - | ||||||
8 | const unsigned char *in, size_t len); | - | ||||||
9 | static int chacha_init(EVP_CIPHER_CTX *ctx, const unsigned char *key, | - | ||||||
10 | const unsigned char *iv, int enc); | - | ||||||
11 | - | |||||||
12 | static const EVP_CIPHER chacha20_cipher = { | - | ||||||
13 | .nid = 937, | - | ||||||
14 | .block_size = 1, | - | ||||||
15 | .key_len = 32, | - | ||||||
16 | .iv_len = 8, | - | ||||||
17 | .flags = 0x0, | - | ||||||
18 | .init = chacha_init, | - | ||||||
19 | .do_cipher = chacha_cipher, | - | ||||||
20 | .ctx_size = sizeof(ChaCha_ctx) | - | ||||||
21 | }; | - | ||||||
22 | - | |||||||
23 | const EVP_CIPHER * | - | ||||||
24 | EVP_chacha20(void) | - | ||||||
25 | { | - | ||||||
26 | return executed 292 times by 33 tests: (&chacha20_cipher);return (&chacha20_cipher); Executed by:
executed 292 times by 33 tests: return (&chacha20_cipher); Executed by:
| 292 | ||||||
27 | } | - | ||||||
28 | - | |||||||
29 | static int | - | ||||||
30 | chacha_init(EVP_CIPHER_CTX *ctx, const unsigned char *key, | - | ||||||
31 | const unsigned char *iv, int enc) | - | ||||||
32 | { | - | ||||||
33 | ChaCha_set_key((ChaCha_ctx *)ctx->cipher_data, key, | - | ||||||
34 | EVP_CIPHER_CTX_key_length(ctx) * 8); | - | ||||||
35 | if (iv !=
| 0-8 | ||||||
36 | ((void *)0)
| 0-8 | ||||||
37 | ) | - | ||||||
38 | ChaCha_set_iv((ChaCha_ctx *)ctx->cipher_data, iv, executed 8 times by 1 test: ChaCha_set_iv((ChaCha_ctx *)ctx->cipher_data, iv, ((void *)0) ); Executed by:
| 8 | ||||||
39 | ((void *)0) executed 8 times by 1 test: ChaCha_set_iv((ChaCha_ctx *)ctx->cipher_data, iv, ((void *)0) ); Executed by:
| 8 | ||||||
40 | ); executed 8 times by 1 test: ChaCha_set_iv((ChaCha_ctx *)ctx->cipher_data, iv, ((void *)0) ); Executed by:
| 8 | ||||||
41 | return executed 8 times by 1 test: 1;return 1; Executed by:
executed 8 times by 1 test: return 1; Executed by:
| 8 | ||||||
42 | } | - | ||||||
43 | - | |||||||
44 | static int | - | ||||||
45 | chacha_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, | - | ||||||
46 | size_t len) | - | ||||||
47 | { | - | ||||||
48 | ChaCha((ChaCha_ctx *)ctx->cipher_data, out, in, len); | - | ||||||
49 | return executed 8 times by 1 test: 1;return 1; Executed by:
executed 8 times by 1 test: return 1; Executed by:
| 8 | ||||||
50 | } | - | ||||||
Switch to Source code | Preprocessed file |