OpenCoverage

e_idea.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/evp/e_idea.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7typedef struct {-
8 IDEA_KEY_SCHEDULE ks;-
9} EVP_IDEA_KEY;-
10-
11static int idea_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,-
12 const unsigned char *iv, int enc);-
13-
14-
15-
16-
17-
18-
19static int idea_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,-
20 const unsigned char *in, size_t inl)-
21{-
22 size_t i, bl; bl = EVP_CIPHER_CTX_cipher(ctx)->block_size; if (inl < bl
inl < blDescription
TRUEnever evaluated
FALSEevaluated 129 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) return
never executed: return 1;
1;
never executed: return 1;
inl -= bl; for (i=0; i <= inl
i <= inlDescription
TRUEevaluated 1572 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 129 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i+=bl)
0-1572
23 IDEA_ecb_encrypt(in + i, out + i, &((EVP_IDEA_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->ks);
executed 1572 times by 1 test: IDEA_ecb_encrypt(in + i, out + i, &((EVP_IDEA_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->ks);
Executed by:
  • libcrypto.so.1.1
1572
24 return
executed 129 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 129 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
129
25}-
26-
27static int idea_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))
inl>=((size_t)...of(long)*8-2))Description
TRUEnever evaluated
FALSEevaluated 519 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) { IDEA_cbc_encrypt(in, out, (long)((size_t)1<<(sizeof(long)*8-2)), &((EVP_IDEA_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->ks, EVP_CIPHER_CTX_iv_noconst(ctx), EVP_CIPHER_CTX_encrypting(ctx)); inl-=((size_t)1<<(sizeof(long)*8-2)); in +=((size_t)1<<(sizeof(long)*8-2)); out+=((size_t)1<<(sizeof(long)*8-2)); }
never executed: end of block
if (inl
inlDescription
TRUEevaluated 519 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) IDEA_cbc_encrypt(in, out, (long)inl, &((EVP_IDEA_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->ks, EVP_CIPHER_CTX_iv_noconst(ctx), EVP_CIPHER_CTX_encrypting(ctx));
executed 519 times by 1 test: IDEA_cbc_encrypt(in, out, (long)inl, &((EVP_IDEA_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->ks, EVP_CIPHER_CTX_iv_noconst(ctx), EVP_CIPHER_CTX_encrypting(ctx));
Executed by:
  • libcrypto.so.1.1
return
executed 519 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 519 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
}
0-519
28static int idea_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))
inl>=((size_t)...of(long)*8-2))Description
TRUEnever evaluated
FALSEevaluated 70 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) { int num = EVP_CIPHER_CTX_num(ctx); IDEA_ofb64_encrypt(in, out, (long)((size_t)1<<(sizeof(long)*8-2)), &((EVP_IDEA_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->ks, EVP_CIPHER_CTX_iv_noconst(ctx), &num); EVP_CIPHER_CTX_set_num(ctx, num); inl-=((size_t)1<<(sizeof(long)*8-2)); in +=((size_t)1<<(sizeof(long)*8-2)); out+=((size_t)1<<(sizeof(long)*8-2)); }
never executed: end of block
if (inl
inlDescription
TRUEevaluated 70 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) { int num = EVP_CIPHER_CTX_num(ctx); IDEA_ofb64_encrypt(in, out, (long)inl, &((EVP_IDEA_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->ks, EVP_CIPHER_CTX_iv_noconst(ctx), &num); EVP_CIPHER_CTX_set_num(ctx, num); }
executed 70 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
return
executed 70 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 70 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
}
0-70
29static int idea_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 == 1
64 == 1Description
TRUEnever evaluated
FALSEevaluated 70 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) chunk >>= 3;
never executed: chunk >>= 3;
if (inl < chunk
inl < chunkDescription
TRUEevaluated 70 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) chunk = inl;
executed 70 times by 1 test: chunk = inl;
Executed by:
  • libcrypto.so.1.1
while (inl
inlDescription
TRUEevaluated 70 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 70 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& inl >= chunk
inl >= chunkDescription
TRUEevaluated 70 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) { int num = EVP_CIPHER_CTX_num(ctx); IDEA_cfb64_encrypt(in, out, (long) ((64 == 1) && !EVP_CIPHER_CTX_test_flags(ctx, 0x2000) ? chunk*8 : chunk), &((EVP_IDEA_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->ks, EVP_CIPHER_CTX_iv_noconst(ctx), &num, EVP_CIPHER_CTX_encrypting(ctx)); EVP_CIPHER_CTX_set_num(ctx, num); inl -= chunk; in += chunk; out += chunk; if (inl < chunk
inl < chunkDescription
TRUEevaluated 70 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) chunk = inl;
executed 70 times by 1 test: chunk = inl;
Executed by:
  • libcrypto.so.1.1
}
executed 70 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
return
executed 70 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 70 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
}
0-70
30-
31static const EVP_CIPHER idea_cbc = { 34, 8, 16, 8, 0 | 0x2, idea_init_key, idea_cbc_cipher, -
32((void *)0)-
33, sizeof(IDEA_KEY_SCHEDULE), EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, -
34((void *)0)-
35, -
36((void *)0) -
37}; const EVP_CIPHER *EVP_idea_cbc(void) { return
executed 3920 times by 1 test: return &idea_cbc;
Executed by:
  • libcrypto.so.1.1
&idea_cbc;
executed 3920 times by 1 test: return &idea_cbc;
Executed by:
  • libcrypto.so.1.1
} static const EVP_CIPHER idea_cfb64 = { 35, 1, 16, 8, 0 | 0x3, idea_init_key, idea_cfb64_cipher,
3920
38((void *)0)-
39, sizeof(IDEA_KEY_SCHEDULE), EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, -
40((void *)0)-
41, -
42((void *)0) -
43}; const EVP_CIPHER *EVP_idea_cfb64(void) { return
executed 1962 times by 1 test: return &idea_cfb64;
Executed by:
  • libcrypto.so.1.1
&idea_cfb64;
executed 1962 times by 1 test: return &idea_cfb64;
Executed by:
  • libcrypto.so.1.1
} static const EVP_CIPHER idea_ofb = { 46, 1, 16, 8, 0 | 0x4, idea_init_key, idea_ofb_cipher,
1962
44((void *)0)-
45, sizeof(IDEA_KEY_SCHEDULE), EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, -
46((void *)0)-
47, -
48((void *)0) -
49}; const EVP_CIPHER *EVP_idea_ofb(void) { return
executed 1962 times by 1 test: return &idea_ofb;
Executed by:
  • libcrypto.so.1.1
&idea_ofb;
executed 1962 times by 1 test: return &idea_ofb;
Executed by:
  • libcrypto.so.1.1
} static const EVP_CIPHER idea_ecb = { 36, 8, 16, 0, 0 | 0x1, idea_init_key, idea_ecb_cipher,
1962
50((void *)0)-
51, sizeof(IDEA_KEY_SCHEDULE), EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, -
52((void *)0)-
53, -
54((void *)0) -
55}; const EVP_CIPHER *EVP_idea_ecb(void) { return
executed 1962 times by 1 test: return &idea_ecb;
Executed by:
  • libcrypto.so.1.1
&idea_ecb;
executed 1962 times by 1 test: return &idea_ecb;
Executed by:
  • libcrypto.so.1.1
}
1962
56-
57-
58-
59static int idea_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,-
60 const unsigned char *iv, int enc)-
61{-
62 if (!enc
!encDescription
TRUEevaluated 83 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 141 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
83-141
63 if ((
(EVP_CIPHER_fl...xF0007) == 0x4Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 80 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
EVP_CIPHER_flags(EVP_CIPHER_CTX_cipher(ctx)) & 0xF0007) == 0x4
(EVP_CIPHER_fl...xF0007) == 0x4Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 80 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
3-80
64 enc = 1;
executed 3 times by 1 test: enc = 1;
Executed by:
  • libcrypto.so.1.1
3
65 else if ((
(EVP_CIPHER_fl...xF0007) == 0x3Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 77 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
EVP_CIPHER_flags(EVP_CIPHER_CTX_cipher(ctx)) & 0xF0007) == 0x3
(EVP_CIPHER_fl...xF0007) == 0x3Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 77 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
3-77
66 enc = 1;
executed 3 times by 1 test: enc = 1;
Executed by:
  • libcrypto.so.1.1
3
67 }
executed 83 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
83
68 if (enc
encDescription
TRUEevaluated 147 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 77 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
77-147
69 IDEA_set_encrypt_key(key, &((EVP_IDEA_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->ks);
executed 147 times by 1 test: IDEA_set_encrypt_key(key, &((EVP_IDEA_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->ks);
Executed by:
  • libcrypto.so.1.1
147
70 else {-
71 IDEA_KEY_SCHEDULE tmp;-
72-
73 IDEA_set_encrypt_key(key, &tmp);-
74 IDEA_set_decrypt_key(&tmp, &((EVP_IDEA_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->ks);-
75 OPENSSL_cleanse((unsigned char *)&tmp, sizeof(IDEA_KEY_SCHEDULE));-
76 }
executed 77 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
77
77 return
executed 224 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 224 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
224
78}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2