Line | Source Code | Coverage |
---|
1 | /* | - |
2 | * MD4 (RFC-1320) message digest. | - |
3 | * Modified from MD5 code by Andrey Panin <pazke@donpac.ru> | - |
4 | * | - |
5 | * Written by Solar Designer <solar@openwall.com> in 2001, and placed in | - |
6 | * the public domain. There's absolutely no warranty. | - |
7 | * | - |
8 | * This differs from Colin Plumb's older public domain implementation in | - |
9 | * that no 32-bit integer data type is required, there's no compile-time | - |
10 | * endianness configuration, and the function prototypes match OpenSSL's. | - |
11 | * The primary goals are portability and ease of use. | - |
12 | * | - |
13 | * This implementation is meant to be fast, but not as fast as possible. | - |
14 | * Some known optimizations are not included to reduce source code size | - |
15 | * and avoid compile-time configuration. | - |
16 | */ | - |
17 | | - |
18 | #include "md4.h" | - |
19 | | - |
20 | #include <string.h> | - |
21 | | - |
22 | QT_BEGIN_NAMESPACE | - |
23 | | - |
24 | /* | - |
25 | * The basic MD4 functions. | - |
26 | */ | - |
27 | #define F(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) | - |
28 | #define G(x, y, z) (((x) & (y)) | ((x) & (z)) | ((y) & (z))) | - |
29 | #define H(x, y, z) ((x) ^ (y) ^ (z)) | - |
30 | | - |
31 | /* | - |
32 | * The MD4 transformation for all four rounds. | - |
33 | */ | - |
34 | #define STEP(f, a, b, c, d, x, s) \ | - |
35 | (a) += f((b), (c), (d)) + (x); \ | - |
36 | (a) = ((a) << (s)) | ((a) >> (32 - (s))) | - |
37 | | - |
38 | | - |
39 | /* | - |
40 | * SET reads 4 input bytes in little-endian byte order and stores them | - |
41 | * in a properly aligned word in host byte order. | - |
42 | * | - |
43 | * The check for little-endian architectures which tolerate unaligned | - |
44 | * memory accesses is just an optimization. Nothing will break if it | - |
45 | * doesn't work. | - |
46 | */ | - |
47 | #if defined(__i386__) || defined(__x86_64__) | - |
48 | #define SET(n) \ | - |
49 | (*(const quint32 *)&ptr[(n) * 4]) | - |
50 | #define GET(n) \ | - |
51 | SET(n) | - |
52 | #else | - |
53 | #define SET(n) \ | - |
54 | (ctx->block[(n)] = \ | - |
55 | (quint32)ptr[(n) * 4] | \ | - |
56 | ((quint32)ptr[(n) * 4 + 1] << 8) | \ | - |
57 | ((quint32)ptr[(n) * 4 + 2] << 16) | \ | - |
58 | ((quint32)ptr[(n) * 4 + 3] << 24)) | - |
59 | #define GET(n) \ | - |
60 | (ctx->block[(n)]) | - |
61 | #endif | - |
62 | | - |
63 | /* | - |
64 | * This processes one or more 64-byte data blocks, but does NOT update | - |
65 | * the bit counters. There're no alignment requirements. | - |
66 | */ | - |
67 | static const unsigned char *body(struct md4_context *ctx, const unsigned char *data, size_t size) | - |
68 | { | - |
69 | const unsigned char *ptr; executed (the execution status of this line is deduced): const unsigned char *ptr; | - |
70 | quint32 a, b, c, d; executed (the execution status of this line is deduced): quint32 a, b, c, d; | - |
71 | quint32 saved_a, saved_b, saved_c, saved_d; executed (the execution status of this line is deduced): quint32 saved_a, saved_b, saved_c, saved_d; | - |
72 | | - |
73 | ptr = data; executed (the execution status of this line is deduced): ptr = data; | - |
74 | | - |
75 | a = ctx->a; executed (the execution status of this line is deduced): a = ctx->a; | - |
76 | b = ctx->b; executed (the execution status of this line is deduced): b = ctx->b; | - |
77 | c = ctx->c; executed (the execution status of this line is deduced): c = ctx->c; | - |
78 | d = ctx->d; executed (the execution status of this line is deduced): d = ctx->d; | - |
79 | | - |
80 | do { | - |
81 | saved_a = a; executed (the execution status of this line is deduced): saved_a = a; | - |
82 | saved_b = b; executed (the execution status of this line is deduced): saved_b = b; | - |
83 | saved_c = c; executed (the execution status of this line is deduced): saved_c = c; | - |
84 | saved_d = d; executed (the execution status of this line is deduced): saved_d = d; | - |
85 | | - |
86 | /* Round 1 */ | - |
87 | STEP(F, a, b, c, d, SET( 0), 3); executed (the execution status of this line is deduced): (a) += (((d)) ^ (((b)) & (((c)) ^ ((d))))) + ((*(const quint32 *)&ptr[(0) * 4])); (a) = ((a) << (3)) | ((a) >> (32 - (3))); | - |
88 | STEP(F, d, a, b, c, SET( 1), 7); executed (the execution status of this line is deduced): (d) += (((c)) ^ (((a)) & (((b)) ^ ((c))))) + ((*(const quint32 *)&ptr[(1) * 4])); (d) = ((d) << (7)) | ((d) >> (32 - (7))); | - |
89 | STEP(F, c, d, a, b, SET( 2), 11); executed (the execution status of this line is deduced): (c) += (((b)) ^ (((d)) & (((a)) ^ ((b))))) + ((*(const quint32 *)&ptr[(2) * 4])); (c) = ((c) << (11)) | ((c) >> (32 - (11))); | - |
90 | STEP(F, b, c, d, a, SET( 3), 19); executed (the execution status of this line is deduced): (b) += (((a)) ^ (((c)) & (((d)) ^ ((a))))) + ((*(const quint32 *)&ptr[(3) * 4])); (b) = ((b) << (19)) | ((b) >> (32 - (19))); | - |
91 | | - |
92 | STEP(F, a, b, c, d, SET( 4), 3); executed (the execution status of this line is deduced): (a) += (((d)) ^ (((b)) & (((c)) ^ ((d))))) + ((*(const quint32 *)&ptr[(4) * 4])); (a) = ((a) << (3)) | ((a) >> (32 - (3))); | - |
93 | STEP(F, d, a, b, c, SET( 5), 7); executed (the execution status of this line is deduced): (d) += (((c)) ^ (((a)) & (((b)) ^ ((c))))) + ((*(const quint32 *)&ptr[(5) * 4])); (d) = ((d) << (7)) | ((d) >> (32 - (7))); | - |
94 | STEP(F, c, d, a, b, SET( 6), 11); executed (the execution status of this line is deduced): (c) += (((b)) ^ (((d)) & (((a)) ^ ((b))))) + ((*(const quint32 *)&ptr[(6) * 4])); (c) = ((c) << (11)) | ((c) >> (32 - (11))); | - |
95 | STEP(F, b, c, d, a, SET( 7), 19); executed (the execution status of this line is deduced): (b) += (((a)) ^ (((c)) & (((d)) ^ ((a))))) + ((*(const quint32 *)&ptr[(7) * 4])); (b) = ((b) << (19)) | ((b) >> (32 - (19))); | - |
96 | | - |
97 | STEP(F, a, b, c, d, SET( 8), 3); executed (the execution status of this line is deduced): (a) += (((d)) ^ (((b)) & (((c)) ^ ((d))))) + ((*(const quint32 *)&ptr[(8) * 4])); (a) = ((a) << (3)) | ((a) >> (32 - (3))); | - |
98 | STEP(F, d, a, b, c, SET( 9), 7); executed (the execution status of this line is deduced): (d) += (((c)) ^ (((a)) & (((b)) ^ ((c))))) + ((*(const quint32 *)&ptr[(9) * 4])); (d) = ((d) << (7)) | ((d) >> (32 - (7))); | - |
99 | STEP(F, c, d, a, b, SET(10), 11); executed (the execution status of this line is deduced): (c) += (((b)) ^ (((d)) & (((a)) ^ ((b))))) + ((*(const quint32 *)&ptr[(10) * 4])); (c) = ((c) << (11)) | ((c) >> (32 - (11))); | - |
100 | STEP(F, b, c, d, a, SET(11), 19); executed (the execution status of this line is deduced): (b) += (((a)) ^ (((c)) & (((d)) ^ ((a))))) + ((*(const quint32 *)&ptr[(11) * 4])); (b) = ((b) << (19)) | ((b) >> (32 - (19))); | - |
101 | | - |
102 | STEP(F, a, b, c, d, SET(12), 3); executed (the execution status of this line is deduced): (a) += (((d)) ^ (((b)) & (((c)) ^ ((d))))) + ((*(const quint32 *)&ptr[(12) * 4])); (a) = ((a) << (3)) | ((a) >> (32 - (3))); | - |
103 | STEP(F, d, a, b, c, SET(13), 7); executed (the execution status of this line is deduced): (d) += (((c)) ^ (((a)) & (((b)) ^ ((c))))) + ((*(const quint32 *)&ptr[(13) * 4])); (d) = ((d) << (7)) | ((d) >> (32 - (7))); | - |
104 | STEP(F, c, d, a, b, SET(14), 11); executed (the execution status of this line is deduced): (c) += (((b)) ^ (((d)) & (((a)) ^ ((b))))) + ((*(const quint32 *)&ptr[(14) * 4])); (c) = ((c) << (11)) | ((c) >> (32 - (11))); | - |
105 | STEP(F, b, c, d, a, SET(15), 19); executed (the execution status of this line is deduced): (b) += (((a)) ^ (((c)) & (((d)) ^ ((a))))) + ((*(const quint32 *)&ptr[(15) * 4])); (b) = ((b) << (19)) | ((b) >> (32 - (19))); | - |
106 | /* Round 2 */ | - |
107 | STEP(G, a, b, c, d, GET( 0) + 0x5A827999, 3); executed (the execution status of this line is deduced): (a) += ((((b)) & ((c))) | (((b)) & ((d))) | (((c)) & ((d)))) + ((*(const quint32 *)&ptr[(0) * 4]) + 0x5A827999); (a) = ((a) << (3)) | ((a) >> (32 - (3))); | - |
108 | STEP(G, d, a, b, c, GET( 4) + 0x5A827999, 5); executed (the execution status of this line is deduced): (d) += ((((a)) & ((b))) | (((a)) & ((c))) | (((b)) & ((c)))) + ((*(const quint32 *)&ptr[(4) * 4]) + 0x5A827999); (d) = ((d) << (5)) | ((d) >> (32 - (5))); | - |
109 | STEP(G, c, d, a, b, GET( 8) + 0x5A827999, 9); executed (the execution status of this line is deduced): (c) += ((((d)) & ((a))) | (((d)) & ((b))) | (((a)) & ((b)))) + ((*(const quint32 *)&ptr[(8) * 4]) + 0x5A827999); (c) = ((c) << (9)) | ((c) >> (32 - (9))); | - |
110 | STEP(G, b, c, d, a, GET(12) + 0x5A827999, 13); executed (the execution status of this line is deduced): (b) += ((((c)) & ((d))) | (((c)) & ((a))) | (((d)) & ((a)))) + ((*(const quint32 *)&ptr[(12) * 4]) + 0x5A827999); (b) = ((b) << (13)) | ((b) >> (32 - (13))); | - |
111 | | - |
112 | STEP(G, a, b, c, d, GET( 1) + 0x5A827999, 3); executed (the execution status of this line is deduced): (a) += ((((b)) & ((c))) | (((b)) & ((d))) | (((c)) & ((d)))) + ((*(const quint32 *)&ptr[(1) * 4]) + 0x5A827999); (a) = ((a) << (3)) | ((a) >> (32 - (3))); | - |
113 | STEP(G, d, a, b, c, GET( 5) + 0x5A827999, 5); executed (the execution status of this line is deduced): (d) += ((((a)) & ((b))) | (((a)) & ((c))) | (((b)) & ((c)))) + ((*(const quint32 *)&ptr[(5) * 4]) + 0x5A827999); (d) = ((d) << (5)) | ((d) >> (32 - (5))); | - |
114 | STEP(G, c, d, a, b, GET( 9) + 0x5A827999, 9); executed (the execution status of this line is deduced): (c) += ((((d)) & ((a))) | (((d)) & ((b))) | (((a)) & ((b)))) + ((*(const quint32 *)&ptr[(9) * 4]) + 0x5A827999); (c) = ((c) << (9)) | ((c) >> (32 - (9))); | - |
115 | STEP(G, b, c, d, a, GET(13) + 0x5A827999, 13); executed (the execution status of this line is deduced): (b) += ((((c)) & ((d))) | (((c)) & ((a))) | (((d)) & ((a)))) + ((*(const quint32 *)&ptr[(13) * 4]) + 0x5A827999); (b) = ((b) << (13)) | ((b) >> (32 - (13))); | - |
116 | | - |
117 | STEP(G, a, b, c, d, GET( 2) + 0x5A827999, 3); executed (the execution status of this line is deduced): (a) += ((((b)) & ((c))) | (((b)) & ((d))) | (((c)) & ((d)))) + ((*(const quint32 *)&ptr[(2) * 4]) + 0x5A827999); (a) = ((a) << (3)) | ((a) >> (32 - (3))); | - |
118 | STEP(G, d, a, b, c, GET( 6) + 0x5A827999, 5); executed (the execution status of this line is deduced): (d) += ((((a)) & ((b))) | (((a)) & ((c))) | (((b)) & ((c)))) + ((*(const quint32 *)&ptr[(6) * 4]) + 0x5A827999); (d) = ((d) << (5)) | ((d) >> (32 - (5))); | - |
119 | STEP(G, c, d, a, b, GET(10) + 0x5A827999, 9); executed (the execution status of this line is deduced): (c) += ((((d)) & ((a))) | (((d)) & ((b))) | (((a)) & ((b)))) + ((*(const quint32 *)&ptr[(10) * 4]) + 0x5A827999); (c) = ((c) << (9)) | ((c) >> (32 - (9))); | - |
120 | STEP(G, b, c, d, a, GET(14) + 0x5A827999, 13); executed (the execution status of this line is deduced): (b) += ((((c)) & ((d))) | (((c)) & ((a))) | (((d)) & ((a)))) + ((*(const quint32 *)&ptr[(14) * 4]) + 0x5A827999); (b) = ((b) << (13)) | ((b) >> (32 - (13))); | - |
121 | | - |
122 | STEP(G, a, b, c, d, GET( 3) + 0x5A827999, 3); executed (the execution status of this line is deduced): (a) += ((((b)) & ((c))) | (((b)) & ((d))) | (((c)) & ((d)))) + ((*(const quint32 *)&ptr[(3) * 4]) + 0x5A827999); (a) = ((a) << (3)) | ((a) >> (32 - (3))); | - |
123 | STEP(G, d, a, b, c, GET( 7) + 0x5A827999, 5); executed (the execution status of this line is deduced): (d) += ((((a)) & ((b))) | (((a)) & ((c))) | (((b)) & ((c)))) + ((*(const quint32 *)&ptr[(7) * 4]) + 0x5A827999); (d) = ((d) << (5)) | ((d) >> (32 - (5))); | - |
124 | STEP(G, c, d, a, b, GET(11) + 0x5A827999, 9); executed (the execution status of this line is deduced): (c) += ((((d)) & ((a))) | (((d)) & ((b))) | (((a)) & ((b)))) + ((*(const quint32 *)&ptr[(11) * 4]) + 0x5A827999); (c) = ((c) << (9)) | ((c) >> (32 - (9))); | - |
125 | STEP(G, b, c, d, a, GET(15) + 0x5A827999, 13); executed (the execution status of this line is deduced): (b) += ((((c)) & ((d))) | (((c)) & ((a))) | (((d)) & ((a)))) + ((*(const quint32 *)&ptr[(15) * 4]) + 0x5A827999); (b) = ((b) << (13)) | ((b) >> (32 - (13))); | - |
126 | /* Round 3 */ | - |
127 | STEP(H, a, b, c, d, GET( 0) + 0x6ED9EBA1, 3); executed (the execution status of this line is deduced): (a) += (((b)) ^ ((c)) ^ ((d))) + ((*(const quint32 *)&ptr[(0) * 4]) + 0x6ED9EBA1); (a) = ((a) << (3)) | ((a) >> (32 - (3))); | - |
128 | STEP(H, d, a, b, c, GET( 8) + 0x6ED9EBA1, 9); executed (the execution status of this line is deduced): (d) += (((a)) ^ ((b)) ^ ((c))) + ((*(const quint32 *)&ptr[(8) * 4]) + 0x6ED9EBA1); (d) = ((d) << (9)) | ((d) >> (32 - (9))); | - |
129 | STEP(H, c, d, a, b, GET( 4) + 0x6ED9EBA1, 11); executed (the execution status of this line is deduced): (c) += (((d)) ^ ((a)) ^ ((b))) + ((*(const quint32 *)&ptr[(4) * 4]) + 0x6ED9EBA1); (c) = ((c) << (11)) | ((c) >> (32 - (11))); | - |
130 | STEP(H, b, c, d, a, GET(12) + 0x6ED9EBA1, 15); executed (the execution status of this line is deduced): (b) += (((c)) ^ ((d)) ^ ((a))) + ((*(const quint32 *)&ptr[(12) * 4]) + 0x6ED9EBA1); (b) = ((b) << (15)) | ((b) >> (32 - (15))); | - |
131 | | - |
132 | STEP(H, a, b, c, d, GET( 2) + 0x6ED9EBA1, 3); executed (the execution status of this line is deduced): (a) += (((b)) ^ ((c)) ^ ((d))) + ((*(const quint32 *)&ptr[(2) * 4]) + 0x6ED9EBA1); (a) = ((a) << (3)) | ((a) >> (32 - (3))); | - |
133 | STEP(H, d, a, b, c, GET(10) + 0x6ED9EBA1, 9); executed (the execution status of this line is deduced): (d) += (((a)) ^ ((b)) ^ ((c))) + ((*(const quint32 *)&ptr[(10) * 4]) + 0x6ED9EBA1); (d) = ((d) << (9)) | ((d) >> (32 - (9))); | - |
134 | STEP(H, c, d, a, b, GET( 6) + 0x6ED9EBA1, 11); executed (the execution status of this line is deduced): (c) += (((d)) ^ ((a)) ^ ((b))) + ((*(const quint32 *)&ptr[(6) * 4]) + 0x6ED9EBA1); (c) = ((c) << (11)) | ((c) >> (32 - (11))); | - |
135 | STEP(H, b, c, d, a, GET(14) + 0x6ED9EBA1, 15); executed (the execution status of this line is deduced): (b) += (((c)) ^ ((d)) ^ ((a))) + ((*(const quint32 *)&ptr[(14) * 4]) + 0x6ED9EBA1); (b) = ((b) << (15)) | ((b) >> (32 - (15))); | - |
136 | | - |
137 | STEP(H, a, b, c, d, GET( 1) + 0x6ED9EBA1, 3); executed (the execution status of this line is deduced): (a) += (((b)) ^ ((c)) ^ ((d))) + ((*(const quint32 *)&ptr[(1) * 4]) + 0x6ED9EBA1); (a) = ((a) << (3)) | ((a) >> (32 - (3))); | - |
138 | STEP(H, d, a, b, c, GET( 9) + 0x6ED9EBA1, 9); executed (the execution status of this line is deduced): (d) += (((a)) ^ ((b)) ^ ((c))) + ((*(const quint32 *)&ptr[(9) * 4]) + 0x6ED9EBA1); (d) = ((d) << (9)) | ((d) >> (32 - (9))); | - |
139 | STEP(H, c, d, a, b, GET( 5) + 0x6ED9EBA1, 11); executed (the execution status of this line is deduced): (c) += (((d)) ^ ((a)) ^ ((b))) + ((*(const quint32 *)&ptr[(5) * 4]) + 0x6ED9EBA1); (c) = ((c) << (11)) | ((c) >> (32 - (11))); | - |
140 | STEP(H, b, c, d, a, GET(13) + 0x6ED9EBA1, 15); executed (the execution status of this line is deduced): (b) += (((c)) ^ ((d)) ^ ((a))) + ((*(const quint32 *)&ptr[(13) * 4]) + 0x6ED9EBA1); (b) = ((b) << (15)) | ((b) >> (32 - (15))); | - |
141 | | - |
142 | STEP(H, a, b, c, d, GET( 3) + 0x6ED9EBA1, 3); executed (the execution status of this line is deduced): (a) += (((b)) ^ ((c)) ^ ((d))) + ((*(const quint32 *)&ptr[(3) * 4]) + 0x6ED9EBA1); (a) = ((a) << (3)) | ((a) >> (32 - (3))); | - |
143 | STEP(H, d, a, b, c, GET(11) + 0x6ED9EBA1, 9); executed (the execution status of this line is deduced): (d) += (((a)) ^ ((b)) ^ ((c))) + ((*(const quint32 *)&ptr[(11) * 4]) + 0x6ED9EBA1); (d) = ((d) << (9)) | ((d) >> (32 - (9))); | - |
144 | STEP(H, c, d, a, b, GET( 7) + 0x6ED9EBA1, 11); executed (the execution status of this line is deduced): (c) += (((d)) ^ ((a)) ^ ((b))) + ((*(const quint32 *)&ptr[(7) * 4]) + 0x6ED9EBA1); (c) = ((c) << (11)) | ((c) >> (32 - (11))); | - |
145 | STEP(H, b, c, d, a, GET(15) + 0x6ED9EBA1, 15); executed (the execution status of this line is deduced): (b) += (((c)) ^ ((d)) ^ ((a))) + ((*(const quint32 *)&ptr[(15) * 4]) + 0x6ED9EBA1); (b) = ((b) << (15)) | ((b) >> (32 - (15))); | - |
146 | | - |
147 | a += saved_a; executed (the execution status of this line is deduced): a += saved_a; | - |
148 | b += saved_b; executed (the execution status of this line is deduced): b += saved_b; | - |
149 | c += saved_c; executed (the execution status of this line is deduced): c += saved_c; | - |
150 | d += saved_d; executed (the execution status of this line is deduced): d += saved_d; | - |
151 | | - |
152 | ptr += 64; executed (the execution status of this line is deduced): ptr += 64; | - |
153 | } while (size -= 64); executed: } Execution Count:4 partially evaluated: size -= 64 no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
154 | | - |
155 | ctx->a = a; executed (the execution status of this line is deduced): ctx->a = a; | - |
156 | ctx->b = b; executed (the execution status of this line is deduced): ctx->b = b; | - |
157 | ctx->c = c; executed (the execution status of this line is deduced): ctx->c = c; | - |
158 | ctx->d = d; executed (the execution status of this line is deduced): ctx->d = d; | - |
159 | | - |
160 | return ptr; executed: return ptr; Execution Count:4 | 4 |
161 | } | - |
162 | | - |
163 | static void md4_init(struct md4_context *ctx) | - |
164 | { | - |
165 | ctx->a = 0x67452301; executed (the execution status of this line is deduced): ctx->a = 0x67452301; | - |
166 | ctx->b = 0xefcdab89; executed (the execution status of this line is deduced): ctx->b = 0xefcdab89; | - |
167 | ctx->c = 0x98badcfe; executed (the execution status of this line is deduced): ctx->c = 0x98badcfe; | - |
168 | ctx->d = 0x10325476; executed (the execution status of this line is deduced): ctx->d = 0x10325476; | - |
169 | | - |
170 | ctx->lo = 0; executed (the execution status of this line is deduced): ctx->lo = 0; | - |
171 | ctx->hi = 0; executed (the execution status of this line is deduced): ctx->hi = 0; | - |
172 | } executed: } Execution Count:4 | 4 |
173 | | - |
174 | static void md4_update(struct md4_context *ctx, const unsigned char *data, size_t size) | - |
175 | { | - |
176 | /* @UNSAFE */ | - |
177 | quint32 saved_lo; executed (the execution status of this line is deduced): quint32 saved_lo; | - |
178 | unsigned long used, free; executed (the execution status of this line is deduced): unsigned long used, free; | - |
179 | | - |
180 | saved_lo = ctx->lo; executed (the execution status of this line is deduced): saved_lo = ctx->lo; | - |
181 | if ((ctx->lo = (saved_lo + size) & 0x1fffffff) < saved_lo) partially evaluated: (ctx->lo = (saved_lo + size) & 0x1fffffff) < saved_lo no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
182 | ctx->hi++; never executed: ctx->hi++; | 0 |
183 | ctx->hi += size >> 29; executed (the execution status of this line is deduced): ctx->hi += size >> 29; | - |
184 | | - |
185 | used = saved_lo & 0x3f; executed (the execution status of this line is deduced): used = saved_lo & 0x3f; | - |
186 | | - |
187 | if (used) { evaluated: used yes Evaluation Count:1 | yes Evaluation Count:3 |
| 1-3 |
188 | free = 64 - used; executed (the execution status of this line is deduced): free = 64 - used; | - |
189 | | - |
190 | if (size < free) { partially evaluated: size < free yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
191 | memcpy(&ctx->buffer[used], data, size); executed (the execution status of this line is deduced): memcpy(&ctx->buffer[used], data, size); | - |
192 | return; executed: return; Execution Count:1 | 1 |
193 | } | - |
194 | | - |
195 | memcpy(&ctx->buffer[used], data, free); never executed (the execution status of this line is deduced): memcpy(&ctx->buffer[used], data, free); | - |
196 | data = (const unsigned char *) data + free; never executed (the execution status of this line is deduced): data = (const unsigned char *) data + free; | - |
197 | size -= free; never executed (the execution status of this line is deduced): size -= free; | - |
198 | body(ctx, ctx->buffer, 64); never executed (the execution status of this line is deduced): body(ctx, ctx->buffer, 64); | - |
199 | } | 0 |
200 | | - |
201 | if (size >= 64) { partially evaluated: size >= 64 no Evaluation Count:0 | yes Evaluation Count:3 |
| 0-3 |
202 | data = body(ctx, data, size & ~(unsigned long)0x3f); never executed (the execution status of this line is deduced): data = body(ctx, data, size & ~(unsigned long)0x3f); | - |
203 | size &= 0x3f; never executed (the execution status of this line is deduced): size &= 0x3f; | - |
204 | } | 0 |
205 | | - |
206 | memcpy(ctx->buffer, data, size); executed (the execution status of this line is deduced): memcpy(ctx->buffer, data, size); | - |
207 | } executed: } Execution Count:3 | 3 |
208 | | - |
209 | static void md4_final(struct md4_context *ctx, unsigned char result[MD4_RESULTLEN]) | - |
210 | { | - |
211 | /* @UNSAFE */ | - |
212 | unsigned long used, free; executed (the execution status of this line is deduced): unsigned long used, free; | - |
213 | | - |
214 | used = ctx->lo & 0x3f; executed (the execution status of this line is deduced): used = ctx->lo & 0x3f; | - |
215 | | - |
216 | ctx->buffer[used++] = 0x80; executed (the execution status of this line is deduced): ctx->buffer[used++] = 0x80; | - |
217 | | - |
218 | free = 64 - used; executed (the execution status of this line is deduced): free = 64 - used; | - |
219 | | - |
220 | if (free < 8) { partially evaluated: free < 8 no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
221 | memset(&ctx->buffer[used], 0, free); never executed (the execution status of this line is deduced): memset(&ctx->buffer[used], 0, free); | - |
222 | body(ctx, ctx->buffer, 64); never executed (the execution status of this line is deduced): body(ctx, ctx->buffer, 64); | - |
223 | used = 0; never executed (the execution status of this line is deduced): used = 0; | - |
224 | free = 64; never executed (the execution status of this line is deduced): free = 64; | - |
225 | } | 0 |
226 | | - |
227 | memset(&ctx->buffer[used], 0, free - 8); executed (the execution status of this line is deduced): memset(&ctx->buffer[used], 0, free - 8); | - |
228 | | - |
229 | ctx->lo <<= 3; executed (the execution status of this line is deduced): ctx->lo <<= 3; | - |
230 | ctx->buffer[56] = ctx->lo; executed (the execution status of this line is deduced): ctx->buffer[56] = ctx->lo; | - |
231 | ctx->buffer[57] = ctx->lo >> 8; executed (the execution status of this line is deduced): ctx->buffer[57] = ctx->lo >> 8; | - |
232 | ctx->buffer[58] = ctx->lo >> 16; executed (the execution status of this line is deduced): ctx->buffer[58] = ctx->lo >> 16; | - |
233 | ctx->buffer[59] = ctx->lo >> 24; executed (the execution status of this line is deduced): ctx->buffer[59] = ctx->lo >> 24; | - |
234 | ctx->buffer[60] = ctx->hi; executed (the execution status of this line is deduced): ctx->buffer[60] = ctx->hi; | - |
235 | ctx->buffer[61] = ctx->hi >> 8; executed (the execution status of this line is deduced): ctx->buffer[61] = ctx->hi >> 8; | - |
236 | ctx->buffer[62] = ctx->hi >> 16; executed (the execution status of this line is deduced): ctx->buffer[62] = ctx->hi >> 16; | - |
237 | ctx->buffer[63] = ctx->hi >> 24; executed (the execution status of this line is deduced): ctx->buffer[63] = ctx->hi >> 24; | - |
238 | | - |
239 | body(ctx, ctx->buffer, 64); executed (the execution status of this line is deduced): body(ctx, ctx->buffer, 64); | - |
240 | | - |
241 | result[0] = ctx->a; executed (the execution status of this line is deduced): result[0] = ctx->a; | - |
242 | result[1] = ctx->a >> 8; executed (the execution status of this line is deduced): result[1] = ctx->a >> 8; | - |
243 | result[2] = ctx->a >> 16; executed (the execution status of this line is deduced): result[2] = ctx->a >> 16; | - |
244 | result[3] = ctx->a >> 24; executed (the execution status of this line is deduced): result[3] = ctx->a >> 24; | - |
245 | result[4] = ctx->b; executed (the execution status of this line is deduced): result[4] = ctx->b; | - |
246 | result[5] = ctx->b >> 8; executed (the execution status of this line is deduced): result[5] = ctx->b >> 8; | - |
247 | result[6] = ctx->b >> 16; executed (the execution status of this line is deduced): result[6] = ctx->b >> 16; | - |
248 | result[7] = ctx->b >> 24; executed (the execution status of this line is deduced): result[7] = ctx->b >> 24; | - |
249 | result[8] = ctx->c; executed (the execution status of this line is deduced): result[8] = ctx->c; | - |
250 | result[9] = ctx->c >> 8; executed (the execution status of this line is deduced): result[9] = ctx->c >> 8; | - |
251 | result[10] = ctx->c >> 16; executed (the execution status of this line is deduced): result[10] = ctx->c >> 16; | - |
252 | result[11] = ctx->c >> 24; executed (the execution status of this line is deduced): result[11] = ctx->c >> 24; | - |
253 | result[12] = ctx->d; executed (the execution status of this line is deduced): result[12] = ctx->d; | - |
254 | result[13] = ctx->d >> 8; executed (the execution status of this line is deduced): result[13] = ctx->d >> 8; | - |
255 | result[14] = ctx->d >> 16; executed (the execution status of this line is deduced): result[14] = ctx->d >> 16; | - |
256 | result[15] = ctx->d >> 24; executed (the execution status of this line is deduced): result[15] = ctx->d >> 24; | - |
257 | | - |
258 | memset(ctx, 0, sizeof(*ctx)); executed (the execution status of this line is deduced): memset(ctx, 0, sizeof(*ctx)); | - |
259 | } executed: } Execution Count:4 | 4 |
260 | | - |
261 | #undef F | - |
262 | #undef G | - |
263 | #undef H | - |
264 | | - |
265 | QT_END_NAMESPACE | - |
266 | | - |
| | |