Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/evp/e_cast.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
4 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
5 | static int cast_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
6 | const unsigned char *iv, int enc); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
7 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
8 | typedef struct { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
9 | CAST_KEY ks; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
10 | } EVP_CAST_KEY; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
11 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
12 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
13 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
14 | 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 387 times by 1 test: returnCAST_cbc_encrypt(in, out, (long)inl, &((EVP_CAST_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->ks, EVP_CIPHER_CTX_iv_noconst(ctx), EVP_CIPHER_CTX_encrypting(ctx)); Executed by:
executed 387 times by 1 test: 1;return 1; Executed by:
executed 387 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 70 times by 1 test: while (inlchunk = inl; Executed by:
executed 70 times by 1 test: }chunk = inl; Executed by:
executed 70 times by 1 test: returnend of block Executed by:
executed 70 times by 1 test: 1;return 1; Executed by:
executed 70 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 = EVP_CIPHER_CTX_cipher(ctx)->block_size; if (inl < blreturn 1; Executed by:
never executed: 1;return 1; never executed: inl -= bl; for (i=0; i <= inlreturn 1;
executed 1572 times by 1 test: returnCAST_ecb_encrypt(in + i, out + i, &((EVP_CAST_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->ks, EVP_CIPHER_CTX_encrypting(ctx)); Executed by:
executed 129 times by 1 test: 1;return 1; Executed by:
executed 129 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 70 times by 1 test: returnend of block Executed by:
executed 70 times by 1 test: 1;return 1; Executed by:
executed 70 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-1572 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
15 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
16 | , sizeof(EVP_CAST_KEY), EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
17 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
18 | , | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
19 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
20 | }; const EVP_CIPHER *EVP_cast5_cbc(void) { return executed 1962 times by 1 test: &cast5_cbc;return &cast5_cbc; Executed by:
executed 1962 times by 1 test: } static const EVP_CIPHER cast5_cfb64 = { 110, 1, 16, 8, 0x8 | 0x3, cast_init_key, cast5_cfb64_cipher, return &cast5_cbc; Executed by:
| 1962 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
21 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
22 | , sizeof(EVP_CAST_KEY), EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
23 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
24 | , | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
25 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
26 | }; const EVP_CIPHER *EVP_cast5_cfb64(void) { return executed 1962 times by 1 test: &cast5_cfb64;return &cast5_cfb64; Executed by:
executed 1962 times by 1 test: } static const EVP_CIPHER cast5_ofb = { 111, 1, 16, 8, 0x8 | 0x4, cast_init_key, cast5_ofb_cipher, return &cast5_cfb64; Executed by:
| 1962 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
27 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
28 | , sizeof(EVP_CAST_KEY), EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
29 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
30 | , | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
31 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
32 | }; const EVP_CIPHER *EVP_cast5_ofb(void) { return executed 1962 times by 1 test: &cast5_ofb;return &cast5_ofb; Executed by:
executed 1962 times by 1 test: } static const EVP_CIPHER cast5_ecb = { 109, 8, 16, 0, 0x8 | 0x1, cast_init_key, cast5_ecb_cipher, return &cast5_ofb; Executed by:
| 1962 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
34 | , sizeof(EVP_CAST_KEY), EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
35 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
36 | , | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
37 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
38 | }; const EVP_CIPHER *EVP_cast5_ecb(void) { return executed 1962 times by 1 test: &cast5_ecb;return &cast5_ecb; Executed by:
executed 1962 times by 1 test: }return &cast5_ecb; Executed by:
| 1962 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
39 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
40 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
41 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
42 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
43 | static int cast_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
44 | const unsigned char *iv, int enc) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
45 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
46 | CAST_set_key(&((EVP_CAST_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->ks, EVP_CIPHER_CTX_key_length(ctx), key); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
47 | return executed 36 times by 1 test: 1;return 1; Executed by:
executed 36 times by 1 test: return 1; Executed by:
| 36 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
48 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Switch to Source code | Preprocessed file |