Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/libressl/src/crypto/evp/e_bf.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
4 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
5 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
6 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
7 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
8 | static int bf_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
9 | const unsigned char *iv, int enc); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
10 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
11 | typedef struct { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
12 | BF_KEY ks; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
13 | } EVP_BF_KEY; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
14 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
15 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
16 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
17 | static int bf_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) { while(inl>=((size_t)1<<(sizeof(long)*8-2))
never executed: if (inlend of block
executed 6 times by 1 test: returnBF_cbc_encrypt(in, out, (long)inl, &((EVP_BF_KEY *)ctx->cipher_data)->ks, ctx->iv, ctx->encrypt); Executed by:
executed 6 times by 1 test: 1;return 1; Executed by:
executed 6 times by 1 test: } static int bf_cfb64_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) { size_t chunk=((size_t)1<<(sizeof(long)*8-2)); if (64==1return 1; Executed by:
never executed: if (inl<chunkchunk>>=3;
executed 4 times by 1 test: while(inlchunk=inl; Executed by:
executed 4 times by 1 test: }chunk=inl; Executed by:
executed 4 times by 1 test: returnend of block Executed by:
executed 4 times by 1 test: 1;return 1; Executed by:
executed 4 times by 1 test: } static int bf_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) { size_t i, bl; bl = ctx->cipher->block_size; if(inl < blreturn 1; Executed by:
never executed: 1;return 1; never executed: inl -= bl; for(i=0; i <= inlreturn 1;
executed 448 times by 1 test: returnBF_ecb_encrypt(in + i, out + i, &((EVP_BF_KEY *)ctx->cipher_data)->ks, ctx->encrypt); Executed by:
executed 6 times by 1 test: 1;return 1; Executed by:
executed 6 times by 1 test: } static int bf_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) { while(inl>=((size_t)1<<(sizeof(long)*8-2))return 1; Executed by:
never executed: if (inlend of block
executed 4 times by 1 test: returnBF_ofb64_encrypt(in, out, (long)inl, &((EVP_BF_KEY *)ctx->cipher_data)->ks, ctx->iv, &ctx->num); Executed by:
executed 4 times by 1 test: 1;return 1; Executed by:
executed 4 times by 1 test: } static const EVP_CIPHER bf_cbc = { 91, 8, 16, 8, 0x8 | 0x2, bf_init_key, bf_cbc_cipher, return 1; Executed by:
| 0-448 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
18 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
19 | , sizeof(EVP_BF_KEY), EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
20 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
21 | , | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
22 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
23 | }; const EVP_CIPHER *EVP_bf_cbc(void) { return executed 292 times by 33 tests: &bf_cbc;return &bf_cbc; Executed by:
executed 292 times by 33 tests: } static const EVP_CIPHER bf_cfb64 = { 93, 1, 16, 8, 0x8 | 0x3, bf_init_key, bf_cfb64_cipher, return &bf_cbc; Executed by:
| 292 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
24 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
25 | , sizeof(EVP_BF_KEY), EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
26 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
27 | , | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
28 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
29 | }; const EVP_CIPHER *EVP_bf_cfb64(void) { return executed 292 times by 33 tests: &bf_cfb64;return &bf_cfb64; Executed by:
executed 292 times by 33 tests: } static const EVP_CIPHER bf_ofb = { 94, 1, 16, 8, 0x8 | 0x4, bf_init_key, bf_ofb_cipher, return &bf_cfb64; Executed by:
| 292 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
30 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
31 | , sizeof(EVP_BF_KEY), EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
32 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33 | , | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
34 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
35 | }; const EVP_CIPHER *EVP_bf_ofb(void) { return executed 292 times by 33 tests: &bf_ofb;return &bf_ofb; Executed by:
executed 292 times by 33 tests: } static const EVP_CIPHER bf_ecb = { 92, 8, 16, 0, 0x8 | 0x1, bf_init_key, bf_ecb_cipher, return &bf_ofb; Executed by:
| 292 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
36 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
37 | , sizeof(EVP_BF_KEY), EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
38 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
39 | , | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
40 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
41 | }; const EVP_CIPHER *EVP_bf_ecb(void) { return executed 292 times by 33 tests: &bf_ecb;return &bf_ecb; Executed by:
executed 292 times by 33 tests: }return &bf_ecb; Executed by:
| 292 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
42 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
43 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
44 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
45 | static int | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
46 | bf_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
47 | const unsigned char *iv, int enc) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
48 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
49 | BF_set_key(&((EVP_BF_KEY *)(ctx)->cipher_data)->ks, EVP_CIPHER_CTX_key_length(ctx), key); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
50 | return executed 16 times by 1 test: 1;return 1; Executed by:
executed 16 times by 1 test: return 1; Executed by:
| 16 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
51 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Switch to Source code | Preprocessed file |