OpenCoverage

e_cast.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/libressl/src/crypto/evp/e_cast.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8static int cast_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,-
9 const unsigned char *iv, int enc);-
10-
11typedef struct {-
12 CAST_KEY ks;-
13} EVP_CAST_KEY;-
14-
15-
16-
17static 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 12 times by 1 test
Evaluated by:
  • libcrypto.so.44.0.1
) { CAST_cbc_encrypt(in, out, (long)((size_t)1<<(sizeof(long)*8-2)), &((EVP_CAST_KEY *)ctx->cipher_data)->ks, ctx->iv, ctx->encrypt); 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 12 times by 1 test
Evaluated by:
  • libcrypto.so.44.0.1
FALSEnever evaluated
) CAST_cbc_encrypt(in, out, (long)inl, &((EVP_CAST_KEY *)ctx->cipher_data)->ks, ctx->iv, ctx->encrypt);
executed 12 times by 1 test: CAST_cbc_encrypt(in, out, (long)inl, &((EVP_CAST_KEY *)ctx->cipher_data)->ks, ctx->iv, ctx->encrypt);
Executed by:
  • libcrypto.so.44.0.1
return
executed 12 times by 1 test: return 1;
Executed by:
  • libcrypto.so.44.0.1
1;
executed 12 times by 1 test: return 1;
Executed by:
  • libcrypto.so.44.0.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 4 times by 1 test
Evaluated by:
  • libcrypto.so.44.0.1
) chunk>>=3;
never executed: chunk>>=3;
if (inl<chunk
inl<chunkDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.44.0.1
FALSEnever evaluated
) chunk=inl;
executed 4 times by 1 test: chunk=inl;
Executed by:
  • libcrypto.so.44.0.1
while(inl
inlDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.44.0.1
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.44.0.1
&& inl>=chunk
inl>=chunkDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.44.0.1
FALSEnever evaluated
) { CAST_cfb64_encrypt(in, out, (long)((64==1) && !(ctx->flags & 0x2000) ?inl*8:inl), &((EVP_CAST_KEY *)ctx->cipher_data)->ks, ctx->iv, &ctx->num, ctx->encrypt); inl-=chunk; in +=chunk; out+=chunk; if(inl<chunk
inl<chunkDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.44.0.1
FALSEnever evaluated
) chunk=inl;
executed 4 times by 1 test: chunk=inl;
Executed by:
  • libcrypto.so.44.0.1
}
executed 4 times by 1 test: end of block
Executed by:
  • libcrypto.so.44.0.1
return
executed 4 times by 1 test: return 1;
Executed by:
  • libcrypto.so.44.0.1
1;
executed 4 times by 1 test: return 1;
Executed by:
  • libcrypto.so.44.0.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 = ctx->cipher->block_size; if(inl < bl
inl < blDescription
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.44.0.1
) return
never executed: return 1;
1;
never executed: return 1;
inl -= bl; for(i=0; i <= inl
i <= inlDescription
TRUEevaluated 448 times by 1 test
Evaluated by:
  • libcrypto.so.44.0.1
FALSEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.44.0.1
; i+=bl) CAST_ecb_encrypt(in + i, out + i, &((EVP_CAST_KEY *)ctx->cipher_data)->ks, ctx->encrypt);
executed 448 times by 1 test: CAST_ecb_encrypt(in + i, out + i, &((EVP_CAST_KEY *)ctx->cipher_data)->ks, ctx->encrypt);
Executed by:
  • libcrypto.so.44.0.1
return
executed 6 times by 1 test: return 1;
Executed by:
  • libcrypto.so.44.0.1
1;
executed 6 times by 1 test: return 1;
Executed by:
  • libcrypto.so.44.0.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 4 times by 1 test
Evaluated by:
  • libcrypto.so.44.0.1
) { CAST_ofb64_encrypt(in, out, (long)((size_t)1<<(sizeof(long)*8-2)), &((EVP_CAST_KEY *)ctx->cipher_data)->ks, ctx->iv, &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 4 times by 1 test
Evaluated by:
  • libcrypto.so.44.0.1
FALSEnever evaluated
) CAST_ofb64_encrypt(in, out, (long)inl, &((EVP_CAST_KEY *)ctx->cipher_data)->ks, ctx->iv, &ctx->num);
executed 4 times by 1 test: CAST_ofb64_encrypt(in, out, (long)inl, &((EVP_CAST_KEY *)ctx->cipher_data)->ks, ctx->iv, &ctx->num);
Executed by:
  • libcrypto.so.44.0.1
return
executed 4 times by 1 test: return 1;
Executed by:
  • libcrypto.so.44.0.1
1;
executed 4 times by 1 test: return 1;
Executed by:
  • libcrypto.so.44.0.1
} static const EVP_CIPHER cast5_cbc = { 108, 8, 16, 8, 0x8 | 0x2, cast_init_key, cast5_cbc_cipher,
0-448
18((void *)0)-
19, sizeof(EVP_CAST_KEY), EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, -
20((void *)0)-
21, -
22((void *)0) -
23}; const EVP_CIPHER *EVP_cast5_cbc(void) { return
executed 292 times by 33 tests: return &cast5_cbc;
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
  • ...
&cast5_cbc;
executed 292 times by 33 tests: return &cast5_cbc;
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
  • ...
} static const EVP_CIPHER cast5_cfb64 = { 110, 1, 16, 8, 0x8 | 0x3, cast_init_key, cast5_cfb64_cipher,
292
24((void *)0)-
25, sizeof(EVP_CAST_KEY), EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, -
26((void *)0)-
27, -
28((void *)0) -
29}; const EVP_CIPHER *EVP_cast5_cfb64(void) { return
executed 292 times by 33 tests: return &cast5_cfb64;
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
  • ...
&cast5_cfb64;
executed 292 times by 33 tests: return &cast5_cfb64;
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
  • ...
} static const EVP_CIPHER cast5_ofb = { 111, 1, 16, 8, 0x8 | 0x4, cast_init_key, cast5_ofb_cipher,
292
30((void *)0)-
31, sizeof(EVP_CAST_KEY), EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, -
32((void *)0)-
33, -
34((void *)0) -
35}; const EVP_CIPHER *EVP_cast5_ofb(void) { return
executed 292 times by 33 tests: return &cast5_ofb;
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
  • ...
&cast5_ofb;
executed 292 times by 33 tests: return &cast5_ofb;
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
  • ...
} static const EVP_CIPHER cast5_ecb = { 109, 8, 16, 0, 0x8 | 0x1, cast_init_key, cast5_ecb_cipher,
292
36((void *)0)-
37, sizeof(EVP_CAST_KEY), EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, -
38((void *)0)-
39, -
40((void *)0) -
41}; const EVP_CIPHER *EVP_cast5_ecb(void) { return
executed 292 times by 33 tests: return &cast5_ecb;
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
  • ...
&cast5_ecb;
executed 292 times by 33 tests: return &cast5_ecb;
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
42-
43-
44-
45-
46static int-
47cast_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,-
48 const unsigned char *iv, int enc)-
49{-
50 CAST_set_key(&((EVP_CAST_KEY *)(ctx)->cipher_data)->ks, EVP_CIPHER_CTX_key_length(ctx), key);-
51 return
executed 20 times by 1 test: return 1;
Executed by:
  • libcrypto.so.44.0.1
1;
executed 20 times by 1 test: return 1;
Executed by:
  • libcrypto.so.44.0.1
20
52}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2