| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/evp/e_xcbc_d.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||
|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||
| 2 | - | |||||||
| 3 | - | |||||||
| 4 | - | |||||||
| 5 | - | |||||||
| 6 | static int desx_cbc_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | - | ||||||
| 7 | const unsigned char *iv, int enc); | - | ||||||
| 8 | static int desx_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | - | ||||||
| 9 | const unsigned char *in, size_t inl); | - | ||||||
| 10 | - | |||||||
| 11 | typedef struct { | - | ||||||
| 12 | DES_key_schedule ks; | - | ||||||
| 13 | DES_cblock inw; | - | ||||||
| 14 | DES_cblock outw; | - | ||||||
| 15 | } DESX_CBC_KEY; | - | ||||||
| 16 | - | |||||||
| 17 | - | |||||||
| 18 | - | |||||||
| 19 | static 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 | - | |||||||
| 39 | const EVP_CIPHER *EVP_desx_cbc(void) | - | ||||||
| 40 | { | - | ||||||
| 41 | return executed 1962 times by 1 test: &d_xcbc_cipher;return &d_xcbc_cipher;Executed by:
executed 1962 times by 1 test: return &d_xcbc_cipher;Executed by:
| 1962 | ||||||
| 42 | } | - | ||||||
| 43 | - | |||||||
| 44 | static 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: 1;return 1;Executed by:
executed 32 times by 1 test: return 1;Executed by:
| 32 | ||||||
| 54 | } | - | ||||||
| 55 | - | |||||||
| 56 | static 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))
| 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
| 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:
| 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:
| 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:
| 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:
| 180 | ||||||
| 73 | return executed 180 times by 1 test: 1;return 1;Executed by:
executed 180 times by 1 test: return 1;Executed by:
| 180 | ||||||
| 74 | } | - | ||||||
| Switch to Source code | Preprocessed file |