OpenCoverage

e_xcbc_d.c

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

Generated by Squish Coco 4.2.2