Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/libressl/src/crypto/evp/e_cast.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
4 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
5 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
6 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
7 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
8 | static int cast_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
9 | const unsigned char *iv, int enc); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
10 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
11 | typedef struct { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
12 | CAST_KEY ks; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
13 | } EVP_CAST_KEY; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
14 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
15 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
16 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
17 | static int cast5_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 12 times by 1 test: returnCAST_cbc_encrypt(in, out, (long)inl, &((EVP_CAST_KEY *)ctx->cipher_data)->ks, ctx->iv, ctx->encrypt); Executed by:
executed 12 times by 1 test: 1;return 1; Executed by:
executed 12 times by 1 test: } static int cast5_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 cast5_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: returnCAST_ecb_encrypt(in + i, out + i, &((EVP_CAST_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 cast5_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: returnCAST_ofb64_encrypt(in, out, (long)inl, &((EVP_CAST_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 cast5_cbc = { 108, 8, 16, 8, 0x8 | 0x2, cast_init_key, cast5_cbc_cipher, return 1; Executed by:
| 0-448 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
18 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
19 | , sizeof(EVP_CAST_KEY), EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
20 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
21 | , | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
22 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
23 | }; const EVP_CIPHER *EVP_cast5_cbc(void) { return executed 292 times by 33 tests: &cast5_cbc;return &cast5_cbc; Executed by:
executed 292 times by 33 tests: } static const EVP_CIPHER cast5_cfb64 = { 110, 1, 16, 8, 0x8 | 0x3, cast_init_key, cast5_cfb64_cipher, return &cast5_cbc; Executed by:
| 292 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
24 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
25 | , sizeof(EVP_CAST_KEY), EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
26 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
27 | , | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
28 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
29 | }; const EVP_CIPHER *EVP_cast5_cfb64(void) { return executed 292 times by 33 tests: &cast5_cfb64;return &cast5_cfb64; Executed by:
executed 292 times by 33 tests: } static const EVP_CIPHER cast5_ofb = { 111, 1, 16, 8, 0x8 | 0x4, cast_init_key, cast5_ofb_cipher, return &cast5_cfb64; Executed by:
| 292 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
30 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
31 | , sizeof(EVP_CAST_KEY), EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
32 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33 | , | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
34 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
35 | }; const EVP_CIPHER *EVP_cast5_ofb(void) { return executed 292 times by 33 tests: &cast5_ofb;return &cast5_ofb; Executed by:
executed 292 times by 33 tests: } static const EVP_CIPHER cast5_ecb = { 109, 8, 16, 0, 0x8 | 0x1, cast_init_key, cast5_ecb_cipher, return &cast5_ofb; Executed by:
| 292 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
36 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
37 | , sizeof(EVP_CAST_KEY), EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
38 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
39 | , | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
40 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
41 | }; const EVP_CIPHER *EVP_cast5_ecb(void) { return executed 292 times by 33 tests: &cast5_ecb;return &cast5_ecb; Executed by:
executed 292 times by 33 tests: }return &cast5_ecb; Executed by:
| 292 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
42 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
43 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
44 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
45 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
46 | static int | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
47 | cast_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
48 | const unsigned char *iv, int enc) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
49 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
50 | CAST_set_key(&((EVP_CAST_KEY *)(ctx)->cipher_data)->ks, EVP_CIPHER_CTX_key_length(ctx), key); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
51 | return executed 20 times by 1 test: 1;return 1; Executed by:
executed 20 times by 1 test: return 1; Executed by:
| 20 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
52 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Switch to Source code | Preprocessed file |