OpenCoverage

e_xcbc_d.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/evp/e_xcbc_d.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6static int desx_cbc_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,-
7 const unsigned char *iv, int enc);-
8static int desx_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,-
9 const unsigned char *in, size_t inl);-
10-
11typedef struct {-
12 DES_key_schedule ks;-
13 DES_cblock inw;-
14 DES_cblock outw;-
15} DESX_CBC_KEY;-
16-
17-
18-
19static const EVP_CIPHER d_xcbc_cipher = {-
20 80,-
21 8, 24, 8,-
22 0x2,-
23 desx_cbc_init_key,-
24 desx_cbc_cipher,-
25 -
26 ((void *)0)-
27 ,-
28 sizeof(DESX_CBC_KEY),-
29 EVP_CIPHER_set_asn1_iv,-
30 EVP_CIPHER_get_asn1_iv,-
31 -
32 ((void *)0)-
33 ,-
34 -
35 ((void *)0)-
36-
37};-
38-
39const EVP_CIPHER *EVP_desx_cbc(void)-
40{-
41 return
executed 1962 times by 1 test: return &d_xcbc_cipher;
Executed by:
  • libcrypto.so.1.1
&d_xcbc_cipher;
executed 1962 times by 1 test: return &d_xcbc_cipher;
Executed by:
  • libcrypto.so.1.1
1962
42}-
43-
44static int desx_cbc_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,-
45 const unsigned char *iv, int enc)-
46{-
47 DES_cblock *deskey = (DES_cblock *)key;-
48-
49 DES_set_key_unchecked(deskey, &((DESX_CBC_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->ks);-
50 memcpy(&((DESX_CBC_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->inw[0], &key[8], 8);-
51 memcpy(&((DESX_CBC_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->outw[0], &key[16], 8);-
52-
53 return
executed 32 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 32 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
32
54}-
55-
56static int desx_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,-
57 const unsigned char *in, size_t inl)-
58{-
59 while (inl >= ((size_t)1<<(sizeof(long)*8-2))
inl >= ((size_...of(long)*8-2))Description
TRUEnever evaluated
FALSEevaluated 180 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-180
60 DES_xcbc_encrypt(in, out, (long)((size_t)1<<(sizeof(long)*8-2)), &((DESX_CBC_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->ks,-
61 (DES_cblock *)EVP_CIPHER_CTX_iv_noconst(ctx),-
62 &((DESX_CBC_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->inw, &((DESX_CBC_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->outw,-
63 EVP_CIPHER_CTX_encrypting(ctx));-
64 inl -= ((size_t)1<<(sizeof(long)*8-2));-
65 in += ((size_t)1<<(sizeof(long)*8-2));-
66 out += ((size_t)1<<(sizeof(long)*8-2));-
67 }
never executed: end of block
0
68 if (inl
inlDescription
TRUEevaluated 180 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-180
69 DES_xcbc_encrypt(in, out, (long)inl, &((DESX_CBC_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->ks,
executed 180 times by 1 test: DES_xcbc_encrypt(in, out, (long)inl, &((DESX_CBC_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->ks, (DES_cblock *)EVP_CIPHER_CTX_iv_noconst(ctx), &((DESX_CBC_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->inw, &((DESX_CBC_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->outw, EVP_CIPHER_CTX_encrypting(ctx));
Executed by:
  • libcrypto.so.1.1
180
70 (DES_cblock *)EVP_CIPHER_CTX_iv_noconst(ctx),
executed 180 times by 1 test: DES_xcbc_encrypt(in, out, (long)inl, &((DESX_CBC_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->ks, (DES_cblock *)EVP_CIPHER_CTX_iv_noconst(ctx), &((DESX_CBC_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->inw, &((DESX_CBC_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->outw, EVP_CIPHER_CTX_encrypting(ctx));
Executed by:
  • libcrypto.so.1.1
180
71 &((DESX_CBC_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->inw, &((DESX_CBC_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->outw,
executed 180 times by 1 test: DES_xcbc_encrypt(in, out, (long)inl, &((DESX_CBC_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->ks, (DES_cblock *)EVP_CIPHER_CTX_iv_noconst(ctx), &((DESX_CBC_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->inw, &((DESX_CBC_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->outw, EVP_CIPHER_CTX_encrypting(ctx));
Executed by:
  • libcrypto.so.1.1
180
72 EVP_CIPHER_CTX_encrypting(ctx));
executed 180 times by 1 test: DES_xcbc_encrypt(in, out, (long)inl, &((DESX_CBC_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->ks, (DES_cblock *)EVP_CIPHER_CTX_iv_noconst(ctx), &((DESX_CBC_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->inw, &((DESX_CBC_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->outw, EVP_CIPHER_CTX_encrypting(ctx));
Executed by:
  • libcrypto.so.1.1
180
73 return
executed 180 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 180 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
180
74}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2