OpenCoverage

e_cast.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/evp/e_cast.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5static int cast_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,-
6 const unsigned char *iv, int enc);-
7-
8typedef struct {-
9 CAST_KEY ks;-
10} EVP_CAST_KEY;-
11-
12-
13-
14static 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))
inl>=((size_t)...of(long)*8-2))Description
TRUEnever evaluated
FALSEevaluated 387 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) { CAST_cbc_encrypt(in, out, (long)((size_t)1<<(sizeof(long)*8-2)), &((EVP_CAST_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 387 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) CAST_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 387 times by 1 test: CAST_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:
  • libcrypto.so.1.1
return
executed 387 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 387 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
} 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 == 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); CAST_cfb64_encrypt(in, out, (long) ((64 == 1) && !EVP_CIPHER_CTX_test_flags(ctx, 0x2000) ? chunk*8 : chunk), &((EVP_CAST_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
} 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 < 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) CAST_ecb_encrypt(in + i, out + i, &((EVP_CAST_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->ks, EVP_CIPHER_CTX_encrypting(ctx));
executed 1572 times by 1 test: CAST_ecb_encrypt(in + i, out + i, &((EVP_CAST_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->ks, EVP_CIPHER_CTX_encrypting(ctx));
Executed by:
  • libcrypto.so.1.1
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
} 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))
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); CAST_ofb64_encrypt(in, out, (long)((size_t)1<<(sizeof(long)*8-2)), &((EVP_CAST_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); CAST_ofb64_encrypt(in, out, (long)inl, &((EVP_CAST_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
} static const EVP_CIPHER cast5_cbc = { 108, 8, 16, 8, 0x8 | 0x2, cast_init_key, cast5_cbc_cipher,
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: return &cast5_cbc;
Executed by:
  • libcrypto.so.1.1
&cast5_cbc;
executed 1962 times by 1 test: return &cast5_cbc;
Executed by:
  • libcrypto.so.1.1
} static const EVP_CIPHER cast5_cfb64 = { 110, 1, 16, 8, 0x8 | 0x3, cast_init_key, cast5_cfb64_cipher,
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: return &cast5_cfb64;
Executed by:
  • libcrypto.so.1.1
&cast5_cfb64;
executed 1962 times by 1 test: return &cast5_cfb64;
Executed by:
  • libcrypto.so.1.1
} static const EVP_CIPHER cast5_ofb = { 111, 1, 16, 8, 0x8 | 0x4, cast_init_key, cast5_ofb_cipher,
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: return &cast5_ofb;
Executed by:
  • libcrypto.so.1.1
&cast5_ofb;
executed 1962 times by 1 test: return &cast5_ofb;
Executed by:
  • libcrypto.so.1.1
} static const EVP_CIPHER cast5_ecb = { 109, 8, 16, 0, 0x8 | 0x1, cast_init_key, cast5_ecb_cipher,
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: return &cast5_ecb;
Executed by:
  • libcrypto.so.1.1
&cast5_ecb;
executed 1962 times by 1 test: return &cast5_ecb;
Executed by:
  • libcrypto.so.1.1
}
1962
39-
40-
41-
42-
43static 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: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 36 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
36
48}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2