| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/libressl/src/crypto/md32_common.h |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | static inline uint32_t ROTATE(uint32_t a, uint32_t n) | - | ||||||||||||
| 2 | { | - | ||||||||||||
| 3 | return executed 3952 times by 2 tests: (a<<n)|(a>>(32-n));return (a<<n)|(a>>(32-n));Executed by:
executed 3952 times by 2 tests: return (a<<n)|(a>>(32-n));Executed by:
| 3952 | ||||||||||||
| 4 | } | - | ||||||||||||
| 5 | int | - | ||||||||||||
| 6 | SHA1_Update(SHA_CTX *c, const void *data_, size_t len) | - | ||||||||||||
| 7 | { | - | ||||||||||||
| 8 | const unsigned char *data = data_; | - | ||||||||||||
| 9 | unsigned char *p; | - | ||||||||||||
| 10 | unsigned int l; | - | ||||||||||||
| 11 | size_t n; | - | ||||||||||||
| 12 | - | |||||||||||||
| 13 | if (len == 0
| 551-149588 | ||||||||||||
| 14 | return executed 551 times by 8 tests: 1;return 1;Executed by:
executed 551 times by 8 tests: return 1;Executed by:
| 551 | ||||||||||||
| 15 | - | |||||||||||||
| 16 | l = (c->Nl + (((unsigned int)len) << 3))&0xffffffffUL; | - | ||||||||||||
| 17 | - | |||||||||||||
| 18 | - | |||||||||||||
| 19 | if (l < c->Nl
| 0-149588 | ||||||||||||
| 20 | c->Nh++; never executed: c->Nh++; | 0 | ||||||||||||
| 21 | c->Nh+=(unsigned int)(len>>29); | - | ||||||||||||
| 22 | c->Nl = l; | - | ||||||||||||
| 23 | - | |||||||||||||
| 24 | n = c->num; | - | ||||||||||||
| 25 | if (n != 0
| 28447-121141 | ||||||||||||
| 26 | p = (unsigned char *)c->data; | - | ||||||||||||
| 27 | - | |||||||||||||
| 28 | if (len >= (16*4)
| 5291-21102 | ||||||||||||
| 29 | memcpy (p + n, data, (16*4) - n); | - | ||||||||||||
| 30 | sha1_block_data_order (c, p, 1); | - | ||||||||||||
| 31 | n = (16*4) - n; | - | ||||||||||||
| 32 | data += n; | - | ||||||||||||
| 33 | len -= n; | - | ||||||||||||
| 34 | c->num = 0; | - | ||||||||||||
| 35 | memset (p,0,(16*4)); | - | ||||||||||||
| 36 | } executed 12636 times by 8 tests: else {end of blockExecuted by:
| 12636 | ||||||||||||
| 37 | memcpy (p + n, data, len); | - | ||||||||||||
| 38 | c->num += (unsigned int)len; | - | ||||||||||||
| 39 | return executed 15811 times by 8 tests: 1;return 1;Executed by:
executed 15811 times by 8 tests: return 1;Executed by:
| 15811 | ||||||||||||
| 40 | } | - | ||||||||||||
| 41 | } | - | ||||||||||||
| 42 | - | |||||||||||||
| 43 | n = len/(16*4); | - | ||||||||||||
| 44 | if (n > 0
| 43766-90011 | ||||||||||||
| 45 | sha1_block_data_order (c, data, n); | - | ||||||||||||
| 46 | n *= (16*4); | - | ||||||||||||
| 47 | data += n; | - | ||||||||||||
| 48 | len -= n; | - | ||||||||||||
| 49 | } executed 43766 times by 21 tests: end of blockExecuted by:
| 43766 | ||||||||||||
| 50 | - | |||||||||||||
| 51 | if (len != 0
| 35764-98013 | ||||||||||||
| 52 | p = (unsigned char *)c->data; | - | ||||||||||||
| 53 | c->num = (unsigned int)len; | - | ||||||||||||
| 54 | memcpy (p, data, len); | - | ||||||||||||
| 55 | } executed 98013 times by 22 tests: end of blockExecuted by:
| 98013 | ||||||||||||
| 56 | return executed 133777 times by 22 tests: 1;return 1;Executed by:
executed 133777 times by 22 tests: return 1;Executed by:
| 133777 | ||||||||||||
| 57 | } | - | ||||||||||||
| 58 | - | |||||||||||||
| 59 | - | |||||||||||||
| 60 | void SHA1_Transform (SHA_CTX *c, const unsigned char *data) | - | ||||||||||||
| 61 | { | - | ||||||||||||
| 62 | sha1_block_data_order (c, data, 1); | - | ||||||||||||
| 63 | } executed 1440 times by 1 test: end of blockExecuted by:
| 1440 | ||||||||||||
| 64 | - | |||||||||||||
| 65 | - | |||||||||||||
| 66 | - | |||||||||||||
| 67 | int SHA1_Final (unsigned char *md, SHA_CTX *c) | - | ||||||||||||
| 68 | { | - | ||||||||||||
| 69 | unsigned char *p = (unsigned char *)c->data; | - | ||||||||||||
| 70 | size_t n = c->num; | - | ||||||||||||
| 71 | - | |||||||||||||
| 72 | p[n] = 0x80; | - | ||||||||||||
| 73 | n++; | - | ||||||||||||
| 74 | - | |||||||||||||
| 75 | if (n > ((16*4) - 8)
| 87-85784 | ||||||||||||
| 76 | memset (p + n, 0, (16*4) - n); | - | ||||||||||||
| 77 | n = 0; | - | ||||||||||||
| 78 | sha1_block_data_order (c, p, 1); | - | ||||||||||||
| 79 | } executed 87 times by 8 tests: end of blockExecuted by:
| 87 | ||||||||||||
| 80 | memset (p + n, 0, (16*4) - 8 - n); | - | ||||||||||||
| 81 | - | |||||||||||||
| 82 | p += (16*4) - 8; | - | ||||||||||||
| 83 | - | |||||||||||||
| 84 | ({ unsigned int r=(c->Nh); asm ("bswapl %0":"=r"(r):"0"(r)); *((unsigned int *)(p))=r; (p)+=4; }); | - | ||||||||||||
| 85 | ({ unsigned int r=(c->Nl); asm ("bswapl %0":"=r"(r):"0"(r)); *((unsigned int *)(p))=r; (p)+=4; }); | - | ||||||||||||
| 86 | - | |||||||||||||
| 87 | - | |||||||||||||
| 88 | - | |||||||||||||
| 89 | - | |||||||||||||
| 90 | p -= (16*4); | - | ||||||||||||
| 91 | sha1_block_data_order (c, p, 1); | - | ||||||||||||
| 92 | c->num = 0; | - | ||||||||||||
| 93 | memset (p, 0, (16*4)); | - | ||||||||||||
| 94 | - | |||||||||||||
| 95 | - | |||||||||||||
| 96 | - | |||||||||||||
| 97 | - | |||||||||||||
| 98 | do { unsigned long ll; ll=(c)->h0; ({ unsigned int r=(ll); asm ("bswapl %0":"=r"(r):"0"(r)); *((unsigned int *)((md)))=r; ((md))+=4; }); ll=(c)->h1; ({ unsigned int r=(ll); asm ("bswapl %0":"=r"(r):"0"(r)); *((unsigned int *)((md)))=r; ((md))+=4; }); ll=(c)->h2; ({ unsigned int r=(ll); asm ("bswapl %0":"=r"(r):"0"(r)); *((unsigned int *)((md)))=r; ((md))+=4; }); ll=(c)->h3; ({ unsigned int r=(ll); asm ("bswapl %0":"=r"(r):"0"(r)); *((unsigned int *)((md)))=r; ((md))+=4; }); ll=(c)->h4; ({ unsigned int r=(ll); asm ("bswapl %0":"=r"(r):"0"(r)); *((unsigned int *)((md)))=r; ((md))+=4; }); } while (0); | - | ||||||||||||
| 99 | - | |||||||||||||
| 100 | - | |||||||||||||
| 101 | return executed 85871 times by 21 tests: 1;return 1;Executed by:
executed 85871 times by 21 tests: return 1;Executed by:
| 85871 | ||||||||||||
| 102 | } | - | ||||||||||||
| Switch to Source code | Preprocessed file |