2 * Author......: Jens Steube <jens.steube@gmail.com>
13 static u32
swap32 (const u32 v
)
15 return (as_uint (as_uchar4 (v
).s3210
));
18 static u64
swap64 (const u64 v
)
20 return (as_ulong (as_uchar8 (v
).s76543210
));
27 static u32
__byte_perm (const u32 a
, const u32 b
, const u32 c
)
31 asm ("prmt.b32 %0, %1, %2, %3;" : "=r"(r
) : "r"(a
), "r"(b
), "r"(c
));
36 static u32
swap32 (const u32 v
)
38 return __byte_perm (v
, 0, 0x0123);
41 static u64
swap64 (const u64 v
)
43 return (as_ulong (as_uchar8 (v
).s76543210
));
48 static bool allx (const u32 r
)
53 static u32
l32_from_64 (u64 a
)
55 const u32 r
= (uint
) (a
);
60 static u32
h32_from_64 (u64 a
)
64 const u32 r
= (uint
) (a
);
69 static u64
hl32_to_64 (const u32 a
, const u32 b
)
71 return as_ulong ((uint2
) (b
, a
));
74 static u32
rotr32 (const u32 a
, const u32 n
)
76 return rotate (a
, 32 - n
);
79 static u32
rotl32 (const u32 a
, const u32 n
)
86 static u64
rotr64 (const u64 a
, const u32 n
)
88 uint2 a2
= as_uint2 (a
);
92 t
.s0
= (n
>= 32) ? amd_bitalign (a2
.s0
, a2
.s1
, n
- 32)
93 : amd_bitalign (a2
.s1
, a2
.s0
, n
);
94 t
.s1
= (n
>= 32) ? amd_bitalign (a2
.s1
, a2
.s0
, n
- 32)
95 : amd_bitalign (a2
.s0
, a2
.s1
, n
);
106 static u64
rotr64 (const u64 a
, const u32 n
)
111 asm ("mov.b64 {%0, %1}, %2;" : "=r"(il
), "=r"(ir
) : "l"(a
));
118 asm ("shf.r.wrap.b32 %0, %1, %2, %3;" : "=r"(tl
) : "r"(ir
), "r"(il
), "r"(n
- 32));
119 asm ("shf.r.wrap.b32 %0, %1, %2, %3;" : "=r"(tr
) : "r"(il
), "r"(ir
), "r"(n
- 32));
123 asm ("shf.r.wrap.b32 %0, %1, %2, %3;" : "=r"(tl
) : "r"(il
), "r"(ir
), "r"(n
));
124 asm ("shf.r.wrap.b32 %0, %1, %2, %3;" : "=r"(tr
) : "r"(ir
), "r"(il
), "r"(n
));
129 asm ("mov.b64 %0, {%1, %2};" : "=l"(r
) : "r"(tl
), "r"(tr
));
136 static u64
rotr64 (const u64 a
, const u32 n
)
138 return (((a
) >> (n
)) | ((a
) << (64 - (n
))));
143 static u64
rotl64 (const u64 a
, const u32 n
)
145 return rotr64 (a
, 64 - n
);
162 #elif defined _BCRYPT_
164 #elif defined _SHA256_
166 #elif defined _SHA384_
168 #elif defined _SHA512_
170 #elif defined _KECCAK_
172 #elif defined _RIPEMD160_
174 #elif defined _WHIRLPOOL_
178 #elif defined _GOST2012_256_
180 #elif defined _GOST2012_512_
186 #elif defined _MYSQL323_
188 #elif defined _LOTUS5_
190 #elif defined _LOTUS6_
192 #elif defined _SCRYPT_
194 #elif defined _LOTUS8_
196 #elif defined _OFFICE2007_
198 #elif defined _OFFICE2010_
200 #elif defined _OFFICE2013_
202 #elif defined _OLDOFFICE01_
204 #elif defined _OLDOFFICE34_
206 #elif defined _SIPHASH_
208 #elif defined _PBKDF2_MD5_
210 #elif defined _PBKDF2_SHA1_
212 #elif defined _PBKDF2_SHA256_
214 #elif defined _PBKDF2_SHA512_
216 #elif defined _PDF17L8_
218 #elif defined _CRC32_
220 #elif defined _SEVEN_ZIP_
222 #elif defined _ANDROIDFDE_
228 #elif defined _MD5_SHA1_
230 #elif defined _SHA1_MD5_
232 #elif defined _NETNTLMV2_
234 #elif defined _KRB5PA_
236 #elif defined _CLOUDKEY_
238 #elif defined _SCRYPT_
240 #elif defined _PSAFE2_
242 #elif defined _LOTUS8_
246 #elif defined _SHA256_SHA1_
248 #elif defined _MS_DRSR_
311 u32 cry_master_buf
[64];
313 u32 public_key_buf
[64];
354 u32 userdomain_buf
[64];
417 u32 encryptedVerifier
[4];
418 u32 encryptedVerifierHash
[5];
426 u32 encryptedVerifier
[4];
427 u32 encryptedVerifierHash
[8];
433 u32 encryptedVerifier
[4];
434 u32 encryptedVerifierHash
[8];
441 u32 encryptedVerifier
[4];
442 u32 encryptedVerifierHash
[4];
450 u32 encryptedVerifier
[4];
451 u32 encryptedVerifierHash
[5];
520 } bitcoin_wallet_tmp_t
;
626 } pbkdf2_sha256_tmp_t
;
636 } pbkdf2_sha512_tmp_t
;
848 u32 alignment_placeholder_1
;
849 u32 alignment_placeholder_2
;
850 u32 alignment_placeholder_3
;