Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/des/ecb_enc.c |
Source code | Switch to Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | /* | - | ||||||
2 | * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved. | - | ||||||
3 | * | - | ||||||
4 | * Licensed under the OpenSSL license (the "License"). You may not use | - | ||||||
5 | * this file except in compliance with the License. You can obtain a copy | - | ||||||
6 | * in the file LICENSE in the source distribution or at | - | ||||||
7 | * https://www.openssl.org/source/license.html | - | ||||||
8 | */ | - | ||||||
9 | - | |||||||
10 | #include "des_locl.h" | - | ||||||
11 | #include <openssl/opensslv.h> | - | ||||||
12 | #include <openssl/bio.h> | - | ||||||
13 | - | |||||||
14 | - | |||||||
15 | const char *DES_options(void) | - | ||||||
16 | { | - | ||||||
17 | static int init = 1; | - | ||||||
18 | static char buf[12]; | - | ||||||
19 | - | |||||||
20 | if (init) {
| 0 | ||||||
21 | if (sizeof(DES_LONG) != sizeof(long))
| 0 | ||||||
22 | OPENSSL_strlcpy(buf, "des(int)", sizeof(buf)); never executed: OPENSSL_strlcpy(buf, "des(int)", sizeof(buf)); | 0 | ||||||
23 | else | - | ||||||
24 | OPENSSL_strlcpy(buf, "des(long)", sizeof(buf)); never executed: OPENSSL_strlcpy(buf, "des(long)", sizeof(buf)); | 0 | ||||||
25 | init = 0; | - | ||||||
26 | } never executed: end of block | 0 | ||||||
27 | return buf; never executed: return buf; | 0 | ||||||
28 | } | - | ||||||
29 | - | |||||||
30 | void DES_ecb_encrypt(const_DES_cblock *input, DES_cblock *output, | - | ||||||
31 | DES_key_schedule *ks, int enc) | - | ||||||
32 | { | - | ||||||
33 | register DES_LONG l; | - | ||||||
34 | DES_LONG ll[2]; | - | ||||||
35 | const unsigned char *in = &(*input)[0]; | - | ||||||
36 | unsigned char *out = &(*output)[0]; | - | ||||||
37 | - | |||||||
38 | c2l(in, l); | - | ||||||
39 | ll[0] = l; | - | ||||||
40 | c2l(in, l); | - | ||||||
41 | ll[1] = l; | - | ||||||
42 | DES_encrypt1(ll, ks, enc); | - | ||||||
43 | l = ll[0]; | - | ||||||
44 | l2c(l, out); | - | ||||||
45 | l = ll[1]; | - | ||||||
46 | l2c(l, out); | - | ||||||
47 | l = ll[0] = ll[1] = 0; | - | ||||||
48 | } executed 1808 times by 1 test: end of block Executed by:
| 1808 | ||||||
Source code | Switch to Preprocessed file |