Lines Matching +full:0 +full:m

56 static uint32_t _K[] = { 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6 };
68 #define BCOUNT (ctxt->c.b64[0] / 8)
69 #define W(n) (ctxt->m.b32[(n)])
72 ctxt->m.b8[(COUNT % 64)] = (x); \
75 ctxt->c.b64[0] += 8; \
76 if (COUNT % 64 == 0) \
81 ctxt->m.b8[(COUNT % 64)] = (x); \
84 if (COUNT % 64 == 0) \
99 bcopy(&ctxt->m.b8[0], &tctxt.m.b8[0], 64); in sha1_step()
100 ctxt->m.b8[0] = tctxt.m.b8[3]; ctxt->m.b8[1] = tctxt.m.b8[2]; in sha1_step()
101 ctxt->m.b8[2] = tctxt.m.b8[1]; ctxt->m.b8[3] = tctxt.m.b8[0]; in sha1_step()
102 ctxt->m.b8[4] = tctxt.m.b8[7]; ctxt->m.b8[5] = tctxt.m.b8[6]; in sha1_step()
103 ctxt->m.b8[6] = tctxt.m.b8[5]; ctxt->m.b8[7] = tctxt.m.b8[4]; in sha1_step()
104 ctxt->m.b8[8] = tctxt.m.b8[11]; ctxt->m.b8[9] = tctxt.m.b8[10]; in sha1_step()
105 ctxt->m.b8[10] = tctxt.m.b8[9]; ctxt->m.b8[11] = tctxt.m.b8[8]; in sha1_step()
106 ctxt->m.b8[12] = tctxt.m.b8[15]; ctxt->m.b8[13] = tctxt.m.b8[14]; in sha1_step()
107 ctxt->m.b8[14] = tctxt.m.b8[13]; ctxt->m.b8[15] = tctxt.m.b8[12]; in sha1_step()
108 ctxt->m.b8[16] = tctxt.m.b8[19]; ctxt->m.b8[17] = tctxt.m.b8[18]; in sha1_step()
109 ctxt->m.b8[18] = tctxt.m.b8[17]; ctxt->m.b8[19] = tctxt.m.b8[16]; in sha1_step()
110 ctxt->m.b8[20] = tctxt.m.b8[23]; ctxt->m.b8[21] = tctxt.m.b8[22]; in sha1_step()
111 ctxt->m.b8[22] = tctxt.m.b8[21]; ctxt->m.b8[23] = tctxt.m.b8[20]; in sha1_step()
112 ctxt->m.b8[24] = tctxt.m.b8[27]; ctxt->m.b8[25] = tctxt.m.b8[26]; in sha1_step()
113 ctxt->m.b8[26] = tctxt.m.b8[25]; ctxt->m.b8[27] = tctxt.m.b8[24]; in sha1_step()
114 ctxt->m.b8[28] = tctxt.m.b8[31]; ctxt->m.b8[29] = tctxt.m.b8[30]; in sha1_step()
115 ctxt->m.b8[30] = tctxt.m.b8[29]; ctxt->m.b8[31] = tctxt.m.b8[28]; in sha1_step()
116 ctxt->m.b8[32] = tctxt.m.b8[35]; ctxt->m.b8[33] = tctxt.m.b8[34]; in sha1_step()
117 ctxt->m.b8[34] = tctxt.m.b8[33]; ctxt->m.b8[35] = tctxt.m.b8[32]; in sha1_step()
118 ctxt->m.b8[36] = tctxt.m.b8[39]; ctxt->m.b8[37] = tctxt.m.b8[38]; in sha1_step()
119 ctxt->m.b8[38] = tctxt.m.b8[37]; ctxt->m.b8[39] = tctxt.m.b8[36]; in sha1_step()
120 ctxt->m.b8[40] = tctxt.m.b8[43]; ctxt->m.b8[41] = tctxt.m.b8[42]; in sha1_step()
121 ctxt->m.b8[42] = tctxt.m.b8[41]; ctxt->m.b8[43] = tctxt.m.b8[40]; in sha1_step()
122 ctxt->m.b8[44] = tctxt.m.b8[47]; ctxt->m.b8[45] = tctxt.m.b8[46]; in sha1_step()
123 ctxt->m.b8[46] = tctxt.m.b8[45]; ctxt->m.b8[47] = tctxt.m.b8[44]; in sha1_step()
124 ctxt->m.b8[48] = tctxt.m.b8[51]; ctxt->m.b8[49] = tctxt.m.b8[50]; in sha1_step()
125 ctxt->m.b8[50] = tctxt.m.b8[49]; ctxt->m.b8[51] = tctxt.m.b8[48]; in sha1_step()
126 ctxt->m.b8[52] = tctxt.m.b8[55]; ctxt->m.b8[53] = tctxt.m.b8[54]; in sha1_step()
127 ctxt->m.b8[54] = tctxt.m.b8[53]; ctxt->m.b8[55] = tctxt.m.b8[52]; in sha1_step()
128 ctxt->m.b8[56] = tctxt.m.b8[59]; ctxt->m.b8[57] = tctxt.m.b8[58]; in sha1_step()
129 ctxt->m.b8[58] = tctxt.m.b8[57]; ctxt->m.b8[59] = tctxt.m.b8[56]; in sha1_step()
130 ctxt->m.b8[60] = tctxt.m.b8[63]; ctxt->m.b8[61] = tctxt.m.b8[62]; in sha1_step()
131 ctxt->m.b8[62] = tctxt.m.b8[61]; ctxt->m.b8[63] = tctxt.m.b8[60]; in sha1_step()
134 a = H(0); b = H(1); c = H(2); d = H(3); e = H(4); in sha1_step()
136 for (t = 0; t < 20; t++) { in sha1_step()
137 s = t & 0x0f; in sha1_step()
139 W(s) = S(1, W((s+13) & 0x0f) ^ W((s+8) & 0x0f) ^ W((s+2) & 0x0f) ^ W(s)); in sha1_step()
145 s = t & 0x0f; in sha1_step()
146 W(s) = S(1, W((s+13) & 0x0f) ^ W((s+8) & 0x0f) ^ W((s+2) & 0x0f) ^ W(s)); in sha1_step()
151 s = t & 0x0f; in sha1_step()
152 W(s) = S(1, W((s+13) & 0x0f) ^ W((s+8) & 0x0f) ^ W((s+2) & 0x0f) ^ W(s)); in sha1_step()
157 s = t & 0x0f; in sha1_step()
158 W(s) = S(1, W((s+13) & 0x0f) ^ W((s+8) & 0x0f) ^ W((s+2) & 0x0f) ^ W(s)); in sha1_step()
163 H(0) = H(0) + a; in sha1_step()
169 bzero(&ctxt->m.b8[0], 64); in sha1_step()
178 H(0) = 0x67452301; in sha1_init()
179 H(1) = 0xefcdab89; in sha1_init()
180 H(2) = 0x98badcfe; in sha1_init()
181 H(3) = 0x10325476; in sha1_init()
182 H(4) = 0xc3d2e1f0; in sha1_init()
191 PUTPAD(0x80); in sha1_pad()
196 bzero(&ctxt->m.b8[padstart], padlen); in sha1_pad()
200 padstart = COUNT % 64; /* should be 0 */ in sha1_pad()
203 bzero(&ctxt->m.b8[padstart], padlen - 8); in sha1_pad()
207 PUTPAD(ctxt->c.b8[0]); PUTPAD(ctxt->c.b8[1]); in sha1_pad()
215 PUTPAD(ctxt->c.b8[1]); PUTPAD(ctxt->c.b8[0]); in sha1_pad()
227 off = 0; in sha1_loop()
234 bcopy(&input[off], &ctxt->m.b8[gapstart], copysiz); in sha1_loop()
237 ctxt->c.b64[0] += copysiz * 8; in sha1_loop()
238 if (COUNT % 64 == 0) in sha1_loop()
252 bcopy(&ctxt->h.b8[0], digest, SHA1_RESULTLEN); in sha1_result()
254 digest[0] = ctxt->h.b8[3]; digest[1] = ctxt->h.b8[2]; in sha1_result()
255 digest[2] = ctxt->h.b8[1]; digest[3] = ctxt->h.b8[0]; in sha1_result()