Add function prototypes in OpenCL kernels to make some compilers happy

pull/1955/head
jsteube 5 years ago
parent ce32d57f9b
commit 84d6b8ecc1

@ -692,6 +692,7 @@ __constant u32a rcon[10] =
// 128 bit key
DECLSPEC void aes128_ExpandKey (u32 *ks, const u32 *ukey, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4);
DECLSPEC void aes128_ExpandKey (u32 *ks, const u32 *ukey, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4)
{
ks[0] = ukey[0];
@ -721,6 +722,7 @@ DECLSPEC void aes128_ExpandKey (u32 *ks, const u32 *ukey, SHM_TYPE u32 *s_te0, S
}
}
DECLSPEC void aes128_InvertKey (u32 *ks, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void aes128_InvertKey (u32 *ks, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 temp;
@ -794,6 +796,7 @@ DECLSPEC void aes128_InvertKey (u32 *ks, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te
}
}
DECLSPEC void aes128_set_encrypt_key (u32 *ks, const u32 *ukey, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4);
DECLSPEC void aes128_set_encrypt_key (u32 *ks, const u32 *ukey, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4)
{
u32 ukey_s[4];
@ -806,6 +809,7 @@ DECLSPEC void aes128_set_encrypt_key (u32 *ks, const u32 *ukey, SHM_TYPE u32 *s_
aes128_ExpandKey (ks, ukey_s, s_te0, s_te1, s_te2, s_te3, s_te4);
}
DECLSPEC void aes128_set_decrypt_key (u32 *ks, const u32 *ukey, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void aes128_set_decrypt_key (u32 *ks, const u32 *ukey, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 ukey_s[4];
@ -820,6 +824,7 @@ DECLSPEC void aes128_set_decrypt_key (u32 *ks, const u32 *ukey, SHM_TYPE u32 *s_
aes128_InvertKey (ks, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4);
}
DECLSPEC void aes128_encrypt (const u32 *ks, const u32 *in, u32 *out, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4);
DECLSPEC void aes128_encrypt (const u32 *ks, const u32 *in, u32 *out, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4)
{
const u32 in_s0 = swap32_S (in[0]);
@ -907,6 +912,7 @@ DECLSPEC void aes128_encrypt (const u32 *ks, const u32 *in, u32 *out, SHM_TYPE u
out[3] = swap32_S (out[3]);
}
DECLSPEC void aes128_decrypt (const u32 *ks, const u32 *in, u32 *out, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void aes128_decrypt (const u32 *ks, const u32 *in, u32 *out, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
const u32 in_s0 = swap32_S (in[0]);
@ -996,6 +1002,7 @@ DECLSPEC void aes128_decrypt (const u32 *ks, const u32 *in, u32 *out, SHM_TYPE u
// 256 bit key
DECLSPEC void aes256_ExpandKey (u32 *ks, const u32 *ukey, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4);
DECLSPEC void aes256_ExpandKey (u32 *ks, const u32 *ukey, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4)
{
ks[0] = ukey[0];
@ -1044,6 +1051,7 @@ DECLSPEC void aes256_ExpandKey (u32 *ks, const u32 *ukey, SHM_TYPE u32 *s_te0, S
}
}
DECLSPEC void aes256_InvertKey (u32 *ks, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void aes256_InvertKey (u32 *ks, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 temp;
@ -1125,6 +1133,7 @@ DECLSPEC void aes256_InvertKey (u32 *ks, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te
}
}
DECLSPEC void aes256_set_encrypt_key (u32 *ks, const u32 *ukey, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4);
DECLSPEC void aes256_set_encrypt_key (u32 *ks, const u32 *ukey, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4)
{
u32 ukey_s[8];
@ -1141,6 +1150,7 @@ DECLSPEC void aes256_set_encrypt_key (u32 *ks, const u32 *ukey, SHM_TYPE u32 *s_
aes256_ExpandKey (ks, ukey_s, s_te0, s_te1, s_te2, s_te3, s_te4);
}
DECLSPEC void aes256_set_decrypt_key (u32 *ks, const u32 *ukey, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void aes256_set_decrypt_key (u32 *ks, const u32 *ukey, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 ukey_s[8];
@ -1159,6 +1169,7 @@ DECLSPEC void aes256_set_decrypt_key (u32 *ks, const u32 *ukey, SHM_TYPE u32 *s_
aes256_InvertKey (ks, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4);
}
DECLSPEC void aes256_encrypt (const u32 *ks, const u32 *in, u32 *out, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4);
DECLSPEC void aes256_encrypt (const u32 *ks, const u32 *in, u32 *out, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4)
{
const u32 in_s0 = swap32_S (in[0]);
@ -1246,6 +1257,7 @@ DECLSPEC void aes256_encrypt (const u32 *ks, const u32 *in, u32 *out, SHM_TYPE u
out[3] = swap32_S (out[3]);
}
DECLSPEC void aes256_decrypt (const u32 *ks, const u32 *in, u32 *out, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void aes256_decrypt (const u32 *ks, const u32 *in, u32 *out, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
const u32 in_s0 = swap32_S (in[0]);
@ -1335,6 +1347,7 @@ DECLSPEC void aes256_decrypt (const u32 *ks, const u32 *in, u32 *out, SHM_TYPE u
// wrapper to avoid swap32_S() confusion in the kernel code
DECLSPEC void AES128_set_encrypt_key (u32 *ks, const u32 *ukey, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4);
DECLSPEC void AES128_set_encrypt_key (u32 *ks, const u32 *ukey, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4)
{
u32 ukey_s[4];
@ -1347,6 +1360,7 @@ DECLSPEC void AES128_set_encrypt_key (u32 *ks, const u32 *ukey, SHM_TYPE u32 *s_
aes128_set_encrypt_key (ks, ukey_s, s_te0, s_te1, s_te2, s_te3, s_te4);
}
DECLSPEC void AES128_set_decrypt_key (u32 *ks, const u32 *ukey, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void AES128_set_decrypt_key (u32 *ks, const u32 *ukey, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 ukey_s[4];
@ -1359,6 +1373,7 @@ DECLSPEC void AES128_set_decrypt_key (u32 *ks, const u32 *ukey, SHM_TYPE u32 *s_
aes128_set_decrypt_key (ks, ukey_s, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4);
}
DECLSPEC void AES128_encrypt (const u32 *ks, const u32 *in, u32 *out, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4);
DECLSPEC void AES128_encrypt (const u32 *ks, const u32 *in, u32 *out, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4)
{
u32 in_s[4];
@ -1378,6 +1393,7 @@ DECLSPEC void AES128_encrypt (const u32 *ks, const u32 *in, u32 *out, SHM_TYPE u
out[3] = swap32_S (out_s[3]);
}
DECLSPEC void AES128_decrypt (const u32 *ks, const u32 *in, u32 *out, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void AES128_decrypt (const u32 *ks, const u32 *in, u32 *out, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 in_s[4];
@ -1397,6 +1413,7 @@ DECLSPEC void AES128_decrypt (const u32 *ks, const u32 *in, u32 *out, SHM_TYPE u
out[3] = swap32_S (out_s[3]);
}
DECLSPEC void AES256_set_encrypt_key (u32 *ks, const u32 *ukey, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4);
DECLSPEC void AES256_set_encrypt_key (u32 *ks, const u32 *ukey, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4)
{
u32 ukey_s[8];
@ -1413,6 +1430,7 @@ DECLSPEC void AES256_set_encrypt_key (u32 *ks, const u32 *ukey, SHM_TYPE u32 *s_
aes256_set_encrypt_key (ks, ukey_s, s_te0, s_te1, s_te2, s_te3, s_te4);
}
DECLSPEC void AES256_set_decrypt_key (u32 *ks, const u32 *ukey, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void AES256_set_decrypt_key (u32 *ks, const u32 *ukey, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 ukey_s[8];
@ -1429,6 +1447,7 @@ DECLSPEC void AES256_set_decrypt_key (u32 *ks, const u32 *ukey, SHM_TYPE u32 *s_
aes256_set_decrypt_key (ks, ukey_s, s_te0, s_te1, s_te2, s_te3, s_te4, s_td0, s_td1, s_td2, s_td3, s_td4);
}
DECLSPEC void AES256_encrypt (const u32 *ks, const u32 *in, u32 *out, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4);
DECLSPEC void AES256_encrypt (const u32 *ks, const u32 *in, u32 *out, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4)
{
u32 in_s[4];
@ -1448,6 +1467,7 @@ DECLSPEC void AES256_encrypt (const u32 *ks, const u32 *in, u32 *out, SHM_TYPE u
out[3] = swap32_S (out_s[3]);
}
DECLSPEC void AES256_decrypt (const u32 *ks, const u32 *in, u32 *out, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void AES256_decrypt (const u32 *ks, const u32 *in, u32 *out, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 in_s[4];

@ -60,6 +60,7 @@ __constant const u32a c_sbox[256] =
#define extract_byte(x,n) (((x) >> (8 * (n))) & 0xff)
DECLSPEC void cam_feistel (const u32 *x, const u32 *k, u32 *y);
DECLSPEC void cam_feistel (const u32 *x, const u32 *k, u32 *y)
{
u32 b[8];
@ -89,6 +90,7 @@ DECLSPEC void cam_feistel (const u32 *x, const u32 *k, u32 *y)
y[1] ^= tmp[1];
}
DECLSPEC void cam_fl (u32 *x, const u32 *kl, const u32 *kr);
DECLSPEC void cam_fl (u32 *x, const u32 *kl, const u32 *kr)
{
u32 t[4];
@ -125,6 +127,7 @@ DECLSPEC void cam_fl (u32 *x, const u32 *kl, const u32 *kr)
x[3] = swap32_S (t[3]);
}
DECLSPEC void camellia256_set_key (u32 *ks, const u32 *ukey);
DECLSPEC void camellia256_set_key (u32 *ks, const u32 *ukey)
{
const u32 sigma[12] =
@ -260,6 +263,7 @@ DECLSPEC void camellia256_set_key (u32 *ks, const u32 *ukey)
ks[67] = cam_rotate (14, 15, 15);
}
DECLSPEC void camellia256_encrypt (const u32 *ks, const u32 *in, u32 *out);
DECLSPEC void camellia256_encrypt (const u32 *ks, const u32 *in, u32 *out)
{
out[0] = in[0] ^ ks[0];
@ -312,6 +316,7 @@ DECLSPEC void camellia256_encrypt (const u32 *ks, const u32 *in, u32 *out)
out[3] = tmp[1] ^ ks[67];
}
DECLSPEC void camellia256_decrypt (const u32 *ks, const u32 *in, u32 *out);
DECLSPEC void camellia256_decrypt (const u32 *ks, const u32 *in, u32 *out)
{
out[0] = in[0] ^ ks[64];

@ -355,6 +355,7 @@ __constant u32a c_skb[8][64] =
#define DES_BOX(i,n,S) (u32x) ((S)[(n)][(i).s0], (S)[(n)][(i).s1], (S)[(n)][(i).s2], (S)[(n)][(i).s3], (S)[(n)][(i).s4], (S)[(n)][(i).s5], (S)[(n)][(i).s6], (S)[(n)][(i).s7], (S)[(n)][(i).s8], (S)[(n)][(i).s9], (S)[(n)][(i).sa], (S)[(n)][(i).sb], (S)[(n)][(i).sc], (S)[(n)][(i).sd], (S)[(n)][(i).se], (S)[(n)][(i).sf])
#endif
DECLSPEC void _des_crypt_encrypt (u32 *iv, u32 *data, u32 *Kc, u32 *Kd, SHM_TYPE u32 (*s_SPtrans)[64]);
DECLSPEC void _des_crypt_encrypt (u32 *iv, u32 *data, u32 *Kc, u32 *Kd, SHM_TYPE u32 (*s_SPtrans)[64])
{
u32 r = data[0];
@ -407,6 +408,7 @@ DECLSPEC void _des_crypt_encrypt (u32 *iv, u32 *data, u32 *Kc, u32 *Kd, SHM_TYPE
iv[1] = r;
}
DECLSPEC void _des_crypt_decrypt (u32 *iv, u32 *data, u32 *Kc, u32 *Kd, SHM_TYPE u32 (*s_SPtrans)[64]);
DECLSPEC void _des_crypt_decrypt (u32 *iv, u32 *data, u32 *Kc, u32 *Kd, SHM_TYPE u32 (*s_SPtrans)[64])
{
u32 r = data[0];
@ -459,6 +461,7 @@ DECLSPEC void _des_crypt_decrypt (u32 *iv, u32 *data, u32 *Kc, u32 *Kd, SHM_TYPE
iv[1] = r;
}
DECLSPEC void _des_crypt_keysetup (u32 c, u32 d, u32 *Kc, u32 *Kd, SHM_TYPE u32 (*s_skb)[64]);
DECLSPEC void _des_crypt_keysetup (u32 c, u32 d, u32 *Kc, u32 *Kd, SHM_TYPE u32 (*s_skb)[64])
{
PERM_OP (d, c, 4, 0x0f0f0f0f);

@ -101,6 +101,7 @@ __constant const u32a k_sbox_inv[256] =
x &= 0xff; \
}
DECLSPEC void kuznyechik_linear (u32 *w);
DECLSPEC void kuznyechik_linear (u32 *w)
{
// used in k_xor macro
@ -137,6 +138,7 @@ DECLSPEC void kuznyechik_linear (u32 *w)
}
}
DECLSPEC void kuznyechik_linear_inv (u32 *w);
DECLSPEC void kuznyechik_linear_inv (u32 *w)
{
// used in k_xor macro
@ -174,6 +176,7 @@ DECLSPEC void kuznyechik_linear_inv (u32 *w)
}
}
DECLSPEC void kuznyechik_set_key (u32 *ks, const u32 *ukey);
DECLSPEC void kuznyechik_set_key (u32 *ks, const u32 *ukey)
{
u32 counter[4];
@ -248,6 +251,7 @@ DECLSPEC void kuznyechik_set_key (u32 *ks, const u32 *ukey)
}
}
DECLSPEC void kuznyechik_encrypt (const u32 *ks, const u32 *in, u32 *out);
DECLSPEC void kuznyechik_encrypt (const u32 *ks, const u32 *in, u32 *out)
{
out[0] = in[0];
@ -273,6 +277,7 @@ DECLSPEC void kuznyechik_encrypt (const u32 *ks, const u32 *in, u32 *out)
out[3] ^= ks[4 * 9 + 3];
}
DECLSPEC void kuznyechik_decrypt (const u32 *ks, const u32 *in, u32 *out);
DECLSPEC void kuznyechik_decrypt (const u32 *ks, const u32 *in, u32 *out)
{
out[0] = in[0];

@ -403,6 +403,7 @@
// 128 bit key
DECLSPEC void serpent128_set_key (u32 *ks, const u32 *ukey);
DECLSPEC void serpent128_set_key (u32 *ks, const u32 *ukey)
{
#ifdef _unroll
@ -469,6 +470,7 @@ DECLSPEC void serpent128_set_key (u32 *ks, const u32 *ukey)
k_set(32,a,b,c,d); sb3(a,b,c,d,e,f,g,h); k_get(32,e,f,g,h);
}
DECLSPEC void serpent128_encrypt (const u32 *ks, const u32 *in, u32 *out);
DECLSPEC void serpent128_encrypt (const u32 *ks, const u32 *in, u32 *out)
{
u32 a,b,c,d,e,f,g,h;
@ -519,6 +521,7 @@ DECLSPEC void serpent128_encrypt (const u32 *ks, const u32 *in, u32 *out)
out[3] = d;
}
DECLSPEC void serpent128_decrypt (const u32 *ks, const u32 *in, u32 *out);
DECLSPEC void serpent128_decrypt (const u32 *ks, const u32 *in, u32 *out)
{
u32 a,b,c,d,e,f,g,h;
@ -571,6 +574,7 @@ DECLSPEC void serpent128_decrypt (const u32 *ks, const u32 *in, u32 *out)
// 256 bit key
DECLSPEC void serpent256_set_key (u32 *ks, const u32 *ukey);
DECLSPEC void serpent256_set_key (u32 *ks, const u32 *ukey)
{
#ifdef _unroll
@ -627,6 +631,7 @@ DECLSPEC void serpent256_set_key (u32 *ks, const u32 *ukey)
k_set(32,a,b,c,d); sb3(a,b,c,d,e,f,g,h); k_get(32,e,f,g,h);
}
DECLSPEC void serpent256_encrypt (const u32 *ks, const u32 *in, u32 *out);
DECLSPEC void serpent256_encrypt (const u32 *ks, const u32 *in, u32 *out)
{
u32 a,b,c,d,e,f,g,h;
@ -677,6 +682,7 @@ DECLSPEC void serpent256_encrypt (const u32 *ks, const u32 *in, u32 *out)
out[3] = d;
}
DECLSPEC void serpent256_decrypt (const u32 *ks, const u32 *in, u32 *out);
DECLSPEC void serpent256_decrypt (const u32 *ks, const u32 *in, u32 *out)
{
u32 a,b,c,d,e,f,g,h;

@ -266,6 +266,7 @@ __constant u32a m_tab[4][256] =
#define q42(x,k) q (1, q (0, q (0, q (0, x) ^ extract_byte (k[3], 2)) ^ extract_byte (k[2], 2)) ^ extract_byte (k[1], 2)) ^ extract_byte (k[0], 2)
#define q43(x,k) q (1, q (1, q (0, q (1, x) ^ extract_byte (k[3], 3)) ^ extract_byte (k[2], 3)) ^ extract_byte (k[1], 3)) ^ extract_byte (k[0], 3)
DECLSPEC u32 mds_rem (u32 p0, u32 p1);
DECLSPEC u32 mds_rem (u32 p0, u32 p1)
{
#define G_MOD 0x14d
@ -332,6 +333,7 @@ DECLSPEC u32 mds_rem (u32 p0, u32 p1)
data[1] = rotr32_S (data[1] ^ (t2 + 2 * t3 + lk[4 * (i) + 9]), 1); \
}
DECLSPEC u32 h_fun128 (u32 *sk, u32 *lk, const u32 x, const u32 *key);
DECLSPEC u32 h_fun128 (u32 *sk, u32 *lk, const u32 x, const u32 *key)
{
u32 b0, b1, b2, b3;
@ -349,6 +351,7 @@ DECLSPEC u32 h_fun128 (u32 *sk, u32 *lk, const u32 x, const u32 *key)
return mds (0, b0) ^ mds (1, b1) ^ mds (2, b2) ^ mds (3, b3);
}
DECLSPEC void twofish128_set_key (u32 *sk, u32 *lk, const u32 *ukey);
DECLSPEC void twofish128_set_key (u32 *sk, u32 *lk, const u32 *ukey)
{
u32 me_key[2];
@ -379,6 +382,7 @@ DECLSPEC void twofish128_set_key (u32 *sk, u32 *lk, const u32 *ukey)
}
}
DECLSPEC void twofish128_encrypt (const u32 *sk, const u32 *lk, const u32 *in, u32 *out);
DECLSPEC void twofish128_encrypt (const u32 *sk, const u32 *lk, const u32 *in, u32 *out)
{
u32 data[4];
@ -403,6 +407,7 @@ DECLSPEC void twofish128_encrypt (const u32 *sk, const u32 *lk, const u32 *in, u
out[3] = data[1] ^ lk[7];
}
DECLSPEC void twofish128_decrypt (const u32 *sk, const u32 *lk, const u32 *in, u32 *out);
DECLSPEC void twofish128_decrypt (const u32 *sk, const u32 *lk, const u32 *in, u32 *out)
{
u32 data[4];
@ -465,6 +470,7 @@ DECLSPEC void twofish128_decrypt (const u32 *sk, const u32 *lk, const u32 *in, u
data[1] = rotr32_S (data[1] ^ (t2 + 2 * t3 + lk[4 * (i) + 9]), 1); \
}
DECLSPEC u32 h_fun256 (u32 *sk, u32 *lk, const u32 x, const u32 *key);
DECLSPEC u32 h_fun256 (u32 *sk, u32 *lk, const u32 x, const u32 *key)
{
u32 b0, b1, b2, b3;
@ -492,6 +498,7 @@ DECLSPEC u32 h_fun256 (u32 *sk, u32 *lk, const u32 x, const u32 *key)
return mds (0, b0) ^ mds (1, b1) ^ mds (2, b2) ^ mds (3, b3);
}
DECLSPEC void twofish256_set_key (u32 *sk, u32 *lk, const u32 *ukey);
DECLSPEC void twofish256_set_key (u32 *sk, u32 *lk, const u32 *ukey)
{
u32 me_key[4];
@ -528,6 +535,7 @@ DECLSPEC void twofish256_set_key (u32 *sk, u32 *lk, const u32 *ukey)
}
}
DECLSPEC void twofish256_encrypt (const u32 *sk, const u32 *lk, const u32 *in, u32 *out);
DECLSPEC void twofish256_encrypt (const u32 *sk, const u32 *lk, const u32 *in, u32 *out)
{
u32 data[4];
@ -552,6 +560,7 @@ DECLSPEC void twofish256_encrypt (const u32 *sk, const u32 *lk, const u32 *in, u
out[3] = data[1] ^ lk[7];
}
DECLSPEC void twofish256_decrypt (const u32 *sk, const u32 *lk, const u32 *in, u32 *out);
DECLSPEC void twofish256_decrypt (const u32 *sk, const u32 *lk, const u32 *in, u32 *out)
{
u32 data[4];

@ -83,6 +83,7 @@
* pure scalar functions
*/
DECLSPEC int ffz (const u32 v);
DECLSPEC int ffz (const u32 v)
{
#ifdef _unroll
@ -98,6 +99,7 @@ DECLSPEC int ffz (const u32 v)
return -1;
}
DECLSPEC int hash_comp (const u32 *d1, __global const u32 *d2);
DECLSPEC int hash_comp (const u32 *d1, __global const u32 *d2)
{
if (d1[3] > d2[DGST_R3]) return ( 1);
@ -112,6 +114,7 @@ DECLSPEC int hash_comp (const u32 *d1, __global const u32 *d2)
return (0);
}
DECLSPEC int find_hash (const u32 *digest, const u32 digests_cnt, __global const digest_t *digests_buf);
DECLSPEC int find_hash (const u32 *digest, const u32 digests_cnt, __global const digest_t *digests_buf)
{
for (u32 l = 0, r = digests_cnt; r; r >>= 1)
@ -135,11 +138,13 @@ DECLSPEC int find_hash (const u32 *digest, const u32 digests_cnt, __global const
return (-1);
}
DECLSPEC u32 check_bitmap (__global const u32 *bitmap, const u32 bitmap_mask, const u32 bitmap_shift, const u32 digest);
DECLSPEC u32 check_bitmap (__global const u32 *bitmap, const u32 bitmap_mask, const u32 bitmap_shift, const u32 digest)
{
return (bitmap[(digest >> bitmap_shift) & bitmap_mask] & (1 << (digest & 0x1f)));
}
DECLSPEC u32 check (const u32 *digest, __global const u32 *bitmap_s1_a, __global const u32 *bitmap_s1_b, __global const u32 *bitmap_s1_c, __global const u32 *bitmap_s1_d, __global const u32 *bitmap_s2_a, __global const u32 *bitmap_s2_b, __global const u32 *bitmap_s2_c, __global const u32 *bitmap_s2_d, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2);
DECLSPEC u32 check (const u32 *digest, __global const u32 *bitmap_s1_a, __global const u32 *bitmap_s1_b, __global const u32 *bitmap_s1_c, __global const u32 *bitmap_s1_d, __global const u32 *bitmap_s2_a, __global const u32 *bitmap_s2_b, __global const u32 *bitmap_s2_c, __global const u32 *bitmap_s2_d, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2)
{
if (check_bitmap (bitmap_s1_a, bitmap_mask, bitmap_shift1, digest[0]) == 0) return (0);
@ -155,6 +160,7 @@ DECLSPEC u32 check (const u32 *digest, __global const u32 *bitmap_s1_a, __global
return (1);
}
DECLSPEC void mark_hash (__global plain_t *plains_buf, __global u32 *d_result, const u32 salt_pos, const u32 digests_cnt, const u32 digest_pos, const u32 hash_pos, const u64 gid, const u32 il_pos);
DECLSPEC void mark_hash (__global plain_t *plains_buf, __global u32 *d_result, const u32 salt_pos, const u32 digests_cnt, const u32 digest_pos, const u32 hash_pos, const u64 gid, const u32 il_pos)
{
const u32 idx = atomic_inc (d_result);
@ -176,6 +182,7 @@ DECLSPEC void mark_hash (__global plain_t *plains_buf, __global u32 *d_result, c
plains_buf[idx].il_pos = il_pos;
}
DECLSPEC int count_char (const u32 *buf, const int elems, const u32 c);
DECLSPEC int count_char (const u32 *buf, const int elems, const u32 c)
{
int r = 0;
@ -193,6 +200,7 @@ DECLSPEC int count_char (const u32 *buf, const int elems, const u32 c)
return r;
}
DECLSPEC float get_entropy (const u32 *buf, const int elems);
DECLSPEC float get_entropy (const u32 *buf, const int elems)
{
const int length = elems * 4;
@ -216,6 +224,7 @@ DECLSPEC float get_entropy (const u32 *buf, const int elems)
return entropy;
}
DECLSPEC int is_valid_hex_8 (const u8 v);
DECLSPEC int is_valid_hex_8 (const u8 v)
{
// direct lookup table is slower thanks to CMOV
@ -226,6 +235,7 @@ DECLSPEC int is_valid_hex_8 (const u8 v)
return 0;
}
DECLSPEC int is_valid_hex_32 (const u32 v);
DECLSPEC int is_valid_hex_32 (const u32 v)
{
if (is_valid_hex_8 ((u8) (v >> 0)) == 0) return 0;
@ -236,6 +246,7 @@ DECLSPEC int is_valid_hex_32 (const u32 v)
return 1;
}
DECLSPEC int is_valid_base58_8 (const u8 v);
DECLSPEC int is_valid_base58_8 (const u8 v)
{
if (v > 'z') return 0;
@ -246,6 +257,7 @@ DECLSPEC int is_valid_base58_8 (const u8 v)
return 1;
}
DECLSPEC int is_valid_base58_32 (const u32 v);
DECLSPEC int is_valid_base58_32 (const u32 v)
{
if (is_valid_base58_8 ((u8) (v >> 0)) == 0) return 0;
@ -256,6 +268,7 @@ DECLSPEC int is_valid_base58_32 (const u32 v)
return 1;
}
DECLSPEC int find_keyboard_layout_map (const u32 search, const int search_len, __local keyboard_layout_mapping_t *s_keyboard_layout_mapping_buf, const int keyboard_layout_mapping_cnt);
DECLSPEC int find_keyboard_layout_map (const u32 search, const int search_len, __local keyboard_layout_mapping_t *s_keyboard_layout_mapping_buf, const int keyboard_layout_mapping_cnt)
{
for (int idx = 0; idx < keyboard_layout_mapping_cnt; idx++)
@ -274,6 +287,7 @@ DECLSPEC int find_keyboard_layout_map (const u32 search, const int search_len, _
return -1;
}
DECLSPEC int execute_keyboard_layout_mapping (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const int pw_len, __local keyboard_layout_mapping_t *s_keyboard_layout_mapping_buf, const int keyboard_layout_mapping_cnt);
DECLSPEC int execute_keyboard_layout_mapping (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const int pw_len, __local keyboard_layout_mapping_t *s_keyboard_layout_mapping_buf, const int keyboard_layout_mapping_cnt)
{
u32 out_buf[16] = { 0 };
@ -404,6 +418,7 @@ DECLSPEC int execute_keyboard_layout_mapping (u32 w0[4], u32 w1[4], u32 w2[4], u
* vector functions
*/
DECLSPEC void make_utf16be (const u32x *in, u32x *out1, u32x *out2);
DECLSPEC void make_utf16be (const u32x *in, u32x *out1, u32x *out2)
{
#if defined IS_NV
@ -442,6 +457,7 @@ DECLSPEC void make_utf16be (const u32x *in, u32x *out1, u32x *out2)
#endif
}
DECLSPEC void make_utf16beN (const u32x *in, u32x *out1, u32x *out2);
DECLSPEC void make_utf16beN (const u32x *in, u32x *out1, u32x *out2)
{
#if defined IS_NV
@ -480,6 +496,7 @@ DECLSPEC void make_utf16beN (const u32x *in, u32x *out1, u32x *out2)
#endif
}
DECLSPEC void make_utf16le (const u32x *in, u32x *out1, u32x *out2);
DECLSPEC void make_utf16le (const u32x *in, u32x *out1, u32x *out2)
{
#if defined IS_NV
@ -518,6 +535,7 @@ DECLSPEC void make_utf16le (const u32x *in, u32x *out1, u32x *out2)
#endif
}
DECLSPEC void make_utf16leN (const u32x *in, u32x *out1, u32x *out2);
DECLSPEC void make_utf16leN (const u32x *in, u32x *out1, u32x *out2)
{
#if defined IS_NV
@ -556,6 +574,7 @@ DECLSPEC void make_utf16leN (const u32x *in, u32x *out1, u32x *out2)
#endif
}
DECLSPEC void undo_utf16be (const u32x *in1, const u32x *in2, u32x *out);
DECLSPEC void undo_utf16be (const u32x *in1, const u32x *in2, u32x *out)
{
#if defined IS_NV
@ -586,6 +605,7 @@ DECLSPEC void undo_utf16be (const u32x *in1, const u32x *in2, u32x *out)
#endif
}
DECLSPEC void undo_utf16le (const u32x *in1, const u32x *in2, u32x *out);
DECLSPEC void undo_utf16le (const u32x *in1, const u32x *in2, u32x *out)
{
#if defined IS_NV
@ -616,6 +636,7 @@ DECLSPEC void undo_utf16le (const u32x *in1, const u32x *in2, u32x *out)
#endif
}
DECLSPEC void set_mark_1x4 (u32 *v, const u32 offset);
DECLSPEC void set_mark_1x4 (u32 *v, const u32 offset)
{
const u32 c = (offset & 15) / 4;
@ -627,6 +648,7 @@ DECLSPEC void set_mark_1x4 (u32 *v, const u32 offset)
v[3] = (c == 3) ? r : 0;
}
DECLSPEC void append_helper_1x4 (u32x *r, const u32 v, const u32 *m);
DECLSPEC void append_helper_1x4 (u32x *r, const u32 v, const u32 *m)
{
r[0] |= v & m[0];
@ -635,6 +657,7 @@ DECLSPEC void append_helper_1x4 (u32x *r, const u32 v, const u32 *m)
r[3] |= v & m[3];
}
DECLSPEC void append_0x80_1x4 (u32x *w0, const u32 offset);
DECLSPEC void append_0x80_1x4 (u32x *w0, const u32 offset)
{
u32 v[4];
@ -644,6 +667,7 @@ DECLSPEC void append_0x80_1x4 (u32x *w0, const u32 offset)
append_helper_1x4 (w0, 0x80808080, v);
}
DECLSPEC void append_0x80_2x4 (u32x *w0, u32x *w1, const u32 offset);
DECLSPEC void append_0x80_2x4 (u32x *w0, u32x *w1, const u32 offset)
{
u32 v[4];
@ -656,6 +680,7 @@ DECLSPEC void append_0x80_2x4 (u32x *w0, u32x *w1, const u32 offset)
append_helper_1x4 (w1, ((offset16 == 1) ? 0x80808080 : 0), v);
}
DECLSPEC void append_0x80_3x4 (u32x *w0, u32x *w1, u32x *w2, const u32 offset);
DECLSPEC void append_0x80_3x4 (u32x *w0, u32x *w1, u32x *w2, const u32 offset)
{
u32 v[4];
@ -669,6 +694,7 @@ DECLSPEC void append_0x80_3x4 (u32x *w0, u32x *w1, u32x *w2, const u32 offset)
append_helper_1x4 (w2, ((offset16 == 2) ? 0x80808080 : 0), v);
}
DECLSPEC void append_0x80_4x4 (u32x *w0, u32x *w1, u32x *w2, u32x *w3, const u32 offset);
DECLSPEC void append_0x80_4x4 (u32x *w0, u32x *w1, u32x *w2, u32x *w3, const u32 offset)
{
u32 v[4];
@ -683,6 +709,7 @@ DECLSPEC void append_0x80_4x4 (u32x *w0, u32x *w1, u32x *w2, u32x *w3, const u32
append_helper_1x4 (w3, ((offset16 == 3) ? 0x80808080 : 0), v);
}
DECLSPEC void append_0x80_8x4 (u32x *w0, u32x *w1, u32x *w2, u32x *w3, u32x *w4, u32x *w5, u32x *w6, u32x *w7, const u32 offset);
DECLSPEC void append_0x80_8x4 (u32x *w0, u32x *w1, u32x *w2, u32x *w3, u32x *w4, u32x *w5, u32x *w6, u32x *w7, const u32 offset)
{
u32 v[4];
@ -701,6 +728,7 @@ DECLSPEC void append_0x80_8x4 (u32x *w0, u32x *w1, u32x *w2, u32x *w3, u32x *w4,
append_helper_1x4 (w7, ((offset16 == 7) ? 0x80808080 : 0), v);
}
DECLSPEC void append_0x80_1x16 (u32x *w, const u32 offset);
DECLSPEC void append_0x80_1x16 (u32x *w, const u32 offset)
{
u32 v[4];
@ -715,12 +743,9 @@ DECLSPEC void append_0x80_1x16 (u32x *w, const u32 offset)
append_helper_1x4 (w + 12, ((offset16 == 3) ? 0x80808080 : 0), v);
}
DECLSPEC void switch_buffer_by_offset_le (u32x *w0, u32x *w1, u32x *w2, u32x *w3, const u32 offset);
DECLSPEC void switch_buffer_by_offset_le (u32x *w0, u32x *w1, u32x *w2, u32x *w3, const u32 offset)
{
const int offset_mod_4 = offset & 3;
const int offset_minus_4 = 4 - offset_mod_4;
const int offset_switch = offset / 4;
#if (defined IS_AMD && HAS_VPERM == 0) || defined IS_GENERIC
@ -1050,6 +1075,10 @@ DECLSPEC void switch_buffer_by_offset_le (u32x *w0, u32x *w1, u32x *w2, u32x *w3
#if (defined IS_AMD && HAS_VPERM == 1) || defined IS_NV
const int offset_mod_4 = offset & 3;
const int offset_minus_4 = 4 - offset_mod_4;
#if defined IS_NV
const int selector = (0x76543210 >> (offset_minus_4 * 4)) & 0xffff;
#endif
@ -1383,12 +1412,9 @@ DECLSPEC void switch_buffer_by_offset_le (u32x *w0, u32x *w1, u32x *w2, u32x *w3
#endif
}
DECLSPEC void switch_buffer_by_offset_carry_le (u32x *w0, u32x *w1, u32x *w2, u32x *w3, u32x *c0, u32x *c1, u32x *c2, u32x *c3, const u32 offset);
DECLSPEC void switch_buffer_by_offset_carry_le (u32x *w0, u32x *w1, u32x *w2, u32x *w3, u32x *c0, u32x *c1, u32x *c2, u32x *c3, const u32 offset)
{
const int offset_mod_4 = offset & 3;
const int offset_minus_4 = 4 - offset_mod_4;
const int offset_switch = offset / 4;
#if defined IS_AMD || defined IS_GENERIC
@ -1853,6 +1879,11 @@ DECLSPEC void switch_buffer_by_offset_carry_le (u32x *w0, u32x *w1, u32x *w2, u3
#endif
#ifdef IS_NV
const int offset_mod_4 = offset & 3;
const int offset_minus_4 = 4 - offset_mod_4;
// todo
switch (offset_switch)
{
@ -2651,6 +2682,7 @@ DECLSPEC void switch_buffer_by_offset_carry_le (u32x *w0, u32x *w1, u32x *w2, u3
#endif
}
DECLSPEC void switch_buffer_by_offset_be (u32x *w0, u32x *w1, u32x *w2, u32x *w3, const u32 offset);
DECLSPEC void switch_buffer_by_offset_be (u32x *w0, u32x *w1, u32x *w2, u32x *w3, const u32 offset)
{
const int offset_switch = offset / 4;
@ -3315,6 +3347,7 @@ DECLSPEC void switch_buffer_by_offset_be (u32x *w0, u32x *w1, u32x *w2, u32x *w3
#endif
}
DECLSPEC void switch_buffer_by_offset_carry_be (u32x *w0, u32x *w1, u32x *w2, u32x *w3, u32x *c0, u32x *c1, u32x *c2, u32x *c3, const u32 offset);
DECLSPEC void switch_buffer_by_offset_carry_be (u32x *w0, u32x *w1, u32x *w2, u32x *w3, u32x *c0, u32x *c1, u32x *c2, u32x *c3, const u32 offset)
{
const int offset_switch = offset / 4;
@ -4251,12 +4284,9 @@ DECLSPEC void switch_buffer_by_offset_carry_be (u32x *w0, u32x *w1, u32x *w2, u3
#endif
}
DECLSPEC void switch_buffer_by_offset_8x4_le (u32x *w0, u32x *w1, u32x *w2, u32x *w3, u32x *w4, u32x *w5, u32x *w6, u32x *w7, const u32 offset);
DECLSPEC void switch_buffer_by_offset_8x4_le (u32x *w0, u32x *w1, u32x *w2, u32x *w3, u32x *w4, u32x *w5, u32x *w6, u32x *w7, const u32 offset)
{
const int offset_mod_4 = offset & 3;
const int offset_minus_4 = 4 - offset_mod_4;
const int offset_switch = offset / 4;
#if (defined IS_AMD && HAS_VPERM == 0) || defined IS_GENERIC
@ -5418,6 +5448,10 @@ DECLSPEC void switch_buffer_by_offset_8x4_le (u32x *w0, u32x *w1, u32x *w2, u32x
#if (defined IS_AMD && HAS_VPERM == 1) || defined IS_NV
const int offset_mod_4 = offset & 3;
const int offset_minus_4 = 4 - offset_mod_4;
#if defined IS_NV
const int selector = (0x76543210 >> (offset_minus_4 * 4)) & 0xffff;
#endif
@ -5991,6 +6025,7 @@ DECLSPEC void switch_buffer_by_offset_8x4_le (u32x *w0, u32x *w1, u32x *w2, u32x
#endif
}
DECLSPEC void switch_buffer_by_offset_8x4_be (u32x *w0, u32x *w1, u32x *w2, u32x *w3, u32x *w4, u32x *w5, u32x *w6, u32x *w7, const u32 offset);
DECLSPEC void switch_buffer_by_offset_8x4_be (u32x *w0, u32x *w1, u32x *w2, u32x *w3, u32x *w4, u32x *w5, u32x *w6, u32x *w7, const u32 offset)
{
const int offset_switch = offset / 4;
@ -8319,6 +8354,7 @@ DECLSPEC void switch_buffer_by_offset_8x4_be (u32x *w0, u32x *w1, u32x *w2, u32x
#endif
}
DECLSPEC void switch_buffer_by_offset_8x4_carry_be (u32x *w0, u32x *w1, u32x *w2, u32x *w3, u32x *w4, u32x *w5, u32x *w6, u32x *w7, u32x *c0, u32x *c1, u32x *c2, u32x *c3, u32x *c4, u32x *c5, u32x *c6, u32x *c7, const u32 offset);
DECLSPEC void switch_buffer_by_offset_8x4_carry_be (u32x *w0, u32x *w1, u32x *w2, u32x *w3, u32x *w4, u32x *w5, u32x *w6, u32x *w7, u32x *c0, u32x *c1, u32x *c2, u32x *c3, u32x *c4, u32x *c5, u32x *c6, u32x *c7, const u32 offset)
{
const int offset_switch = offset / 4;
@ -11703,12 +11739,9 @@ DECLSPEC void switch_buffer_by_offset_8x4_carry_be (u32x *w0, u32x *w1, u32x *w2
#endif
}
DECLSPEC void switch_buffer_by_offset_1x64_le (u32x *w, const u32 offset);
DECLSPEC void switch_buffer_by_offset_1x64_le (u32x *w, const u32 offset)
{
const int offset_mod_4 = offset & 3;
const int offset_minus_4 = 4 - offset_mod_4;
const int offset_switch = offset / 4;
#if (defined IS_AMD && HAS_VPERM == 0) || defined IS_GENERIC
@ -16070,6 +16103,10 @@ DECLSPEC void switch_buffer_by_offset_1x64_le (u32x *w, const u32 offset)
#if (defined IS_AMD && HAS_VPERM == 1) || defined IS_NV
const int offset_mod_4 = offset & 3;
const int offset_minus_4 = 4 - offset_mod_4;
#if defined IS_NV
const int selector = (0x76543210 >> (offset_minus_4 * 4)) & 0xffff;
#endif
@ -20435,6 +20472,7 @@ DECLSPEC void switch_buffer_by_offset_1x64_le (u32x *w, const u32 offset)
#endif
}
DECLSPEC void switch_buffer_by_offset_1x64_be (u32x *w, const u32 offset);
DECLSPEC void switch_buffer_by_offset_1x64_be (u32x *w, const u32 offset)
{
const int offset_switch = offset / 4;
@ -29167,6 +29205,7 @@ DECLSPEC void switch_buffer_by_offset_1x64_be (u32x *w, const u32 offset)
* vector functions as scalar (for outer loop usage)
*/
DECLSPEC void truncate_block_4x4_le_S (u32 *w0, const u32 len);
DECLSPEC void truncate_block_4x4_le_S (u32 *w0, const u32 len)
{
switch (len)
@ -29277,6 +29316,7 @@ DECLSPEC void truncate_block_4x4_le_S (u32 *w0, const u32 len)
}
}
DECLSPEC void truncate_block_4x4_be_S (u32 *w0, const u32 len);
DECLSPEC void truncate_block_4x4_be_S (u32 *w0, const u32 len)
{
switch (len)
@ -29387,6 +29427,7 @@ DECLSPEC void truncate_block_4x4_be_S (u32 *w0, const u32 len)
}
}
DECLSPEC void truncate_block_16x4_le_S (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 len);
DECLSPEC void truncate_block_16x4_le_S (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 len)
{
switch (len)
@ -30193,6 +30234,7 @@ DECLSPEC void truncate_block_16x4_le_S (u32 *w0, u32 *w1, u32 *w2, u32 *w3, cons
}
}
DECLSPEC void truncate_block_16x4_be_S (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 len);
DECLSPEC void truncate_block_16x4_be_S (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 len)
{
switch (len)
@ -30999,6 +31041,7 @@ DECLSPEC void truncate_block_16x4_be_S (u32 *w0, u32 *w1, u32 *w2, u32 *w3, cons
}
}
DECLSPEC void set_mark_1x4_S (u32 *v, const u32 offset);
DECLSPEC void set_mark_1x4_S (u32 *v, const u32 offset)
{
const u32 c = (offset & 15) / 4;
@ -31010,6 +31053,7 @@ DECLSPEC void set_mark_1x4_S (u32 *v, const u32 offset)
v[3] = (c == 3) ? r : 0;
}
DECLSPEC void append_helper_1x4_S (u32 *r, const u32 v, const u32 *m);
DECLSPEC void append_helper_1x4_S (u32 *r, const u32 v, const u32 *m)
{
r[0] |= v & m[0];
@ -31018,6 +31062,7 @@ DECLSPEC void append_helper_1x4_S (u32 *r, const u32 v, const u32 *m)
r[3] |= v & m[3];
}
DECLSPEC void append_0x01_2x4_S (u32 *w0, u32 *w1, const u32 offset);
DECLSPEC void append_0x01_2x4_S (u32 *w0, u32 *w1, const u32 offset)
{
u32 v[4];
@ -31030,6 +31075,7 @@ DECLSPEC void append_0x01_2x4_S (u32 *w0, u32 *w1, const u32 offset)
append_helper_1x4_S (w1, ((offset16 == 1) ? 0x01010101 : 0), v);
}
DECLSPEC void append_0x06_2x4_S (u32 *w0, u32 *w1, const u32 offset);
DECLSPEC void append_0x06_2x4_S (u32 *w0, u32 *w1, const u32 offset)
{
u32 v[4];
@ -31042,6 +31088,7 @@ DECLSPEC void append_0x06_2x4_S (u32 *w0, u32 *w1, const u32 offset)
append_helper_1x4_S (w1, ((offset16 == 1) ? 0x06060606 : 0), v);
}
DECLSPEC void append_0x01_4x4_S (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 offset);
DECLSPEC void append_0x01_4x4_S (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 offset)
{
u32 v[4];
@ -31056,6 +31103,7 @@ DECLSPEC void append_0x01_4x4_S (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 o
append_helper_1x4_S (w3, ((offset16 == 3) ? 0x01010101 : 0), v);
}
DECLSPEC void append_0x80_1x4_S (u32 *w0, const u32 offset);
DECLSPEC void append_0x80_1x4_S (u32 *w0, const u32 offset)
{
u32 v[4];
@ -31065,6 +31113,7 @@ DECLSPEC void append_0x80_1x4_S (u32 *w0, const u32 offset)
append_helper_1x4_S (w0, 0x80808080, v);
}
DECLSPEC void append_0x80_2x4_S (u32 *w0, u32 *w1, const u32 offset);
DECLSPEC void append_0x80_2x4_S (u32 *w0, u32 *w1, const u32 offset)
{
u32 v[4];
@ -31077,6 +31126,7 @@ DECLSPEC void append_0x80_2x4_S (u32 *w0, u32 *w1, const u32 offset)
append_helper_1x4_S (w1, ((offset16 == 1) ? 0x80808080 : 0), v);
}
DECLSPEC void append_0x80_3x4_S (u32 *w0, u32 *w1, u32 *w2, const u32 offset);
DECLSPEC void append_0x80_3x4_S (u32 *w0, u32 *w1, u32 *w2, const u32 offset)
{
u32 v[4];
@ -31090,6 +31140,7 @@ DECLSPEC void append_0x80_3x4_S (u32 *w0, u32 *w1, u32 *w2, const u32 offset)
append_helper_1x4_S (w2, ((offset16 == 2) ? 0x80808080 : 0), v);
}
DECLSPEC void append_0x80_4x4_S (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 offset);
DECLSPEC void append_0x80_4x4_S (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 offset)
{
u32 v[4];
@ -31104,6 +31155,7 @@ DECLSPEC void append_0x80_4x4_S (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 o
append_helper_1x4_S (w3, ((offset16 == 3) ? 0x80808080 : 0), v);
}
DECLSPEC void append_0x80_8x4_S (u32 *w0, u32 *w1, u32 *w2, u32 *w3, u32 *w4, u32 *w5, u32 *w6, u32 *w7, const u32 offset);
DECLSPEC void append_0x80_8x4_S (u32 *w0, u32 *w1, u32 *w2, u32 *w3, u32 *w4, u32 *w5, u32 *w6, u32 *w7, const u32 offset)
{
u32 v[4];
@ -31122,6 +31174,7 @@ DECLSPEC void append_0x80_8x4_S (u32 *w0, u32 *w1, u32 *w2, u32 *w3, u32 *w4, u3
append_helper_1x4_S (w7, ((offset16 == 7) ? 0x80808080 : 0), v);
}
DECLSPEC void make_utf16be_S (const u32 *in, u32 *out1, u32 *out2);
DECLSPEC void make_utf16be_S (const u32 *in, u32 *out1, u32 *out2)
{
#if defined IS_NV
@ -31160,6 +31213,7 @@ DECLSPEC void make_utf16be_S (const u32 *in, u32 *out1, u32 *out2)
#endif
}
DECLSPEC void make_utf16le_S (const u32 *in, u32 *out1, u32 *out2);
DECLSPEC void make_utf16le_S (const u32 *in, u32 *out1, u32 *out2)
{
#if defined IS_NV
@ -31198,6 +31252,7 @@ DECLSPEC void make_utf16le_S (const u32 *in, u32 *out1, u32 *out2)
#endif
}
DECLSPEC void undo_utf16be_S (const u32 *in1, const u32 *in2, u32 *out);
DECLSPEC void undo_utf16be_S (const u32 *in1, const u32 *in2, u32 *out)
{
#if defined IS_NV
@ -31228,6 +31283,7 @@ DECLSPEC void undo_utf16be_S (const u32 *in1, const u32 *in2, u32 *out)
#endif
}
DECLSPEC void undo_utf16le_S (const u32 *in1, const u32 *in2, u32 *out);
DECLSPEC void undo_utf16le_S (const u32 *in1, const u32 *in2, u32 *out)
{
#if defined IS_NV
@ -31258,12 +31314,9 @@ DECLSPEC void undo_utf16le_S (const u32 *in1, const u32 *in2, u32 *out)
#endif
}
DECLSPEC void switch_buffer_by_offset_le_S (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 offset);
DECLSPEC void switch_buffer_by_offset_le_S (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 offset)
{
const int offset_mod_4 = offset & 3;
const int offset_minus_4 = 4 - offset_mod_4;
const int offset_switch = offset / 4;
#if (defined IS_AMD && HAS_VPERM == 0) || defined IS_GENERIC
@ -31593,6 +31646,10 @@ DECLSPEC void switch_buffer_by_offset_le_S (u32 *w0, u32 *w1, u32 *w2, u32 *w3,
#if (defined IS_AMD && HAS_VPERM == 1) || defined IS_NV
const int offset_mod_4 = offset & 3;
const int offset_minus_4 = 4 - offset_mod_4;
#if defined IS_NV
const int selector = (0x76543210 >> (offset_minus_4 * 4)) & 0xffff;
#endif
@ -31926,12 +31983,9 @@ DECLSPEC void switch_buffer_by_offset_le_S (u32 *w0, u32 *w1, u32 *w2, u32 *w3,
#endif
}
DECLSPEC void switch_buffer_by_offset_carry_le_S (u32 *w0, u32 *w1, u32 *w2, u32 *w3, u32 *c0, u32 *c1, u32 *c2, u32 *c3, const u32 offset);
DECLSPEC void switch_buffer_by_offset_carry_le_S (u32 *w0, u32 *w1, u32 *w2, u32 *w3, u32 *c0, u32 *c1, u32 *c2, u32 *c3, const u32 offset)
{
const int offset_mod_4 = offset & 3;
const int offset_minus_4 = 4 - offset_mod_4;
const int offset_switch = offset / 4;
#if defined IS_AMD || defined IS_GENERIC
@ -32396,6 +32450,11 @@ DECLSPEC void switch_buffer_by_offset_carry_le_S (u32 *w0, u32 *w1, u32 *w2, u32
#endif
#ifdef IS_NV
const int offset_mod_4 = offset & 3;
const int offset_minus_4 = 4 - offset_mod_4;
// todo
switch (offset_switch)
{
@ -33194,6 +33253,7 @@ DECLSPEC void switch_buffer_by_offset_carry_le_S (u32 *w0, u32 *w1, u32 *w2, u32
#endif
}
DECLSPEC void switch_buffer_by_offset_be_S (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 offset);
DECLSPEC void switch_buffer_by_offset_be_S (u32 *w0, u32 *w1, u32 *w2, u32 *w3, const u32 offset)
{
const int offset_switch = offset / 4;
@ -33858,6 +33918,7 @@ DECLSPEC void switch_buffer_by_offset_be_S (u32 *w0, u32 *w1, u32 *w2, u32 *w3,
#endif
}
DECLSPEC void switch_buffer_by_offset_carry_be_S (u32 *w0, u32 *w1, u32 *w2, u32 *w3, u32 *c0, u32 *c1, u32 *c2, u32 *c3, const u32 offset);
DECLSPEC void switch_buffer_by_offset_carry_be_S (u32 *w0, u32 *w1, u32 *w2, u32 *w3, u32 *c0, u32 *c1, u32 *c2, u32 *c3, const u32 offset)
{
const int offset_switch = offset / 4;
@ -34794,12 +34855,9 @@ DECLSPEC void switch_buffer_by_offset_carry_be_S (u32 *w0, u32 *w1, u32 *w2, u32
#endif
}
DECLSPEC void switch_buffer_by_offset_8x4_le_S (u32 *w0, u32 *w1, u32 *w2, u32 *w3, u32 *w4, u32 *w5, u32 *w6, u32 *w7, const u32 offset);
DECLSPEC void switch_buffer_by_offset_8x4_le_S (u32 *w0, u32 *w1, u32 *w2, u32 *w3, u32 *w4, u32 *w5, u32 *w6, u32 *w7, const u32 offset)
{
const int offset_mod_4 = offset & 3;
const int offset_minus_4 = 4 - offset_mod_4;
const int offset_switch = offset / 4;
#if (defined IS_AMD && HAS_VPERM == 0) || defined IS_GENERIC
@ -35961,6 +36019,10 @@ DECLSPEC void switch_buffer_by_offset_8x4_le_S (u32 *w0, u32 *w1, u32 *w2, u32 *
#if (defined IS_AMD && HAS_VPERM == 1) || defined IS_NV
const int offset_mod_4 = offset & 3;
const int offset_minus_4 = 4 - offset_mod_4;
#if defined IS_NV
const int selector = (0x76543210 >> (offset_minus_4 * 4)) & 0xffff;
#endif
@ -36534,6 +36596,7 @@ DECLSPEC void switch_buffer_by_offset_8x4_le_S (u32 *w0, u32 *w1, u32 *w2, u32 *
#endif
}
DECLSPEC void switch_buffer_by_offset_8x4_be_S (u32 *w0, u32 *w1, u32 *w2, u32 *w3, u32 *w4, u32 *w5, u32 *w6, u32 *w7, const u32 offset);
DECLSPEC void switch_buffer_by_offset_8x4_be_S (u32 *w0, u32 *w1, u32 *w2, u32 *w3, u32 *w4, u32 *w5, u32 *w6, u32 *w7, const u32 offset)
{
const int offset_switch = offset / 4;
@ -38862,6 +38925,7 @@ DECLSPEC void switch_buffer_by_offset_8x4_be_S (u32 *w0, u32 *w1, u32 *w2, u32 *
#endif
}
DECLSPEC void switch_buffer_by_offset_8x4_carry_be_S (u32 *w0, u32 *w1, u32 *w2, u32 *w3, u32 *w4, u32 *w5, u32 *w6, u32 *w7, u32 *c0, u32 *c1, u32 *c2, u32 *c3, u32 *c4, u32 *c5, u32 *c6, u32 *c7, const u32 offset);
DECLSPEC void switch_buffer_by_offset_8x4_carry_be_S (u32 *w0, u32 *w1, u32 *w2, u32 *w3, u32 *w4, u32 *w5, u32 *w6, u32 *w7, u32 *c0, u32 *c1, u32 *c2, u32 *c3, u32 *c4, u32 *c5, u32 *c6, u32 *c7, const u32 offset)
{
const int offset_switch = offset / 4;
@ -42246,12 +42310,9 @@ DECLSPEC void switch_buffer_by_offset_8x4_carry_be_S (u32 *w0, u32 *w1, u32 *w2,
#endif
}
DECLSPEC void switch_buffer_by_offset_1x64_le_S (u32 *w, const u32 offset);
DECLSPEC void switch_buffer_by_offset_1x64_le_S (u32 *w, const u32 offset)
{
const int offset_mod_4 = offset & 3;
const int offset_minus_4 = 4 - offset_mod_4;
const int offset_switch = offset / 4;
#if (defined IS_AMD && HAS_VPERM == 0) || defined IS_GENERIC
@ -46613,6 +46674,10 @@ DECLSPEC void switch_buffer_by_offset_1x64_le_S (u32 *w, const u32 offset)
#if (defined IS_AMD && HAS_VPERM == 1) || defined IS_NV
const int offset_mod_4 = offset & 3;
const int offset_minus_4 = 4 - offset_mod_4;
#if defined IS_NV
const int selector = (0x76543210 >> (offset_minus_4 * 4)) & 0xffff;
#endif
@ -50978,6 +51043,7 @@ DECLSPEC void switch_buffer_by_offset_1x64_le_S (u32 *w, const u32 offset)
#endif
}
DECLSPEC void switch_buffer_by_offset_1x64_be_S (u32 *w, const u32 offset);
DECLSPEC void switch_buffer_by_offset_1x64_be_S (u32 *w, const u32 offset)
{
const int offset_switch = offset / 4;
@ -59770,6 +59836,7 @@ DECLSPEC void switch_buffer_by_offset_1x64_be_S (u32 *w, const u32 offset)
PACKSV4 (s6, v6, e); \
PACKSV4 (s7, v7, e);
DECLSPEC void switch_buffer_by_offset_le_VV (u32x *w0, u32x *w1, u32x *w2, u32x *w3, const u32x offset);
DECLSPEC void switch_buffer_by_offset_le_VV (u32x *w0, u32x *w1, u32x *w2, u32x *w3, const u32x offset)
{
#if VECT_SIZE == 1
@ -59830,6 +59897,7 @@ DECLSPEC void switch_buffer_by_offset_le_VV (u32x *w0, u32x *w1, u32x *w2, u32x
#endif
}
DECLSPEC void switch_buffer_by_offset_8x4_le_VV (u32x *w0, u32x *w1, u32x *w2, u32x *w3, u32x *w4, u32x *w5, u32x *w6, u32x *w7, const u32x offset);
DECLSPEC void switch_buffer_by_offset_8x4_le_VV (u32x *w0, u32x *w1, u32x *w2, u32x *w3, u32x *w4, u32x *w5, u32x *w6, u32x *w7, const u32x offset)
{
#if VECT_SIZE == 1
@ -60010,6 +60078,7 @@ DECLSPEC void switch_buffer_by_offset_8x4_le_VV (u32x *w0, u32x *w1, u32x *w2, u
#endif
}
DECLSPEC void append_0x01_2x4_VV (u32x *w0, u32x *w1, const u32x offset);
DECLSPEC void append_0x01_2x4_VV (u32x *w0, u32x *w1, const u32x offset)
{
#if VECT_SIZE == 1
@ -60068,6 +60137,7 @@ DECLSPEC void append_0x01_2x4_VV (u32x *w0, u32x *w1, const u32x offset)
#endif
}
DECLSPEC void append_0x01_4x4_VV (u32x *w0, u32x *w1, u32x *w2, u32x *w3, const u32x offset);
DECLSPEC void append_0x01_4x4_VV (u32x *w0, u32x *w1, u32x *w2, u32x *w3, const u32x offset)
{
#if VECT_SIZE == 1
@ -60128,6 +60198,7 @@ DECLSPEC void append_0x01_4x4_VV (u32x *w0, u32x *w1, u32x *w2, u32x *w3, const
#endif
}
DECLSPEC void append_0x06_2x4_VV (u32x *w0, u32x *w1, const u32x offset);
DECLSPEC void append_0x06_2x4_VV (u32x *w0, u32x *w1, const u32x offset)
{
#if VECT_SIZE == 1
@ -60186,6 +60257,7 @@ DECLSPEC void append_0x06_2x4_VV (u32x *w0, u32x *w1, const u32x offset)
#endif
}
DECLSPEC void append_0x80_2x4_VV (u32x *w0, u32x *w1, const u32x offset);
DECLSPEC void append_0x80_2x4_VV (u32x *w0, u32x *w1, const u32x offset)
{
#if VECT_SIZE == 1
@ -60244,6 +60316,7 @@ DECLSPEC void append_0x80_2x4_VV (u32x *w0, u32x *w1, const u32x offset)
#endif
}
DECLSPEC void append_0x80_4x4_VV (u32x *w0, u32x *w1, u32x *w2, u32x *w3, const u32x offset);
DECLSPEC void append_0x80_4x4_VV (u32x *w0, u32x *w1, u32x *w2, u32x *w3, const u32x offset)
{
#if VECT_SIZE == 1
@ -60304,6 +60377,7 @@ DECLSPEC void append_0x80_4x4_VV (u32x *w0, u32x *w1, u32x *w2, u32x *w3, const
#endif
}
DECLSPEC void gpu_decompress_entry (__global pw_idx_t *pws_idx, __global u32 *pws_comp, pw_t *pw, const u64 gid);
DECLSPEC void gpu_decompress_entry (__global pw_idx_t *pws_idx, __global u32 *pws_comp, pw_t *pw, const u64 gid)
{
const u32 off = pws_idx[gid].off;

@ -17,6 +17,7 @@ typedef struct md4_ctx
} md4_ctx_t;
DECLSPEC void md4_transform (const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, u32 *digest);
DECLSPEC void md4_transform (const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, u32 *digest)
{
u32 a = digest[0];
@ -81,6 +82,7 @@ DECLSPEC void md4_transform (const u32 *w0, const u32 *w1, const u32 *w2, const
digest[3] += d;
}
DECLSPEC void md4_init (md4_ctx_t *ctx);
DECLSPEC void md4_init (md4_ctx_t *ctx)
{
ctx->h[0] = MD4M_A;
@ -108,6 +110,7 @@ DECLSPEC void md4_init (md4_ctx_t *ctx)
ctx->len = 0;
}
DECLSPEC void md4_update_64 (md4_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len);
DECLSPEC void md4_update_64 (md4_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len)
{
const int pos = ctx->len & 63;
@ -182,6 +185,7 @@ DECLSPEC void md4_update_64 (md4_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3,
}
}
DECLSPEC void md4_update (md4_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void md4_update (md4_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -234,6 +238,7 @@ DECLSPEC void md4_update (md4_ctx_t *ctx, const u32 *w, const int len)
md4_update_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void md4_update_swap (md4_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void md4_update_swap (md4_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -320,6 +325,7 @@ DECLSPEC void md4_update_swap (md4_ctx_t *ctx, const u32 *w, const int len)
md4_update_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void md4_update_utf16le (md4_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void md4_update_utf16le (md4_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -362,6 +368,7 @@ DECLSPEC void md4_update_utf16le (md4_ctx_t *ctx, const u32 *w, const int len)
md4_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void md4_update_utf16le_swap (md4_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void md4_update_utf16le_swap (md4_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -438,6 +445,7 @@ DECLSPEC void md4_update_utf16le_swap (md4_ctx_t *ctx, const u32 *w, const int l
md4_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void md4_update_global (md4_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void md4_update_global (md4_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -490,6 +498,7 @@ DECLSPEC void md4_update_global (md4_ctx_t *ctx, const __global u32 *w, const in
md4_update_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void md4_update_global_swap (md4_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void md4_update_global_swap (md4_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -576,6 +585,7 @@ DECLSPEC void md4_update_global_swap (md4_ctx_t *ctx, const __global u32 *w, con
md4_update_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void md4_update_global_utf16le (md4_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void md4_update_global_utf16le (md4_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -618,6 +628,7 @@ DECLSPEC void md4_update_global_utf16le (md4_ctx_t *ctx, const __global u32 *w,
md4_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void md4_update_global_utf16le_swap (md4_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void md4_update_global_utf16le_swap (md4_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -694,6 +705,7 @@ DECLSPEC void md4_update_global_utf16le_swap (md4_ctx_t *ctx, const __global u32
md4_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void md4_final (md4_ctx_t *ctx);
DECLSPEC void md4_final (md4_ctx_t *ctx)
{
const int pos = ctx->len & 63;
@ -737,6 +749,7 @@ typedef struct md4_hmac_ctx
} md4_hmac_ctx_t;
DECLSPEC void md4_hmac_init_64 (md4_hmac_ctx_t *ctx, const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3);
DECLSPEC void md4_hmac_init_64 (md4_hmac_ctx_t *ctx, const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3)
{
u32 t0[4];
@ -791,6 +804,7 @@ DECLSPEC void md4_hmac_init_64 (md4_hmac_ctx_t *ctx, const u32 *w0, const u32 *w
md4_update_64 (&ctx->opad, t0, t1, t2, t3, 64);
}
DECLSPEC void md4_hmac_init (md4_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void md4_hmac_init (md4_hmac_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -848,6 +862,7 @@ DECLSPEC void md4_hmac_init (md4_hmac_ctx_t *ctx, const u32 *w, const int len)
md4_hmac_init_64 (ctx, w0, w1, w2, w3);
}
DECLSPEC void md4_hmac_init_swap (md4_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void md4_hmac_init_swap (md4_hmac_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -905,6 +920,7 @@ DECLSPEC void md4_hmac_init_swap (md4_hmac_ctx_t *ctx, const u32 *w, const int l
md4_hmac_init_64 (ctx, w0, w1, w2, w3);
}
DECLSPEC void md4_hmac_init_global (md4_hmac_ctx_t *ctx, __global const u32 *w, const int len);
DECLSPEC void md4_hmac_init_global (md4_hmac_ctx_t *ctx, __global const u32 *w, const int len)
{
u32 w0[4];
@ -962,6 +978,7 @@ DECLSPEC void md4_hmac_init_global (md4_hmac_ctx_t *ctx, __global const u32 *w,
md4_hmac_init_64 (ctx, w0, w1, w2, w3);
}
DECLSPEC void md4_hmac_init_global_swap (md4_hmac_ctx_t *ctx, __global const u32 *w, const int len);
DECLSPEC void md4_hmac_init_global_swap (md4_hmac_ctx_t *ctx, __global const u32 *w, const int len)
{
u32 w0[4];
@ -1019,51 +1036,61 @@ DECLSPEC void md4_hmac_init_global_swap (md4_hmac_ctx_t *ctx, __global const u32
md4_hmac_init_64 (ctx, w0, w1, w2, w3);
}
DECLSPEC void md4_hmac_update_64 (md4_hmac_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len);
DECLSPEC void md4_hmac_update_64 (md4_hmac_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len)
{
md4_update_64 (&ctx->ipad, w0, w1, w2, w3, len);
}
DECLSPEC void md4_hmac_update (md4_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void md4_hmac_update (md4_hmac_ctx_t *ctx, const u32 *w, const int len)
{
md4_update (&ctx->ipad, w, len);
}
DECLSPEC void md4_hmac_update_swap (md4_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void md4_hmac_update_swap (md4_hmac_ctx_t *ctx, const u32 *w, const int len)
{
md4_update_swap (&ctx->ipad, w, len);
}
DECLSPEC void md4_hmac_update_utf16le (md4_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void md4_hmac_update_utf16le (md4_hmac_ctx_t *ctx, const u32 *w, const int len)
{
md4_update_utf16le (&ctx->ipad, w, len);
}
DECLSPEC void md4_hmac_update_utf16le_swap (md4_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void md4_hmac_update_utf16le_swap (md4_hmac_ctx_t *ctx, const u32 *w, const int len)
{
md4_update_utf16le_swap (&ctx->ipad, w, len);
}
DECLSPEC void md4_hmac_update_global (md4_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void md4_hmac_update_global (md4_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
md4_update_global (&ctx->ipad, w, len);
}
DECLSPEC void md4_hmac_update_global_swap (md4_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void md4_hmac_update_global_swap (md4_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
md4_update_global_swap (&ctx->ipad, w, len);
}
DECLSPEC void md4_hmac_update_global_utf16le (md4_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void md4_hmac_update_global_utf16le (md4_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
md4_update_global_utf16le (&ctx->ipad, w, len);
}
DECLSPEC void md4_hmac_update_global_utf16le_swap (md4_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void md4_hmac_update_global_utf16le_swap (md4_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
md4_update_global_utf16le_swap (&ctx->ipad, w, len);
}
DECLSPEC void md4_hmac_final (md4_hmac_ctx_t *ctx);
DECLSPEC void md4_hmac_final (md4_hmac_ctx_t *ctx)
{
md4_final (&ctx->ipad);
@ -1110,6 +1137,7 @@ typedef struct md4_ctx_vector
} md4_ctx_vector_t;
DECLSPEC void md4_transform_vector (const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, u32x *digest);
DECLSPEC void md4_transform_vector (const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, u32x *digest)
{
u32x a = digest[0];
@ -1174,6 +1202,7 @@ DECLSPEC void md4_transform_vector (const u32x *w0, const u32x *w1, const u32x *
digest[3] += d;
}
DECLSPEC void md4_init_vector (md4_ctx_vector_t *ctx);
DECLSPEC void md4_init_vector (md4_ctx_vector_t *ctx)
{
ctx->h[0] = MD4M_A;
@ -1201,6 +1230,7 @@ DECLSPEC void md4_init_vector (md4_ctx_vector_t *ctx)
ctx->len = 0;
}
DECLSPEC void md4_init_vector_from_scalar (md4_ctx_vector_t *ctx, md4_ctx_t *ctx0);
DECLSPEC void md4_init_vector_from_scalar (md4_ctx_vector_t *ctx, md4_ctx_t *ctx0)
{
ctx->h[0] = ctx0->h[0];
@ -1228,6 +1258,7 @@ DECLSPEC void md4_init_vector_from_scalar (md4_ctx_vector_t *ctx, md4_ctx_t *ctx
ctx->len = ctx0->len;
}
DECLSPEC void md4_update_vector_64 (md4_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len);
DECLSPEC void md4_update_vector_64 (md4_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len)
{
const int pos = ctx->len & 63;
@ -1302,6 +1333,7 @@ DECLSPEC void md4_update_vector_64 (md4_ctx_vector_t *ctx, u32x *w0, u32x *w1, u
}
}
DECLSPEC void md4_update_vector (md4_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void md4_update_vector (md4_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -1354,6 +1386,7 @@ DECLSPEC void md4_update_vector (md4_ctx_vector_t *ctx, const u32x *w, const int
md4_update_vector_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void md4_update_vector_swap (md4_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void md4_update_vector_swap (md4_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -1440,6 +1473,7 @@ DECLSPEC void md4_update_vector_swap (md4_ctx_vector_t *ctx, const u32x *w, cons
md4_update_vector_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void md4_update_vector_utf16le (md4_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void md4_update_vector_utf16le (md4_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -1482,6 +1516,7 @@ DECLSPEC void md4_update_vector_utf16le (md4_ctx_vector_t *ctx, const u32x *w, c
md4_update_vector_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void md4_update_vector_utf16le_swap (md4_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void md4_update_vector_utf16le_swap (md4_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -1558,6 +1593,7 @@ DECLSPEC void md4_update_vector_utf16le_swap (md4_ctx_vector_t *ctx, const u32x
md4_update_vector_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void md4_final_vector (md4_ctx_vector_t *ctx);
DECLSPEC void md4_final_vector (md4_ctx_vector_t *ctx)
{
const int pos = ctx->len & 63;
@ -1601,6 +1637,7 @@ typedef struct md4_hmac_ctx_vector
} md4_hmac_ctx_vector_t;
DECLSPEC void md4_hmac_init_vector_64 (md4_hmac_ctx_vector_t *ctx, const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3);
DECLSPEC void md4_hmac_init_vector_64 (md4_hmac_ctx_vector_t *ctx, const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3)
{
u32x t0[4];
@ -1655,6 +1692,7 @@ DECLSPEC void md4_hmac_init_vector_64 (md4_hmac_ctx_vector_t *ctx, const u32x *w
md4_update_vector_64 (&ctx->opad, t0, t1, t2, t3, 64);
}
DECLSPEC void md4_hmac_init_vector (md4_hmac_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void md4_hmac_init_vector (md4_hmac_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -1712,16 +1750,19 @@ DECLSPEC void md4_hmac_init_vector (md4_hmac_ctx_vector_t *ctx, const u32x *w, c
md4_hmac_init_vector_64 (ctx, w0, w1, w2, w3);
}
DECLSPEC void md4_hmac_update_vector_64 (md4_hmac_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len);
DECLSPEC void md4_hmac_update_vector_64 (md4_hmac_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len)
{
md4_update_vector_64 (&ctx->ipad, w0, w1, w2, w3, len);
}
DECLSPEC void md4_hmac_update_vector (md4_hmac_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void md4_hmac_update_vector (md4_hmac_ctx_vector_t *ctx, const u32x *w, const int len)
{
md4_update_vector (&ctx->ipad, w, len);
}
DECLSPEC void md4_hmac_final_vector (md4_hmac_ctx_vector_t *ctx);
DECLSPEC void md4_hmac_final_vector (md4_hmac_ctx_vector_t *ctx)
{
md4_final_vector (&ctx->ipad);

@ -17,6 +17,7 @@ typedef struct md5_ctx
} md5_ctx_t;
DECLSPEC void md5_transform (const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, u32 *digest);
DECLSPEC void md5_transform (const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, u32 *digest)
{
u32 a = digest[0];
@ -117,6 +118,7 @@ DECLSPEC void md5_transform (const u32 *w0, const u32 *w1, const u32 *w2, const
digest[3] += d;
}
DECLSPEC void md5_init (md5_ctx_t *ctx);
DECLSPEC void md5_init (md5_ctx_t *ctx)
{
ctx->h[0] = MD5M_A;
@ -144,6 +146,7 @@ DECLSPEC void md5_init (md5_ctx_t *ctx)
ctx->len = 0;
}
DECLSPEC void md5_update_64 (md5_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len);
DECLSPEC void md5_update_64 (md5_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len)
{
const int pos = ctx->len & 63;
@ -218,6 +221,7 @@ DECLSPEC void md5_update_64 (md5_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3,
}
}
DECLSPEC void md5_update (md5_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void md5_update (md5_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -270,6 +274,7 @@ DECLSPEC void md5_update (md5_ctx_t *ctx, const u32 *w, const int len)
md5_update_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void md5_update_swap (md5_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void md5_update_swap (md5_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -356,6 +361,7 @@ DECLSPEC void md5_update_swap (md5_ctx_t *ctx, const u32 *w, const int len)
md5_update_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void md5_update_utf16le (md5_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void md5_update_utf16le (md5_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -398,6 +404,7 @@ DECLSPEC void md5_update_utf16le (md5_ctx_t *ctx, const u32 *w, const int len)
md5_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void md5_update_utf16le_swap (md5_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void md5_update_utf16le_swap (md5_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -474,6 +481,7 @@ DECLSPEC void md5_update_utf16le_swap (md5_ctx_t *ctx, const u32 *w, const int l
md5_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void md5_update_global (md5_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void md5_update_global (md5_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -526,6 +534,7 @@ DECLSPEC void md5_update_global (md5_ctx_t *ctx, const __global u32 *w, const in
md5_update_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void md5_update_global_swap (md5_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void md5_update_global_swap (md5_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -612,6 +621,7 @@ DECLSPEC void md5_update_global_swap (md5_ctx_t *ctx, const __global u32 *w, con
md5_update_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void md5_update_global_utf16le (md5_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void md5_update_global_utf16le (md5_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -654,6 +664,7 @@ DECLSPEC void md5_update_global_utf16le (md5_ctx_t *ctx, const __global u32 *w,
md5_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void md5_update_global_utf16le_swap (md5_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void md5_update_global_utf16le_swap (md5_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -730,6 +741,7 @@ DECLSPEC void md5_update_global_utf16le_swap (md5_ctx_t *ctx, const __global u32
md5_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void md5_final (md5_ctx_t *ctx);
DECLSPEC void md5_final (md5_ctx_t *ctx)
{
const int pos = ctx->len & 63;
@ -773,6 +785,7 @@ typedef struct md5_hmac_ctx
} md5_hmac_ctx_t;
DECLSPEC void md5_hmac_init_64 (md5_hmac_ctx_t *ctx, const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3);
DECLSPEC void md5_hmac_init_64 (md5_hmac_ctx_t *ctx, const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3)
{
u32 t0[4];
@ -827,6 +840,7 @@ DECLSPEC void md5_hmac_init_64 (md5_hmac_ctx_t *ctx, const u32 *w0, const u32 *w
md5_update_64 (&ctx->opad, t0, t1, t2, t3, 64);
}
DECLSPEC void md5_hmac_init (md5_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void md5_hmac_init (md5_hmac_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -884,6 +898,7 @@ DECLSPEC void md5_hmac_init (md5_hmac_ctx_t *ctx, const u32 *w, const int len)
md5_hmac_init_64 (ctx, w0, w1, w2, w3);
}
DECLSPEC void md5_hmac_init_swap (md5_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void md5_hmac_init_swap (md5_hmac_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -941,6 +956,7 @@ DECLSPEC void md5_hmac_init_swap (md5_hmac_ctx_t *ctx, const u32 *w, const int l
md5_hmac_init_64 (ctx, w0, w1, w2, w3);
}
DECLSPEC void md5_hmac_init_global (md5_hmac_ctx_t *ctx, __global const u32 *w, const int len);
DECLSPEC void md5_hmac_init_global (md5_hmac_ctx_t *ctx, __global const u32 *w, const int len)
{
u32 w0[4];
@ -998,6 +1014,7 @@ DECLSPEC void md5_hmac_init_global (md5_hmac_ctx_t *ctx, __global const u32 *w,
md5_hmac_init_64 (ctx, w0, w1, w2, w3);
}
DECLSPEC void md5_hmac_init_global_swap (md5_hmac_ctx_t *ctx, __global const u32 *w, const int len);
DECLSPEC void md5_hmac_init_global_swap (md5_hmac_ctx_t *ctx, __global const u32 *w, const int len)
{
u32 w0[4];
@ -1055,51 +1072,61 @@ DECLSPEC void md5_hmac_init_global_swap (md5_hmac_ctx_t *ctx, __global const u32
md5_hmac_init_64 (ctx, w0, w1, w2, w3);
}
DECLSPEC void md5_hmac_update_64 (md5_hmac_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len);
DECLSPEC void md5_hmac_update_64 (md5_hmac_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len)
{
md5_update_64 (&ctx->ipad, w0, w1, w2, w3, len);
}
DECLSPEC void md5_hmac_update (md5_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void md5_hmac_update (md5_hmac_ctx_t *ctx, const u32 *w, const int len)
{
md5_update (&ctx->ipad, w, len);
}
DECLSPEC void md5_hmac_update_swap (md5_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void md5_hmac_update_swap (md5_hmac_ctx_t *ctx, const u32 *w, const int len)
{
md5_update_swap (&ctx->ipad, w, len);
}
DECLSPEC void md5_hmac_update_utf16le (md5_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void md5_hmac_update_utf16le (md5_hmac_ctx_t *ctx, const u32 *w, const int len)
{
md5_update_utf16le (&ctx->ipad, w, len);
}
DECLSPEC void md5_hmac_update_utf16le_swap (md5_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void md5_hmac_update_utf16le_swap (md5_hmac_ctx_t *ctx, const u32 *w, const int len)
{
md5_update_utf16le_swap (&ctx->ipad, w, len);
}
DECLSPEC void md5_hmac_update_global (md5_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void md5_hmac_update_global (md5_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
md5_update_global (&ctx->ipad, w, len);
}
DECLSPEC void md5_hmac_update_global_swap (md5_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void md5_hmac_update_global_swap (md5_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
md5_update_global_swap (&ctx->ipad, w, len);
}
DECLSPEC void md5_hmac_update_global_utf16le (md5_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void md5_hmac_update_global_utf16le (md5_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
md5_update_global_utf16le (&ctx->ipad, w, len);
}
DECLSPEC void md5_hmac_update_global_utf16le_swap (md5_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void md5_hmac_update_global_utf16le_swap (md5_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
md5_update_global_utf16le_swap (&ctx->ipad, w, len);
}
DECLSPEC void md5_hmac_final (md5_hmac_ctx_t *ctx);
DECLSPEC void md5_hmac_final (md5_hmac_ctx_t *ctx)
{
md5_final (&ctx->ipad);
@ -1146,6 +1173,7 @@ typedef struct md5_ctx_vector
} md5_ctx_vector_t;
DECLSPEC void md5_transform_vector (const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, u32x *digest);
DECLSPEC void md5_transform_vector (const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, u32x *digest)
{
u32x a = digest[0];
@ -1246,6 +1274,7 @@ DECLSPEC void md5_transform_vector (const u32x *w0, const u32x *w1, const u32x *
digest[3] += d;
}
DECLSPEC void md5_init_vector (md5_ctx_vector_t *ctx);
DECLSPEC void md5_init_vector (md5_ctx_vector_t *ctx)
{
ctx->h[0] = MD5M_A;
@ -1273,6 +1302,7 @@ DECLSPEC void md5_init_vector (md5_ctx_vector_t *ctx)
ctx->len = 0;
}
DECLSPEC void md5_init_vector_from_scalar (md5_ctx_vector_t *ctx, md5_ctx_t *ctx0);
DECLSPEC void md5_init_vector_from_scalar (md5_ctx_vector_t *ctx, md5_ctx_t *ctx0)
{
ctx->h[0] = ctx0->h[0];
@ -1300,6 +1330,7 @@ DECLSPEC void md5_init_vector_from_scalar (md5_ctx_vector_t *ctx, md5_ctx_t *ctx
ctx->len = ctx0->len;
}
DECLSPEC void md5_update_vector_64 (md5_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len);
DECLSPEC void md5_update_vector_64 (md5_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len)
{
const int pos = ctx->len & 63;
@ -1374,6 +1405,7 @@ DECLSPEC void md5_update_vector_64 (md5_ctx_vector_t *ctx, u32x *w0, u32x *w1, u
}
}
DECLSPEC void md5_update_vector (md5_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void md5_update_vector (md5_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -1426,6 +1458,7 @@ DECLSPEC void md5_update_vector (md5_ctx_vector_t *ctx, const u32x *w, const int
md5_update_vector_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void md5_update_vector_swap (md5_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void md5_update_vector_swap (md5_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -1512,6 +1545,7 @@ DECLSPEC void md5_update_vector_swap (md5_ctx_vector_t *ctx, const u32x *w, cons
md5_update_vector_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void md5_update_vector_utf16le (md5_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void md5_update_vector_utf16le (md5_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -1554,6 +1588,7 @@ DECLSPEC void md5_update_vector_utf16le (md5_ctx_vector_t *ctx, const u32x *w, c
md5_update_vector_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void md5_update_vector_utf16le_swap (md5_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void md5_update_vector_utf16le_swap (md5_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -1630,6 +1665,7 @@ DECLSPEC void md5_update_vector_utf16le_swap (md5_ctx_vector_t *ctx, const u32x
md5_update_vector_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void md5_final_vector (md5_ctx_vector_t *ctx);
DECLSPEC void md5_final_vector (md5_ctx_vector_t *ctx)
{
const int pos = ctx->len & 63;
@ -1673,6 +1709,7 @@ typedef struct md5_hmac_ctx_vector
} md5_hmac_ctx_vector_t;
DECLSPEC void md5_hmac_init_vector_64 (md5_hmac_ctx_vector_t *ctx, const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3);
DECLSPEC void md5_hmac_init_vector_64 (md5_hmac_ctx_vector_t *ctx, const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3)
{
u32x t0[4];
@ -1727,6 +1764,7 @@ DECLSPEC void md5_hmac_init_vector_64 (md5_hmac_ctx_vector_t *ctx, const u32x *w
md5_update_vector_64 (&ctx->opad, t0, t1, t2, t3, 64);
}
DECLSPEC void md5_hmac_init_vector (md5_hmac_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void md5_hmac_init_vector (md5_hmac_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -1784,16 +1822,19 @@ DECLSPEC void md5_hmac_init_vector (md5_hmac_ctx_vector_t *ctx, const u32x *w, c
md5_hmac_init_vector_64 (ctx, w0, w1, w2, w3);
}
DECLSPEC void md5_hmac_update_vector_64 (md5_hmac_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len);
DECLSPEC void md5_hmac_update_vector_64 (md5_hmac_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len)
{
md5_update_vector_64 (&ctx->ipad, w0, w1, w2, w3, len);
}
DECLSPEC void md5_hmac_update_vector (md5_hmac_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void md5_hmac_update_vector (md5_hmac_ctx_vector_t *ctx, const u32x *w, const int len)
{
md5_update_vector (&ctx->ipad, w, len);
}
DECLSPEC void md5_hmac_final_vector (md5_hmac_ctx_vector_t *ctx);
DECLSPEC void md5_hmac_final_vector (md5_hmac_ctx_vector_t *ctx)
{
md5_final_vector (&ctx->ipad);

@ -17,6 +17,7 @@ typedef struct ripemd160_ctx
} ripemd160_ctx_t;
DECLSPEC void ripemd160_transform (const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, u32 *digest);
DECLSPEC void ripemd160_transform (const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, u32 *digest)
{
u32 a1 = digest[0];
@ -214,6 +215,7 @@ DECLSPEC void ripemd160_transform (const u32 *w0, const u32 *w1, const u32 *w2,
digest[4] = e;
}
DECLSPEC void ripemd160_init (ripemd160_ctx_t *ctx);
DECLSPEC void ripemd160_init (ripemd160_ctx_t *ctx)
{
ctx->h[0] = RIPEMD160M_A;
@ -242,6 +244,7 @@ DECLSPEC void ripemd160_init (ripemd160_ctx_t *ctx)
ctx->len = 0;
}
DECLSPEC void ripemd160_update_64 (ripemd160_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len);
DECLSPEC void ripemd160_update_64 (ripemd160_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len)
{
const int pos = ctx->len & 63;
@ -316,6 +319,7 @@ DECLSPEC void ripemd160_update_64 (ripemd160_ctx_t *ctx, u32 *w0, u32 *w1, u32 *
}
}
DECLSPEC void ripemd160_update (ripemd160_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void ripemd160_update (ripemd160_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -368,6 +372,7 @@ DECLSPEC void ripemd160_update (ripemd160_ctx_t *ctx, const u32 *w, const int le
ripemd160_update_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void ripemd160_update_swap (ripemd160_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void ripemd160_update_swap (ripemd160_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -454,6 +459,7 @@ DECLSPEC void ripemd160_update_swap (ripemd160_ctx_t *ctx, const u32 *w, const i
ripemd160_update_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void ripemd160_update_utf16le (ripemd160_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void ripemd160_update_utf16le (ripemd160_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -496,6 +502,7 @@ DECLSPEC void ripemd160_update_utf16le (ripemd160_ctx_t *ctx, const u32 *w, cons
ripemd160_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void ripemd160_update_utf16le_swap (ripemd160_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void ripemd160_update_utf16le_swap (ripemd160_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -572,6 +579,7 @@ DECLSPEC void ripemd160_update_utf16le_swap (ripemd160_ctx_t *ctx, const u32 *w,
ripemd160_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void ripemd160_update_global (ripemd160_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void ripemd160_update_global (ripemd160_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -624,6 +632,7 @@ DECLSPEC void ripemd160_update_global (ripemd160_ctx_t *ctx, const __global u32
ripemd160_update_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void ripemd160_update_global_swap (ripemd160_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void ripemd160_update_global_swap (ripemd160_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -710,6 +719,7 @@ DECLSPEC void ripemd160_update_global_swap (ripemd160_ctx_t *ctx, const __global
ripemd160_update_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void ripemd160_update_global_utf16le (ripemd160_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void ripemd160_update_global_utf16le (ripemd160_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -752,6 +762,7 @@ DECLSPEC void ripemd160_update_global_utf16le (ripemd160_ctx_t *ctx, const __glo
ripemd160_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void ripemd160_update_global_utf16le_swap (ripemd160_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void ripemd160_update_global_utf16le_swap (ripemd160_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -828,6 +839,7 @@ DECLSPEC void ripemd160_update_global_utf16le_swap (ripemd160_ctx_t *ctx, const
ripemd160_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void ripemd160_final (ripemd160_ctx_t *ctx);
DECLSPEC void ripemd160_final (ripemd160_ctx_t *ctx)
{
const int pos = ctx->len & 63;
@ -871,6 +883,7 @@ typedef struct ripemd160_hmac_ctx
} ripemd160_hmac_ctx_t;
DECLSPEC void ripemd160_hmac_init_64 (ripemd160_hmac_ctx_t *ctx, const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3);
DECLSPEC void ripemd160_hmac_init_64 (ripemd160_hmac_ctx_t *ctx, const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3)
{
u32 t0[4];
@ -925,6 +938,7 @@ DECLSPEC void ripemd160_hmac_init_64 (ripemd160_hmac_ctx_t *ctx, const u32 *w0,
ripemd160_update_64 (&ctx->opad, t0, t1, t2, t3, 64);
}
DECLSPEC void ripemd160_hmac_init (ripemd160_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void ripemd160_hmac_init (ripemd160_hmac_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -982,6 +996,7 @@ DECLSPEC void ripemd160_hmac_init (ripemd160_hmac_ctx_t *ctx, const u32 *w, cons
ripemd160_hmac_init_64 (ctx, w0, w1, w2, w3);
}
DECLSPEC void ripemd160_hmac_init_swap (ripemd160_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void ripemd160_hmac_init_swap (ripemd160_hmac_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -1039,6 +1054,7 @@ DECLSPEC void ripemd160_hmac_init_swap (ripemd160_hmac_ctx_t *ctx, const u32 *w,
ripemd160_hmac_init_64 (ctx, w0, w1, w2, w3);
}
DECLSPEC void ripemd160_hmac_init_global (ripemd160_hmac_ctx_t *ctx, __global const u32 *w, const int len);
DECLSPEC void ripemd160_hmac_init_global (ripemd160_hmac_ctx_t *ctx, __global const u32 *w, const int len)
{
u32 w0[4];
@ -1096,6 +1112,7 @@ DECLSPEC void ripemd160_hmac_init_global (ripemd160_hmac_ctx_t *ctx, __global co
ripemd160_hmac_init_64 (ctx, w0, w1, w2, w3);
}
DECLSPEC void ripemd160_hmac_init_global_swap (ripemd160_hmac_ctx_t *ctx, __global const u32 *w, const int len);
DECLSPEC void ripemd160_hmac_init_global_swap (ripemd160_hmac_ctx_t *ctx, __global const u32 *w, const int len)
{
u32 w0[4];
@ -1153,51 +1170,61 @@ DECLSPEC void ripemd160_hmac_init_global_swap (ripemd160_hmac_ctx_t *ctx, __glob
ripemd160_hmac_init_64 (ctx, w0, w1, w2, w3);
}
DECLSPEC void ripemd160_hmac_update_64 (ripemd160_hmac_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len);
DECLSPEC void ripemd160_hmac_update_64 (ripemd160_hmac_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len)
{
ripemd160_update_64 (&ctx->ipad, w0, w1, w2, w3, len);
}
DECLSPEC void ripemd160_hmac_update (ripemd160_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void ripemd160_hmac_update (ripemd160_hmac_ctx_t *ctx, const u32 *w, const int len)
{
ripemd160_update (&ctx->ipad, w, len);
}
DECLSPEC void ripemd160_hmac_update_swap (ripemd160_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void ripemd160_hmac_update_swap (ripemd160_hmac_ctx_t *ctx, const u32 *w, const int len)
{
ripemd160_update_swap (&ctx->ipad, w, len);
}
DECLSPEC void ripemd160_hmac_update_utf16le (ripemd160_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void ripemd160_hmac_update_utf16le (ripemd160_hmac_ctx_t *ctx, const u32 *w, const int len)
{
ripemd160_update_utf16le (&ctx->ipad, w, len);
}
DECLSPEC void ripemd160_hmac_update_utf16le_swap (ripemd160_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void ripemd160_hmac_update_utf16le_swap (ripemd160_hmac_ctx_t *ctx, const u32 *w, const int len)
{
ripemd160_update_utf16le_swap (&ctx->ipad, w, len);
}
DECLSPEC void ripemd160_hmac_update_global (ripemd160_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void ripemd160_hmac_update_global (ripemd160_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
ripemd160_update_global (&ctx->ipad, w, len);
}
DECLSPEC void ripemd160_hmac_update_global_swap (ripemd160_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void ripemd160_hmac_update_global_swap (ripemd160_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
ripemd160_update_global_swap (&ctx->ipad, w, len);
}
DECLSPEC void ripemd160_hmac_update_global_utf16le (ripemd160_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void ripemd160_hmac_update_global_utf16le (ripemd160_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
ripemd160_update_global_utf16le (&ctx->ipad, w, len);
}
DECLSPEC void ripemd160_hmac_update_global_utf16le_swap (ripemd160_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void ripemd160_hmac_update_global_utf16le_swap (ripemd160_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
ripemd160_update_global_utf16le_swap (&ctx->ipad, w, len);
}
DECLSPEC void ripemd160_hmac_final (ripemd160_hmac_ctx_t *ctx);
DECLSPEC void ripemd160_hmac_final (ripemd160_hmac_ctx_t *ctx)
{
ripemd160_final (&ctx->ipad);
@ -1244,6 +1271,7 @@ typedef struct ripemd160_ctx_vector
} ripemd160_ctx_vector_t;
DECLSPEC void ripemd160_transform_vector (const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, u32x *digest);
DECLSPEC void ripemd160_transform_vector (const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, u32x *digest)
{
u32x a1 = digest[0];
@ -1441,6 +1469,7 @@ DECLSPEC void ripemd160_transform_vector (const u32x *w0, const u32x *w1, const
digest[4] = e;
}
DECLSPEC void ripemd160_init_vector (ripemd160_ctx_vector_t *ctx);
DECLSPEC void ripemd160_init_vector (ripemd160_ctx_vector_t *ctx)
{
ctx->h[0] = RIPEMD160M_A;
@ -1469,6 +1498,7 @@ DECLSPEC void ripemd160_init_vector (ripemd160_ctx_vector_t *ctx)
ctx->len = 0;
}
DECLSPEC void ripemd160_init_vector_from_scalar (ripemd160_ctx_vector_t *ctx, ripemd160_ctx_t *ctx0);
DECLSPEC void ripemd160_init_vector_from_scalar (ripemd160_ctx_vector_t *ctx, ripemd160_ctx_t *ctx0)
{
ctx->h[0] = ctx0->h[0];
@ -1497,6 +1527,7 @@ DECLSPEC void ripemd160_init_vector_from_scalar (ripemd160_ctx_vector_t *ctx, ri
ctx->len = ctx0->len;
}
DECLSPEC void ripemd160_update_vector_64 (ripemd160_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len);
DECLSPEC void ripemd160_update_vector_64 (ripemd160_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len)
{
const int pos = ctx->len & 63;
@ -1571,6 +1602,7 @@ DECLSPEC void ripemd160_update_vector_64 (ripemd160_ctx_vector_t *ctx, u32x *w0,
}
}
DECLSPEC void ripemd160_update_vector (ripemd160_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void ripemd160_update_vector (ripemd160_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -1623,6 +1655,7 @@ DECLSPEC void ripemd160_update_vector (ripemd160_ctx_vector_t *ctx, const u32x *
ripemd160_update_vector_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void ripemd160_update_vector_swap (ripemd160_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void ripemd160_update_vector_swap (ripemd160_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -1709,6 +1742,7 @@ DECLSPEC void ripemd160_update_vector_swap (ripemd160_ctx_vector_t *ctx, const u
ripemd160_update_vector_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void ripemd160_update_vector_utf16le (ripemd160_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void ripemd160_update_vector_utf16le (ripemd160_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -1751,6 +1785,7 @@ DECLSPEC void ripemd160_update_vector_utf16le (ripemd160_ctx_vector_t *ctx, cons
ripemd160_update_vector_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void ripemd160_update_vector_utf16le_swap (ripemd160_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void ripemd160_update_vector_utf16le_swap (ripemd160_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -1827,6 +1862,7 @@ DECLSPEC void ripemd160_update_vector_utf16le_swap (ripemd160_ctx_vector_t *ctx,
ripemd160_update_vector_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void ripemd160_final_vector (ripemd160_ctx_vector_t *ctx);
DECLSPEC void ripemd160_final_vector (ripemd160_ctx_vector_t *ctx)
{
const int pos = ctx->len & 63;
@ -1870,6 +1906,7 @@ typedef struct ripemd160_hmac_ctx_vector
} ripemd160_hmac_ctx_vector_t;
DECLSPEC void ripemd160_hmac_init_vector_64 (ripemd160_hmac_ctx_vector_t *ctx, const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3);
DECLSPEC void ripemd160_hmac_init_vector_64 (ripemd160_hmac_ctx_vector_t *ctx, const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3)
{
u32x t0[4];
@ -1924,6 +1961,7 @@ DECLSPEC void ripemd160_hmac_init_vector_64 (ripemd160_hmac_ctx_vector_t *ctx, c
ripemd160_update_vector_64 (&ctx->opad, t0, t1, t2, t3, 64);
}
DECLSPEC void ripemd160_hmac_init_vector (ripemd160_hmac_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void ripemd160_hmac_init_vector (ripemd160_hmac_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -1981,16 +2019,19 @@ DECLSPEC void ripemd160_hmac_init_vector (ripemd160_hmac_ctx_vector_t *ctx, cons
ripemd160_hmac_init_vector_64 (ctx, w0, w1, w2, w3);
}
DECLSPEC void ripemd160_hmac_update_vector_64 (ripemd160_hmac_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len);
DECLSPEC void ripemd160_hmac_update_vector_64 (ripemd160_hmac_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len)
{
ripemd160_update_vector_64 (&ctx->ipad, w0, w1, w2, w3, len);
}
DECLSPEC void ripemd160_hmac_update_vector (ripemd160_hmac_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void ripemd160_hmac_update_vector (ripemd160_hmac_ctx_vector_t *ctx, const u32x *w, const int len)
{
ripemd160_update_vector (&ctx->ipad, w, len);
}
DECLSPEC void ripemd160_hmac_final_vector (ripemd160_hmac_ctx_vector_t *ctx);
DECLSPEC void ripemd160_hmac_final_vector (ripemd160_hmac_ctx_vector_t *ctx)
{
ripemd160_final_vector (&ctx->ipad);

@ -17,6 +17,7 @@ typedef struct sha1_ctx
} sha1_ctx_t;
DECLSPEC void sha1_transform (const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, u32 *digest);
DECLSPEC void sha1_transform (const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, u32 *digest)
{
u32 a = digest[0];
@ -146,6 +147,7 @@ DECLSPEC void sha1_transform (const u32 *w0, const u32 *w1, const u32 *w2, const
digest[4] += e;
}
DECLSPEC void sha1_init (sha1_ctx_t *ctx);
DECLSPEC void sha1_init (sha1_ctx_t *ctx)
{
ctx->h[0] = SHA1M_A;
@ -174,6 +176,7 @@ DECLSPEC void sha1_init (sha1_ctx_t *ctx)
ctx->len = 0;
}
DECLSPEC void sha1_update_64 (sha1_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len);
DECLSPEC void sha1_update_64 (sha1_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len)
{
const int pos = ctx->len & 63;
@ -248,6 +251,7 @@ DECLSPEC void sha1_update_64 (sha1_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w
}
}
DECLSPEC void sha1_update (sha1_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha1_update (sha1_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -300,6 +304,7 @@ DECLSPEC void sha1_update (sha1_ctx_t *ctx, const u32 *w, const int len)
sha1_update_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void sha1_update_swap (sha1_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha1_update_swap (sha1_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -386,6 +391,7 @@ DECLSPEC void sha1_update_swap (sha1_ctx_t *ctx, const u32 *w, const int len)
sha1_update_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void sha1_update_utf16le (sha1_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha1_update_utf16le (sha1_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -428,6 +434,7 @@ DECLSPEC void sha1_update_utf16le (sha1_ctx_t *ctx, const u32 *w, const int len)
sha1_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void sha1_update_utf16le_swap (sha1_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha1_update_utf16le_swap (sha1_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -504,6 +511,7 @@ DECLSPEC void sha1_update_utf16le_swap (sha1_ctx_t *ctx, const u32 *w, const int
sha1_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void sha1_update_utf16be (sha1_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha1_update_utf16be (sha1_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -546,6 +554,7 @@ DECLSPEC void sha1_update_utf16be (sha1_ctx_t *ctx, const u32 *w, const int len)
sha1_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void sha1_update_utf16be_swap (sha1_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha1_update_utf16be_swap (sha1_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -622,6 +631,7 @@ DECLSPEC void sha1_update_utf16be_swap (sha1_ctx_t *ctx, const u32 *w, const int
sha1_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void sha1_update_global (sha1_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha1_update_global (sha1_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -674,6 +684,7 @@ DECLSPEC void sha1_update_global (sha1_ctx_t *ctx, const __global u32 *w, const
sha1_update_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void sha1_update_global_swap (sha1_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha1_update_global_swap (sha1_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -760,6 +771,7 @@ DECLSPEC void sha1_update_global_swap (sha1_ctx_t *ctx, const __global u32 *w, c
sha1_update_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void sha1_update_global_utf16le (sha1_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha1_update_global_utf16le (sha1_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -802,6 +814,7 @@ DECLSPEC void sha1_update_global_utf16le (sha1_ctx_t *ctx, const __global u32 *w
sha1_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void sha1_update_global_utf16le_swap (sha1_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha1_update_global_utf16le_swap (sha1_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -878,6 +891,7 @@ DECLSPEC void sha1_update_global_utf16le_swap (sha1_ctx_t *ctx, const __global u
sha1_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void sha1_update_global_utf16be (sha1_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha1_update_global_utf16be (sha1_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -920,6 +934,7 @@ DECLSPEC void sha1_update_global_utf16be (sha1_ctx_t *ctx, const __global u32 *w
sha1_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void sha1_update_global_utf16be_swap (sha1_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha1_update_global_utf16be_swap (sha1_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -996,6 +1011,7 @@ DECLSPEC void sha1_update_global_utf16be_swap (sha1_ctx_t *ctx, const __global u
sha1_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void sha1_final (sha1_ctx_t *ctx);
DECLSPEC void sha1_final (sha1_ctx_t *ctx)
{
const int pos = ctx->len & 63;
@ -1039,6 +1055,7 @@ typedef struct sha1_hmac_ctx
} sha1_hmac_ctx_t;
DECLSPEC void sha1_hmac_init_64 (sha1_hmac_ctx_t *ctx, const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3);
DECLSPEC void sha1_hmac_init_64 (sha1_hmac_ctx_t *ctx, const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3)
{
u32 t0[4];
@ -1093,6 +1110,7 @@ DECLSPEC void sha1_hmac_init_64 (sha1_hmac_ctx_t *ctx, const u32 *w0, const u32
sha1_update_64 (&ctx->opad, t0, t1, t2, t3, 64);
}
DECLSPEC void sha1_hmac_init (sha1_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha1_hmac_init (sha1_hmac_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -1150,6 +1168,7 @@ DECLSPEC void sha1_hmac_init (sha1_hmac_ctx_t *ctx, const u32 *w, const int len)
sha1_hmac_init_64 (ctx, w0, w1, w2, w3);
}
DECLSPEC void sha1_hmac_init_swap (sha1_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha1_hmac_init_swap (sha1_hmac_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -1207,6 +1226,7 @@ DECLSPEC void sha1_hmac_init_swap (sha1_hmac_ctx_t *ctx, const u32 *w, const int
sha1_hmac_init_64 (ctx, w0, w1, w2, w3);
}
DECLSPEC void sha1_hmac_init_global (sha1_hmac_ctx_t *ctx, __global const u32 *w, const int len);
DECLSPEC void sha1_hmac_init_global (sha1_hmac_ctx_t *ctx, __global const u32 *w, const int len)
{
u32 w0[4];
@ -1264,6 +1284,7 @@ DECLSPEC void sha1_hmac_init_global (sha1_hmac_ctx_t *ctx, __global const u32 *w
sha1_hmac_init_64 (ctx, w0, w1, w2, w3);
}
DECLSPEC void sha1_hmac_init_global_swap (sha1_hmac_ctx_t *ctx, __global const u32 *w, const int len);
DECLSPEC void sha1_hmac_init_global_swap (sha1_hmac_ctx_t *ctx, __global const u32 *w, const int len)
{
u32 w0[4];
@ -1321,51 +1342,61 @@ DECLSPEC void sha1_hmac_init_global_swap (sha1_hmac_ctx_t *ctx, __global const u
sha1_hmac_init_64 (ctx, w0, w1, w2, w3);
}
DECLSPEC void sha1_hmac_update_64 (sha1_hmac_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len);
DECLSPEC void sha1_hmac_update_64 (sha1_hmac_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len)
{
sha1_update_64 (&ctx->ipad, w0, w1, w2, w3, len);
}
DECLSPEC void sha1_hmac_update (sha1_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha1_hmac_update (sha1_hmac_ctx_t *ctx, const u32 *w, const int len)
{
sha1_update (&ctx->ipad, w, len);
}
DECLSPEC void sha1_hmac_update_swap (sha1_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha1_hmac_update_swap (sha1_hmac_ctx_t *ctx, const u32 *w, const int len)
{
sha1_update_swap (&ctx->ipad, w, len);
}
DECLSPEC void sha1_hmac_update_utf16le (sha1_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha1_hmac_update_utf16le (sha1_hmac_ctx_t *ctx, const u32 *w, const int len)
{
sha1_update_utf16le (&ctx->ipad, w, len);
}
DECLSPEC void sha1_hmac_update_utf16le_swap (sha1_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha1_hmac_update_utf16le_swap (sha1_hmac_ctx_t *ctx, const u32 *w, const int len)
{
sha1_update_utf16le_swap (&ctx->ipad, w, len);
}
DECLSPEC void sha1_hmac_update_global (sha1_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha1_hmac_update_global (sha1_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
sha1_update_global (&ctx->ipad, w, len);
}
DECLSPEC void sha1_hmac_update_global_swap (sha1_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha1_hmac_update_global_swap (sha1_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
sha1_update_global_swap (&ctx->ipad, w, len);
}
DECLSPEC void sha1_hmac_update_global_utf16le (sha1_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha1_hmac_update_global_utf16le (sha1_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
sha1_update_global_utf16le (&ctx->ipad, w, len);
}
DECLSPEC void sha1_hmac_update_global_utf16le_swap (sha1_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha1_hmac_update_global_utf16le_swap (sha1_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
sha1_update_global_utf16le_swap (&ctx->ipad, w, len);
}
DECLSPEC void sha1_hmac_final (sha1_hmac_ctx_t *ctx);
DECLSPEC void sha1_hmac_final (sha1_hmac_ctx_t *ctx)
{
sha1_final (&ctx->ipad);
@ -1412,6 +1443,7 @@ typedef struct sha1_ctx_vector
} sha1_ctx_vector_t;
DECLSPEC void sha1_transform_vector (const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, u32x *digest);
DECLSPEC void sha1_transform_vector (const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, u32x *digest)
{
u32x a = digest[0];
@ -1541,6 +1573,7 @@ DECLSPEC void sha1_transform_vector (const u32x *w0, const u32x *w1, const u32x
digest[4] += e;
}
DECLSPEC void sha1_init_vector (sha1_ctx_vector_t *ctx);
DECLSPEC void sha1_init_vector (sha1_ctx_vector_t *ctx)
{
ctx->h[0] = SHA1M_A;
@ -1569,6 +1602,7 @@ DECLSPEC void sha1_init_vector (sha1_ctx_vector_t *ctx)
ctx->len = 0;
}
DECLSPEC void sha1_init_vector_from_scalar (sha1_ctx_vector_t *ctx, sha1_ctx_t *ctx0);
DECLSPEC void sha1_init_vector_from_scalar (sha1_ctx_vector_t *ctx, sha1_ctx_t *ctx0)
{
ctx->h[0] = ctx0->h[0];
@ -1597,6 +1631,7 @@ DECLSPEC void sha1_init_vector_from_scalar (sha1_ctx_vector_t *ctx, sha1_ctx_t *
ctx->len = ctx0->len;
}
DECLSPEC void sha1_update_vector_64 (sha1_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len);
DECLSPEC void sha1_update_vector_64 (sha1_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len)
{
const int pos = ctx->len & 63;
@ -1671,6 +1706,7 @@ DECLSPEC void sha1_update_vector_64 (sha1_ctx_vector_t *ctx, u32x *w0, u32x *w1,
}
}
DECLSPEC void sha1_update_vector (sha1_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha1_update_vector (sha1_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -1723,6 +1759,7 @@ DECLSPEC void sha1_update_vector (sha1_ctx_vector_t *ctx, const u32x *w, const i
sha1_update_vector_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void sha1_update_vector_swap (sha1_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha1_update_vector_swap (sha1_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -1809,6 +1846,7 @@ DECLSPEC void sha1_update_vector_swap (sha1_ctx_vector_t *ctx, const u32x *w, co
sha1_update_vector_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void sha1_update_vector_utf16le (sha1_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha1_update_vector_utf16le (sha1_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -1851,6 +1889,7 @@ DECLSPEC void sha1_update_vector_utf16le (sha1_ctx_vector_t *ctx, const u32x *w,
sha1_update_vector_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void sha1_update_vector_utf16le_swap (sha1_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha1_update_vector_utf16le_swap (sha1_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -1927,6 +1966,7 @@ DECLSPEC void sha1_update_vector_utf16le_swap (sha1_ctx_vector_t *ctx, const u32
sha1_update_vector_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void sha1_update_vector_utf16leN (sha1_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha1_update_vector_utf16leN (sha1_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -1969,6 +2009,7 @@ DECLSPEC void sha1_update_vector_utf16leN (sha1_ctx_vector_t *ctx, const u32x *w
sha1_update_vector_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void sha1_update_vector_utf16beN (sha1_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha1_update_vector_utf16beN (sha1_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -2011,6 +2052,7 @@ DECLSPEC void sha1_update_vector_utf16beN (sha1_ctx_vector_t *ctx, const u32x *w
sha1_update_vector_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void sha1_final_vector (sha1_ctx_vector_t *ctx);
DECLSPEC void sha1_final_vector (sha1_ctx_vector_t *ctx)
{
const int pos = ctx->len & 63;
@ -2054,6 +2096,7 @@ typedef struct sha1_hmac_ctx_vector
} sha1_hmac_ctx_vector_t;
DECLSPEC void sha1_hmac_init_vector_64 (sha1_hmac_ctx_vector_t *ctx, const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3);
DECLSPEC void sha1_hmac_init_vector_64 (sha1_hmac_ctx_vector_t *ctx, const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3)
{
u32x t0[4];
@ -2108,6 +2151,7 @@ DECLSPEC void sha1_hmac_init_vector_64 (sha1_hmac_ctx_vector_t *ctx, const u32x
sha1_update_vector_64 (&ctx->opad, t0, t1, t2, t3, 64);
}
DECLSPEC void sha1_hmac_init_vector (sha1_hmac_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha1_hmac_init_vector (sha1_hmac_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -2165,16 +2209,19 @@ DECLSPEC void sha1_hmac_init_vector (sha1_hmac_ctx_vector_t *ctx, const u32x *w,
sha1_hmac_init_vector_64 (ctx, w0, w1, w2, w3);
}
DECLSPEC void sha1_hmac_update_vector_64 (sha1_hmac_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len);
DECLSPEC void sha1_hmac_update_vector_64 (sha1_hmac_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len)
{
sha1_update_vector_64 (&ctx->ipad, w0, w1, w2, w3, len);
}
DECLSPEC void sha1_hmac_update_vector (sha1_hmac_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha1_hmac_update_vector (sha1_hmac_ctx_vector_t *ctx, const u32x *w, const int len)
{
sha1_update_vector (&ctx->ipad, w, len);
}
DECLSPEC void sha1_hmac_final_vector (sha1_hmac_ctx_vector_t *ctx);
DECLSPEC void sha1_hmac_final_vector (sha1_hmac_ctx_vector_t *ctx)
{
sha1_final_vector (&ctx->ipad);

@ -37,6 +37,7 @@ typedef struct sha224_ctx
} sha224_ctx_t;
DECLSPEC void sha224_transform (const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, u32 *digest);
DECLSPEC void sha224_transform (const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, u32 *digest)
{
u32 a = digest[0];
@ -128,6 +129,7 @@ DECLSPEC void sha224_transform (const u32 *w0, const u32 *w1, const u32 *w2, con
digest[7] += h;
}
DECLSPEC void sha224_init (sha224_ctx_t *ctx);
DECLSPEC void sha224_init (sha224_ctx_t *ctx)
{
ctx->h[0] = SHA224M_A;
@ -159,6 +161,7 @@ DECLSPEC void sha224_init (sha224_ctx_t *ctx)
ctx->len = 0;
}
DECLSPEC void sha224_update_64 (sha224_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len);
DECLSPEC void sha224_update_64 (sha224_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len)
{
const int pos = ctx->len & 63;
@ -233,6 +236,7 @@ DECLSPEC void sha224_update_64 (sha224_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u3
}
}
DECLSPEC void sha224_update (sha224_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha224_update (sha224_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -285,6 +289,7 @@ DECLSPEC void sha224_update (sha224_ctx_t *ctx, const u32 *w, const int len)
sha224_update_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void sha224_update_swap (sha224_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha224_update_swap (sha224_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -371,6 +376,7 @@ DECLSPEC void sha224_update_swap (sha224_ctx_t *ctx, const u32 *w, const int len
sha224_update_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void sha224_update_utf16le (sha224_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha224_update_utf16le (sha224_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -413,6 +419,7 @@ DECLSPEC void sha224_update_utf16le (sha224_ctx_t *ctx, const u32 *w, const int
sha224_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void sha224_update_utf16le_swap (sha224_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha224_update_utf16le_swap (sha224_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -489,6 +496,7 @@ DECLSPEC void sha224_update_utf16le_swap (sha224_ctx_t *ctx, const u32 *w, const
sha224_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void sha224_update_global (sha224_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha224_update_global (sha224_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -541,6 +549,7 @@ DECLSPEC void sha224_update_global (sha224_ctx_t *ctx, const __global u32 *w, co
sha224_update_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void sha224_update_global_swap (sha224_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha224_update_global_swap (sha224_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -627,6 +636,7 @@ DECLSPEC void sha224_update_global_swap (sha224_ctx_t *ctx, const __global u32 *
sha224_update_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void sha224_update_global_utf16le (sha224_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha224_update_global_utf16le (sha224_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -669,6 +679,7 @@ DECLSPEC void sha224_update_global_utf16le (sha224_ctx_t *ctx, const __global u3
sha224_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void sha224_update_global_utf16le_swap (sha224_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha224_update_global_utf16le_swap (sha224_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -745,6 +756,7 @@ DECLSPEC void sha224_update_global_utf16le_swap (sha224_ctx_t *ctx, const __glob
sha224_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void sha224_final (sha224_ctx_t *ctx);
DECLSPEC void sha224_final (sha224_ctx_t *ctx)
{
const int pos = ctx->len & 63;
@ -788,6 +800,7 @@ typedef struct sha224_hmac_ctx
} sha224_hmac_ctx_t;
DECLSPEC void sha224_hmac_init_64 (sha224_hmac_ctx_t *ctx, const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3);
DECLSPEC void sha224_hmac_init_64 (sha224_hmac_ctx_t *ctx, const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3)
{
u32 t0[4];
@ -842,6 +855,7 @@ DECLSPEC void sha224_hmac_init_64 (sha224_hmac_ctx_t *ctx, const u32 *w0, const
sha224_update_64 (&ctx->opad, t0, t1, t2, t3, 64);
}
DECLSPEC void sha224_hmac_init (sha224_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha224_hmac_init (sha224_hmac_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -899,6 +913,7 @@ DECLSPEC void sha224_hmac_init (sha224_hmac_ctx_t *ctx, const u32 *w, const int
sha224_hmac_init_64 (ctx, w0, w1, w2, w3);
}
DECLSPEC void sha224_hmac_init_swap (sha224_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha224_hmac_init_swap (sha224_hmac_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -956,6 +971,7 @@ DECLSPEC void sha224_hmac_init_swap (sha224_hmac_ctx_t *ctx, const u32 *w, const
sha224_hmac_init_64 (ctx, w0, w1, w2, w3);
}
DECLSPEC void sha224_hmac_init_global (sha224_hmac_ctx_t *ctx, __global const u32 *w, const int len);
DECLSPEC void sha224_hmac_init_global (sha224_hmac_ctx_t *ctx, __global const u32 *w, const int len)
{
u32 w0[4];
@ -1013,6 +1029,7 @@ DECLSPEC void sha224_hmac_init_global (sha224_hmac_ctx_t *ctx, __global const u3
sha224_hmac_init_64 (ctx, w0, w1, w2, w3);
}
DECLSPEC void sha224_hmac_init_global_swap (sha224_hmac_ctx_t *ctx, __global const u32 *w, const int len);
DECLSPEC void sha224_hmac_init_global_swap (sha224_hmac_ctx_t *ctx, __global const u32 *w, const int len)
{
u32 w0[4];
@ -1070,51 +1087,61 @@ DECLSPEC void sha224_hmac_init_global_swap (sha224_hmac_ctx_t *ctx, __global con
sha224_hmac_init_64 (ctx, w0, w1, w2, w3);
}
DECLSPEC void sha224_hmac_update_64 (sha224_hmac_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len);
DECLSPEC void sha224_hmac_update_64 (sha224_hmac_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len)
{
sha224_update_64 (&ctx->ipad, w0, w1, w2, w3, len);
}
DECLSPEC void sha224_hmac_update (sha224_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha224_hmac_update (sha224_hmac_ctx_t *ctx, const u32 *w, const int len)
{
sha224_update (&ctx->ipad, w, len);
}
DECLSPEC void sha224_hmac_update_swap (sha224_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha224_hmac_update_swap (sha224_hmac_ctx_t *ctx, const u32 *w, const int len)
{
sha224_update_swap (&ctx->ipad, w, len);
}
DECLSPEC void sha224_hmac_update_utf16le (sha224_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha224_hmac_update_utf16le (sha224_hmac_ctx_t *ctx, const u32 *w, const int len)
{
sha224_update_utf16le (&ctx->ipad, w, len);
}
DECLSPEC void sha224_hmac_update_utf16le_swap (sha224_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha224_hmac_update_utf16le_swap (sha224_hmac_ctx_t *ctx, const u32 *w, const int len)
{
sha224_update_utf16le_swap (&ctx->ipad, w, len);
}
DECLSPEC void sha224_hmac_update_global (sha224_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha224_hmac_update_global (sha224_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
sha224_update_global (&ctx->ipad, w, len);
}
DECLSPEC void sha224_hmac_update_global_swap (sha224_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha224_hmac_update_global_swap (sha224_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
sha224_update_global_swap (&ctx->ipad, w, len);
}
DECLSPEC void sha224_hmac_update_global_utf16le (sha224_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha224_hmac_update_global_utf16le (sha224_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
sha224_update_global_utf16le (&ctx->ipad, w, len);
}
DECLSPEC void sha224_hmac_update_global_utf16le_swap (sha224_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha224_hmac_update_global_utf16le_swap (sha224_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
sha224_update_global_utf16le_swap (&ctx->ipad, w, len);
}
DECLSPEC void sha224_hmac_final (sha224_hmac_ctx_t *ctx);
DECLSPEC void sha224_hmac_final (sha224_hmac_ctx_t *ctx)
{
sha224_final (&ctx->ipad);
@ -1161,6 +1188,7 @@ typedef struct sha224_ctx_vector
} sha224_ctx_vector_t;
DECLSPEC void sha224_transform_vector (const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, u32x *digest);
DECLSPEC void sha224_transform_vector (const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, u32x *digest)
{
u32x a = digest[0];
@ -1252,6 +1280,7 @@ DECLSPEC void sha224_transform_vector (const u32x *w0, const u32x *w1, const u32
digest[7] += h;
}
DECLSPEC void sha224_init_vector (sha224_ctx_vector_t *ctx);
DECLSPEC void sha224_init_vector (sha224_ctx_vector_t *ctx)
{
ctx->h[0] = SHA224M_A;
@ -1283,6 +1312,7 @@ DECLSPEC void sha224_init_vector (sha224_ctx_vector_t *ctx)
ctx->len = 0;
}
DECLSPEC void sha224_init_vector_from_scalar (sha224_ctx_vector_t *ctx, sha224_ctx_t *ctx0);
DECLSPEC void sha224_init_vector_from_scalar (sha224_ctx_vector_t *ctx, sha224_ctx_t *ctx0)
{
ctx->h[0] = ctx0->h[0];
@ -1314,6 +1344,7 @@ DECLSPEC void sha224_init_vector_from_scalar (sha224_ctx_vector_t *ctx, sha224_c
ctx->len = ctx0->len;
}
DECLSPEC void sha224_update_vector_64 (sha224_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len);
DECLSPEC void sha224_update_vector_64 (sha224_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len)
{
const int pos = ctx->len & 63;
@ -1388,6 +1419,7 @@ DECLSPEC void sha224_update_vector_64 (sha224_ctx_vector_t *ctx, u32x *w0, u32x
}
}
DECLSPEC void sha224_update_vector (sha224_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha224_update_vector (sha224_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -1440,6 +1472,7 @@ DECLSPEC void sha224_update_vector (sha224_ctx_vector_t *ctx, const u32x *w, con
sha224_update_vector_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void sha224_update_vector_swap (sha224_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha224_update_vector_swap (sha224_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -1526,6 +1559,7 @@ DECLSPEC void sha224_update_vector_swap (sha224_ctx_vector_t *ctx, const u32x *w
sha224_update_vector_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void sha224_update_vector_utf16le (sha224_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha224_update_vector_utf16le (sha224_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -1568,6 +1602,7 @@ DECLSPEC void sha224_update_vector_utf16le (sha224_ctx_vector_t *ctx, const u32x
sha224_update_vector_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void sha224_update_vector_utf16le_swap (sha224_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha224_update_vector_utf16le_swap (sha224_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -1644,6 +1679,7 @@ DECLSPEC void sha224_update_vector_utf16le_swap (sha224_ctx_vector_t *ctx, const
sha224_update_vector_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void sha224_update_vector_utf16beN (sha224_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha224_update_vector_utf16beN (sha224_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -1686,6 +1722,7 @@ DECLSPEC void sha224_update_vector_utf16beN (sha224_ctx_vector_t *ctx, const u32
sha224_update_vector_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void sha224_final_vector (sha224_ctx_vector_t *ctx);
DECLSPEC void sha224_final_vector (sha224_ctx_vector_t *ctx)
{
const int pos = ctx->len & 63;
@ -1729,6 +1766,7 @@ typedef struct sha224_hmac_ctx_vector
} sha224_hmac_ctx_vector_t;
DECLSPEC void sha224_hmac_init_vector_64 (sha224_hmac_ctx_vector_t *ctx, const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3);
DECLSPEC void sha224_hmac_init_vector_64 (sha224_hmac_ctx_vector_t *ctx, const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3)
{
u32x t0[4];
@ -1783,6 +1821,7 @@ DECLSPEC void sha224_hmac_init_vector_64 (sha224_hmac_ctx_vector_t *ctx, const u
sha224_update_vector_64 (&ctx->opad, t0, t1, t2, t3, 64);
}
DECLSPEC void sha224_hmac_init_vector (sha224_hmac_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha224_hmac_init_vector (sha224_hmac_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -1840,16 +1879,19 @@ DECLSPEC void sha224_hmac_init_vector (sha224_hmac_ctx_vector_t *ctx, const u32x
sha224_hmac_init_vector_64 (ctx, w0, w1, w2, w3);
}
DECLSPEC void sha224_hmac_update_vector_64 (sha224_hmac_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len);
DECLSPEC void sha224_hmac_update_vector_64 (sha224_hmac_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len)
{
sha224_update_vector_64 (&ctx->ipad, w0, w1, w2, w3, len);
}
DECLSPEC void sha224_hmac_update_vector (sha224_hmac_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha224_hmac_update_vector (sha224_hmac_ctx_vector_t *ctx, const u32x *w, const int len)
{
sha224_update_vector (&ctx->ipad, w, len);
}
DECLSPEC void sha224_hmac_final_vector (sha224_hmac_ctx_vector_t *ctx);
DECLSPEC void sha224_hmac_final_vector (sha224_hmac_ctx_vector_t *ctx)
{
sha224_final_vector (&ctx->ipad);

@ -37,6 +37,7 @@ typedef struct sha256_ctx
} sha256_ctx_t;
DECLSPEC void sha256_transform (const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, u32 *digest);
DECLSPEC void sha256_transform (const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, u32 *digest)
{
u32 a = digest[0];
@ -128,6 +129,7 @@ DECLSPEC void sha256_transform (const u32 *w0, const u32 *w1, const u32 *w2, con
digest[7] += h;
}
DECLSPEC void sha256_init (sha256_ctx_t *ctx);
DECLSPEC void sha256_init (sha256_ctx_t *ctx)
{
ctx->h[0] = SHA256M_A;
@ -159,6 +161,7 @@ DECLSPEC void sha256_init (sha256_ctx_t *ctx)
ctx->len = 0;
}
DECLSPEC void sha256_update_64 (sha256_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len);
DECLSPEC void sha256_update_64 (sha256_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len)
{
const int pos = ctx->len & 63;
@ -233,6 +236,7 @@ DECLSPEC void sha256_update_64 (sha256_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u3
}
}
DECLSPEC void sha256_update (sha256_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha256_update (sha256_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -285,6 +289,7 @@ DECLSPEC void sha256_update (sha256_ctx_t *ctx, const u32 *w, const int len)
sha256_update_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void sha256_update_swap (sha256_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha256_update_swap (sha256_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -371,6 +376,7 @@ DECLSPEC void sha256_update_swap (sha256_ctx_t *ctx, const u32 *w, const int len
sha256_update_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void sha256_update_utf16le (sha256_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha256_update_utf16le (sha256_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -413,6 +419,7 @@ DECLSPEC void sha256_update_utf16le (sha256_ctx_t *ctx, const u32 *w, const int
sha256_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void sha256_update_utf16le_swap (sha256_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha256_update_utf16le_swap (sha256_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -489,6 +496,7 @@ DECLSPEC void sha256_update_utf16le_swap (sha256_ctx_t *ctx, const u32 *w, const
sha256_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void sha256_update_global (sha256_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha256_update_global (sha256_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -541,6 +549,7 @@ DECLSPEC void sha256_update_global (sha256_ctx_t *ctx, const __global u32 *w, co
sha256_update_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void sha256_update_global_swap (sha256_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha256_update_global_swap (sha256_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -627,6 +636,7 @@ DECLSPEC void sha256_update_global_swap (sha256_ctx_t *ctx, const __global u32 *
sha256_update_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void sha256_update_global_utf16le (sha256_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha256_update_global_utf16le (sha256_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -669,6 +679,7 @@ DECLSPEC void sha256_update_global_utf16le (sha256_ctx_t *ctx, const __global u3
sha256_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void sha256_update_global_utf16le_swap (sha256_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha256_update_global_utf16le_swap (sha256_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -745,6 +756,7 @@ DECLSPEC void sha256_update_global_utf16le_swap (sha256_ctx_t *ctx, const __glob
sha256_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void sha256_final (sha256_ctx_t *ctx);
DECLSPEC void sha256_final (sha256_ctx_t *ctx)
{
const int pos = ctx->len & 63;
@ -788,6 +800,7 @@ typedef struct sha256_hmac_ctx
} sha256_hmac_ctx_t;
DECLSPEC void sha256_hmac_init_64 (sha256_hmac_ctx_t *ctx, const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3);
DECLSPEC void sha256_hmac_init_64 (sha256_hmac_ctx_t *ctx, const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3)
{
u32 t0[4];
@ -842,6 +855,7 @@ DECLSPEC void sha256_hmac_init_64 (sha256_hmac_ctx_t *ctx, const u32 *w0, const
sha256_update_64 (&ctx->opad, t0, t1, t2, t3, 64);
}
DECLSPEC void sha256_hmac_init (sha256_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha256_hmac_init (sha256_hmac_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -899,6 +913,7 @@ DECLSPEC void sha256_hmac_init (sha256_hmac_ctx_t *ctx, const u32 *w, const int
sha256_hmac_init_64 (ctx, w0, w1, w2, w3);
}
DECLSPEC void sha256_hmac_init_swap (sha256_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha256_hmac_init_swap (sha256_hmac_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -956,6 +971,7 @@ DECLSPEC void sha256_hmac_init_swap (sha256_hmac_ctx_t *ctx, const u32 *w, const
sha256_hmac_init_64 (ctx, w0, w1, w2, w3);
}
DECLSPEC void sha256_hmac_init_global (sha256_hmac_ctx_t *ctx, __global const u32 *w, const int len);
DECLSPEC void sha256_hmac_init_global (sha256_hmac_ctx_t *ctx, __global const u32 *w, const int len)
{
u32 w0[4];
@ -1013,6 +1029,7 @@ DECLSPEC void sha256_hmac_init_global (sha256_hmac_ctx_t *ctx, __global const u3
sha256_hmac_init_64 (ctx, w0, w1, w2, w3);
}
DECLSPEC void sha256_hmac_init_global_swap (sha256_hmac_ctx_t *ctx, __global const u32 *w, const int len);
DECLSPEC void sha256_hmac_init_global_swap (sha256_hmac_ctx_t *ctx, __global const u32 *w, const int len)
{
u32 w0[4];
@ -1070,51 +1087,61 @@ DECLSPEC void sha256_hmac_init_global_swap (sha256_hmac_ctx_t *ctx, __global con
sha256_hmac_init_64 (ctx, w0, w1, w2, w3);
}
DECLSPEC void sha256_hmac_update_64 (sha256_hmac_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len);
DECLSPEC void sha256_hmac_update_64 (sha256_hmac_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len)
{
sha256_update_64 (&ctx->ipad, w0, w1, w2, w3, len);
}
DECLSPEC void sha256_hmac_update (sha256_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha256_hmac_update (sha256_hmac_ctx_t *ctx, const u32 *w, const int len)
{
sha256_update (&ctx->ipad, w, len);
}
DECLSPEC void sha256_hmac_update_swap (sha256_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha256_hmac_update_swap (sha256_hmac_ctx_t *ctx, const u32 *w, const int len)
{
sha256_update_swap (&ctx->ipad, w, len);
}
DECLSPEC void sha256_hmac_update_utf16le (sha256_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha256_hmac_update_utf16le (sha256_hmac_ctx_t *ctx, const u32 *w, const int len)
{
sha256_update_utf16le (&ctx->ipad, w, len);
}
DECLSPEC void sha256_hmac_update_utf16le_swap (sha256_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha256_hmac_update_utf16le_swap (sha256_hmac_ctx_t *ctx, const u32 *w, const int len)
{
sha256_update_utf16le_swap (&ctx->ipad, w, len);
}
DECLSPEC void sha256_hmac_update_global (sha256_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha256_hmac_update_global (sha256_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
sha256_update_global (&ctx->ipad, w, len);
}
DECLSPEC void sha256_hmac_update_global_swap (sha256_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha256_hmac_update_global_swap (sha256_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
sha256_update_global_swap (&ctx->ipad, w, len);
}
DECLSPEC void sha256_hmac_update_global_utf16le (sha256_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha256_hmac_update_global_utf16le (sha256_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
sha256_update_global_utf16le (&ctx->ipad, w, len);
}
DECLSPEC void sha256_hmac_update_global_utf16le_swap (sha256_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha256_hmac_update_global_utf16le_swap (sha256_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
sha256_update_global_utf16le_swap (&ctx->ipad, w, len);
}
DECLSPEC void sha256_hmac_final (sha256_hmac_ctx_t *ctx);
DECLSPEC void sha256_hmac_final (sha256_hmac_ctx_t *ctx)
{
sha256_final (&ctx->ipad);
@ -1161,6 +1188,7 @@ typedef struct sha256_ctx_vector
} sha256_ctx_vector_t;
DECLSPEC void sha256_transform_vector (const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, u32x *digest);
DECLSPEC void sha256_transform_vector (const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, u32x *digest)
{
u32x a = digest[0];
@ -1252,6 +1280,7 @@ DECLSPEC void sha256_transform_vector (const u32x *w0, const u32x *w1, const u32
digest[7] += h;
}
DECLSPEC void sha256_init_vector (sha256_ctx_vector_t *ctx);
DECLSPEC void sha256_init_vector (sha256_ctx_vector_t *ctx)
{
ctx->h[0] = SHA256M_A;
@ -1283,6 +1312,7 @@ DECLSPEC void sha256_init_vector (sha256_ctx_vector_t *ctx)
ctx->len = 0;
}
DECLSPEC void sha256_init_vector_from_scalar (sha256_ctx_vector_t *ctx, sha256_ctx_t *ctx0);
DECLSPEC void sha256_init_vector_from_scalar (sha256_ctx_vector_t *ctx, sha256_ctx_t *ctx0)
{
ctx->h[0] = ctx0->h[0];
@ -1314,6 +1344,7 @@ DECLSPEC void sha256_init_vector_from_scalar (sha256_ctx_vector_t *ctx, sha256_c
ctx->len = ctx0->len;
}
DECLSPEC void sha256_update_vector_64 (sha256_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len);
DECLSPEC void sha256_update_vector_64 (sha256_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len)
{
const int pos = ctx->len & 63;
@ -1388,6 +1419,7 @@ DECLSPEC void sha256_update_vector_64 (sha256_ctx_vector_t *ctx, u32x *w0, u32x
}
}
DECLSPEC void sha256_update_vector (sha256_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha256_update_vector (sha256_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -1440,6 +1472,7 @@ DECLSPEC void sha256_update_vector (sha256_ctx_vector_t *ctx, const u32x *w, con
sha256_update_vector_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void sha256_update_vector_swap (sha256_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha256_update_vector_swap (sha256_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -1526,6 +1559,7 @@ DECLSPEC void sha256_update_vector_swap (sha256_ctx_vector_t *ctx, const u32x *w
sha256_update_vector_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void sha256_update_vector_utf16le (sha256_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha256_update_vector_utf16le (sha256_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -1568,6 +1602,7 @@ DECLSPEC void sha256_update_vector_utf16le (sha256_ctx_vector_t *ctx, const u32x
sha256_update_vector_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void sha256_update_vector_utf16le_swap (sha256_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha256_update_vector_utf16le_swap (sha256_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -1644,6 +1679,7 @@ DECLSPEC void sha256_update_vector_utf16le_swap (sha256_ctx_vector_t *ctx, const
sha256_update_vector_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void sha256_update_vector_utf16beN (sha256_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha256_update_vector_utf16beN (sha256_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -1686,6 +1722,7 @@ DECLSPEC void sha256_update_vector_utf16beN (sha256_ctx_vector_t *ctx, const u32
sha256_update_vector_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void sha256_final_vector (sha256_ctx_vector_t *ctx);
DECLSPEC void sha256_final_vector (sha256_ctx_vector_t *ctx)
{
const int pos = ctx->len & 63;
@ -1729,6 +1766,7 @@ typedef struct sha256_hmac_ctx_vector
} sha256_hmac_ctx_vector_t;
DECLSPEC void sha256_hmac_init_vector_64 (sha256_hmac_ctx_vector_t *ctx, const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3);
DECLSPEC void sha256_hmac_init_vector_64 (sha256_hmac_ctx_vector_t *ctx, const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3)
{
u32x t0[4];
@ -1783,6 +1821,7 @@ DECLSPEC void sha256_hmac_init_vector_64 (sha256_hmac_ctx_vector_t *ctx, const u
sha256_update_vector_64 (&ctx->opad, t0, t1, t2, t3, 64);
}
DECLSPEC void sha256_hmac_init_vector (sha256_hmac_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha256_hmac_init_vector (sha256_hmac_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -1840,16 +1879,19 @@ DECLSPEC void sha256_hmac_init_vector (sha256_hmac_ctx_vector_t *ctx, const u32x
sha256_hmac_init_vector_64 (ctx, w0, w1, w2, w3);
}
DECLSPEC void sha256_hmac_update_vector_64 (sha256_hmac_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len);
DECLSPEC void sha256_hmac_update_vector_64 (sha256_hmac_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len)
{
sha256_update_vector_64 (&ctx->ipad, w0, w1, w2, w3, len);
}
DECLSPEC void sha256_hmac_update_vector (sha256_hmac_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha256_hmac_update_vector (sha256_hmac_ctx_vector_t *ctx, const u32x *w, const int len)
{
sha256_update_vector (&ctx->ipad, w, len);
}
DECLSPEC void sha256_hmac_final_vector (sha256_hmac_ctx_vector_t *ctx);
DECLSPEC void sha256_hmac_final_vector (sha256_hmac_ctx_vector_t *ctx)
{
sha256_final_vector (&ctx->ipad);

@ -45,6 +45,7 @@ typedef struct sha384_ctx
} sha384_ctx_t;
DECLSPEC void sha384_transform (const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, const u32 *w4, const u32 *w5, const u32 *w6, const u32 *w7, u64 *digest);
DECLSPEC void sha384_transform (const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, const u32 *w4, const u32 *w5, const u32 *w6, const u32 *w7, u64 *digest)
{
u64 a = digest[0];
@ -136,6 +137,7 @@ DECLSPEC void sha384_transform (const u32 *w0, const u32 *w1, const u32 *w2, con
digest[7] += h;
}
DECLSPEC void sha384_init (sha384_ctx_t *ctx);
DECLSPEC void sha384_init (sha384_ctx_t *ctx)
{
ctx->h[0] = SHA384M_A;
@ -183,6 +185,7 @@ DECLSPEC void sha384_init (sha384_ctx_t *ctx)
ctx->len = 0;
}
DECLSPEC void sha384_update_128 (sha384_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, u32 *w4, u32 *w5, u32 *w6, u32 *w7, const int len);
DECLSPEC void sha384_update_128 (sha384_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, u32 *w4, u32 *w5, u32 *w6, u32 *w7, const int len)
{
const int pos = ctx->len & 127;
@ -309,6 +312,7 @@ DECLSPEC void sha384_update_128 (sha384_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u
}
}
DECLSPEC void sha384_update (sha384_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha384_update (sha384_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -397,6 +401,7 @@ DECLSPEC void sha384_update (sha384_ctx_t *ctx, const u32 *w, const int len)
sha384_update_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7, len - pos1);
}
DECLSPEC void sha384_update_swap (sha384_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha384_update_swap (sha384_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -551,6 +556,7 @@ DECLSPEC void sha384_update_swap (sha384_ctx_t *ctx, const u32 *w, const int len
sha384_update_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7, len - pos1);
}
DECLSPEC void sha384_update_utf16le (sha384_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha384_update_utf16le (sha384_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -617,6 +623,7 @@ DECLSPEC void sha384_update_utf16le (sha384_ctx_t *ctx, const u32 *w, const int
sha384_update_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7, (len - pos1) * 2);
}
DECLSPEC void sha384_update_utf16le_swap (sha384_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha384_update_utf16le_swap (sha384_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -749,6 +756,7 @@ DECLSPEC void sha384_update_utf16le_swap (sha384_ctx_t *ctx, const u32 *w, const
sha384_update_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7, (len - pos1) * 2);
}
DECLSPEC void sha384_update_global (sha384_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha384_update_global (sha384_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -837,6 +845,7 @@ DECLSPEC void sha384_update_global (sha384_ctx_t *ctx, const __global u32 *w, co
sha384_update_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7, len - pos1);
}
DECLSPEC void sha384_update_global_swap (sha384_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha384_update_global_swap (sha384_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -991,6 +1000,7 @@ DECLSPEC void sha384_update_global_swap (sha384_ctx_t *ctx, const __global u32 *
sha384_update_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7, len - pos1);
}
DECLSPEC void sha384_update_global_utf16le (sha384_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha384_update_global_utf16le (sha384_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -1057,6 +1067,7 @@ DECLSPEC void sha384_update_global_utf16le (sha384_ctx_t *ctx, const __global u3
sha384_update_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7, (len - pos1) * 2);
}
DECLSPEC void sha384_update_global_utf16le_swap (sha384_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha384_update_global_utf16le_swap (sha384_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -1189,6 +1200,7 @@ DECLSPEC void sha384_update_global_utf16le_swap (sha384_ctx_t *ctx, const __glob
sha384_update_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7, (len - pos1) * 2);
}
DECLSPEC void sha384_final (sha384_ctx_t *ctx);
DECLSPEC void sha384_final (sha384_ctx_t *ctx)
{
const int pos = ctx->len & 127;
@ -1248,6 +1260,7 @@ typedef struct sha384_hmac_ctx
} sha384_hmac_ctx_t;
DECLSPEC void sha384_hmac_init_128 (sha384_hmac_ctx_t *ctx, const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, const u32 *w4, const u32 *w5, const u32 *w6, const u32 *w7);
DECLSPEC void sha384_hmac_init_128 (sha384_hmac_ctx_t *ctx, const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, const u32 *w4, const u32 *w5, const u32 *w6, const u32 *w7)
{
u32 t0[4];
@ -1338,6 +1351,7 @@ DECLSPEC void sha384_hmac_init_128 (sha384_hmac_ctx_t *ctx, const u32 *w0, const
sha384_update_128 (&ctx->opad, t0, t1, t2, t3, t4, t5, t6, t7, 128);
}
DECLSPEC void sha384_hmac_init (sha384_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha384_hmac_init (sha384_hmac_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -1431,6 +1445,7 @@ DECLSPEC void sha384_hmac_init (sha384_hmac_ctx_t *ctx, const u32 *w, const int
sha384_hmac_init_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7);
}
DECLSPEC void sha384_hmac_init_swap (sha384_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha384_hmac_init_swap (sha384_hmac_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -1524,6 +1539,7 @@ DECLSPEC void sha384_hmac_init_swap (sha384_hmac_ctx_t *ctx, const u32 *w, const
sha384_hmac_init_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7);
}
DECLSPEC void sha384_hmac_init_global (sha384_hmac_ctx_t *ctx, __global const u32 *w, const int len);
DECLSPEC void sha384_hmac_init_global (sha384_hmac_ctx_t *ctx, __global const u32 *w, const int len)
{
u32 w0[4];
@ -1617,6 +1633,7 @@ DECLSPEC void sha384_hmac_init_global (sha384_hmac_ctx_t *ctx, __global const u3
sha384_hmac_init_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7);
}
DECLSPEC void sha384_hmac_init_global_swap (sha384_hmac_ctx_t *ctx, __global const u32 *w, const int len);
DECLSPEC void sha384_hmac_init_global_swap (sha384_hmac_ctx_t *ctx, __global const u32 *w, const int len)
{
u32 w0[4];
@ -1710,51 +1727,61 @@ DECLSPEC void sha384_hmac_init_global_swap (sha384_hmac_ctx_t *ctx, __global con
sha384_hmac_init_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7);
}
DECLSPEC void sha384_hmac_update_128 (sha384_hmac_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, u32 *w4, u32 *w5, u32 *w6, u32 *w7, const int len);
DECLSPEC void sha384_hmac_update_128 (sha384_hmac_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, u32 *w4, u32 *w5, u32 *w6, u32 *w7, const int len)
{
sha384_update_128 (&ctx->ipad, w0, w1, w2, w3, w4, w5, w6, w7, len);
}
DECLSPEC void sha384_hmac_update (sha384_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha384_hmac_update (sha384_hmac_ctx_t *ctx, const u32 *w, const int len)
{
sha384_update (&ctx->ipad, w, len);
}
DECLSPEC void sha384_hmac_update_swap (sha384_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha384_hmac_update_swap (sha384_hmac_ctx_t *ctx, const u32 *w, const int len)
{
sha384_update_swap (&ctx->ipad, w, len);
}
DECLSPEC void sha384_hmac_update_utf16le (sha384_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha384_hmac_update_utf16le (sha384_hmac_ctx_t *ctx, const u32 *w, const int len)
{
sha384_update_utf16le (&ctx->ipad, w, len);
}
DECLSPEC void sha384_hmac_update_utf16le_swap (sha384_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha384_hmac_update_utf16le_swap (sha384_hmac_ctx_t *ctx, const u32 *w, const int len)
{
sha384_update_utf16le_swap (&ctx->ipad, w, len);
}
DECLSPEC void sha384_hmac_update_global (sha384_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha384_hmac_update_global (sha384_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
sha384_update_global (&ctx->ipad, w, len);
}
DECLSPEC void sha384_hmac_update_global_swap (sha384_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha384_hmac_update_global_swap (sha384_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
sha384_update_global_swap (&ctx->ipad, w, len);
}
DECLSPEC void sha384_hmac_update_global_utf16le (sha384_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha384_hmac_update_global_utf16le (sha384_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
sha384_update_global_utf16le (&ctx->ipad, w, len);
}
DECLSPEC void sha384_hmac_update_global_utf16le_swap (sha384_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha384_hmac_update_global_utf16le_swap (sha384_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
sha384_update_global_utf16le_swap (&ctx->ipad, w, len);
}
DECLSPEC void sha384_hmac_final (sha384_hmac_ctx_t *ctx);
DECLSPEC void sha384_hmac_final (sha384_hmac_ctx_t *ctx)
{
sha384_final (&ctx->ipad);
@ -1825,6 +1852,7 @@ typedef struct sha384_ctx_vector
} sha384_ctx_vector_t;
DECLSPEC void sha384_transform_vector (const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, const u32x *w4, const u32x *w5, const u32x *w6, const u32x *w7, u64x *digest);
DECLSPEC void sha384_transform_vector (const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, const u32x *w4, const u32x *w5, const u32x *w6, const u32x *w7, u64x *digest)
{
u64x a = digest[0];
@ -1916,6 +1944,7 @@ DECLSPEC void sha384_transform_vector (const u32x *w0, const u32x *w1, const u32
digest[7] += h;
}
DECLSPEC void sha384_init_vector (sha384_ctx_vector_t *ctx);
DECLSPEC void sha384_init_vector (sha384_ctx_vector_t *ctx)
{
ctx->h[0] = SHA384M_A;
@ -1963,6 +1992,7 @@ DECLSPEC void sha384_init_vector (sha384_ctx_vector_t *ctx)
ctx->len = 0;
}
DECLSPEC void sha384_init_vector_from_scalar (sha384_ctx_vector_t *ctx, sha384_ctx_t *ctx0);
DECLSPEC void sha384_init_vector_from_scalar (sha384_ctx_vector_t *ctx, sha384_ctx_t *ctx0)
{
ctx->h[0] = ctx0->h[0];
@ -2010,6 +2040,7 @@ DECLSPEC void sha384_init_vector_from_scalar (sha384_ctx_vector_t *ctx, sha384_c
ctx->len = ctx0->len;
}
DECLSPEC void sha384_update_vector_128 (sha384_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, u32x *w4, u32x *w5, u32x *w6, u32x *w7, const int len);
DECLSPEC void sha384_update_vector_128 (sha384_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, u32x *w4, u32x *w5, u32x *w6, u32x *w7, const int len)
{
const int pos = ctx->len & 127;
@ -2136,6 +2167,7 @@ DECLSPEC void sha384_update_vector_128 (sha384_ctx_vector_t *ctx, u32x *w0, u32x
}
}
DECLSPEC void sha384_update_vector (sha384_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha384_update_vector (sha384_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -2224,6 +2256,7 @@ DECLSPEC void sha384_update_vector (sha384_ctx_vector_t *ctx, const u32x *w, con
sha384_update_vector_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7, len - pos1);
}
DECLSPEC void sha384_update_vector_swap (sha384_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha384_update_vector_swap (sha384_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -2378,6 +2411,7 @@ DECLSPEC void sha384_update_vector_swap (sha384_ctx_vector_t *ctx, const u32x *w
sha384_update_vector_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7, len - pos1);
}
DECLSPEC void sha384_update_vector_utf16le (sha384_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha384_update_vector_utf16le (sha384_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -2444,6 +2478,7 @@ DECLSPEC void sha384_update_vector_utf16le (sha384_ctx_vector_t *ctx, const u32x
sha384_update_vector_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7, (len - pos1) * 2);
}
DECLSPEC void sha384_update_vector_utf16le_swap (sha384_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha384_update_vector_utf16le_swap (sha384_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -2576,6 +2611,7 @@ DECLSPEC void sha384_update_vector_utf16le_swap (sha384_ctx_vector_t *ctx, const
sha384_update_vector_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7, (len - pos1) * 2);
}
DECLSPEC void sha384_update_vector_utf16beN (sha384_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha384_update_vector_utf16beN (sha384_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -2642,6 +2678,7 @@ DECLSPEC void sha384_update_vector_utf16beN (sha384_ctx_vector_t *ctx, const u32
sha384_update_vector_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7, (len - pos1) * 2);
}
DECLSPEC void sha384_final_vector (sha384_ctx_vector_t *ctx);
DECLSPEC void sha384_final_vector (sha384_ctx_vector_t *ctx)
{
const int pos = ctx->len & 127;
@ -2701,6 +2738,7 @@ typedef struct sha384_hmac_ctx_vector
} sha384_hmac_ctx_vector_t;
DECLSPEC void sha384_hmac_init_vector_128 (sha384_hmac_ctx_vector_t *ctx, const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, const u32x *w4, const u32x *w5, const u32x *w6, const u32x *w7);
DECLSPEC void sha384_hmac_init_vector_128 (sha384_hmac_ctx_vector_t *ctx, const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, const u32x *w4, const u32x *w5, const u32x *w6, const u32x *w7)
{
u32x t0[4];
@ -2791,6 +2829,7 @@ DECLSPEC void sha384_hmac_init_vector_128 (sha384_hmac_ctx_vector_t *ctx, const
sha384_update_vector_128 (&ctx->opad, t0, t1, t2, t3, t4, t5, t6, t7, 128);
}
DECLSPEC void sha384_hmac_init_vector (sha384_hmac_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha384_hmac_init_vector (sha384_hmac_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -2884,16 +2923,19 @@ DECLSPEC void sha384_hmac_init_vector (sha384_hmac_ctx_vector_t *ctx, const u32x
sha384_hmac_init_vector_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7);
}
DECLSPEC void sha384_hmac_update_vector_128 (sha384_hmac_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, u32x *w4, u32x *w5, u32x *w6, u32x *w7, const int len);
DECLSPEC void sha384_hmac_update_vector_128 (sha384_hmac_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, u32x *w4, u32x *w5, u32x *w6, u32x *w7, const int len)
{
sha384_update_vector_128 (&ctx->ipad, w0, w1, w2, w3, w4, w5, w6, w7, len);
}
DECLSPEC void sha384_hmac_update_vector (sha384_hmac_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha384_hmac_update_vector (sha384_hmac_ctx_vector_t *ctx, const u32x *w, const int len)
{
sha384_update_vector (&ctx->ipad, w, len);
}
DECLSPEC void sha384_hmac_final_vector (sha384_hmac_ctx_vector_t *ctx);
DECLSPEC void sha384_hmac_final_vector (sha384_hmac_ctx_vector_t *ctx)
{
sha384_final_vector (&ctx->ipad);

@ -45,6 +45,7 @@ typedef struct sha512_ctx
} sha512_ctx_t;
DECLSPEC void sha512_transform (const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, const u32 *w4, const u32 *w5, const u32 *w6, const u32 *w7, u64 *digest);
DECLSPEC void sha512_transform (const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, const u32 *w4, const u32 *w5, const u32 *w6, const u32 *w7, u64 *digest)
{
u64 a = digest[0];
@ -136,6 +137,7 @@ DECLSPEC void sha512_transform (const u32 *w0, const u32 *w1, const u32 *w2, con
digest[7] += h;
}
DECLSPEC void sha512_init (sha512_ctx_t *ctx);
DECLSPEC void sha512_init (sha512_ctx_t *ctx)
{
ctx->h[0] = SHA512M_A;
@ -183,6 +185,7 @@ DECLSPEC void sha512_init (sha512_ctx_t *ctx)
ctx->len = 0;
}
DECLSPEC void sha512_update_128 (sha512_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, u32 *w4, u32 *w5, u32 *w6, u32 *w7, const int len);
DECLSPEC void sha512_update_128 (sha512_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, u32 *w4, u32 *w5, u32 *w6, u32 *w7, const int len)
{
const int pos = ctx->len & 127;
@ -309,6 +312,7 @@ DECLSPEC void sha512_update_128 (sha512_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u
}
}
DECLSPEC void sha512_update (sha512_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha512_update (sha512_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -397,6 +401,7 @@ DECLSPEC void sha512_update (sha512_ctx_t *ctx, const u32 *w, const int len)
sha512_update_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7, len - pos1);
}
DECLSPEC void sha512_update_swap (sha512_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha512_update_swap (sha512_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -551,6 +556,7 @@ DECLSPEC void sha512_update_swap (sha512_ctx_t *ctx, const u32 *w, const int len
sha512_update_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7, len - pos1);
}
DECLSPEC void sha512_update_utf16le (sha512_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha512_update_utf16le (sha512_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -617,6 +623,7 @@ DECLSPEC void sha512_update_utf16le (sha512_ctx_t *ctx, const u32 *w, const int
sha512_update_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7, (len - pos1) * 2);
}
DECLSPEC void sha512_update_utf16le_swap (sha512_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha512_update_utf16le_swap (sha512_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -749,6 +756,7 @@ DECLSPEC void sha512_update_utf16le_swap (sha512_ctx_t *ctx, const u32 *w, const
sha512_update_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7, (len - pos1) * 2);
}
DECLSPEC void sha512_update_global (sha512_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha512_update_global (sha512_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -837,6 +845,7 @@ DECLSPEC void sha512_update_global (sha512_ctx_t *ctx, const __global u32 *w, co
sha512_update_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7, len - pos1);
}
DECLSPEC void sha512_update_global_swap (sha512_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha512_update_global_swap (sha512_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -991,6 +1000,7 @@ DECLSPEC void sha512_update_global_swap (sha512_ctx_t *ctx, const __global u32 *
sha512_update_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7, len - pos1);
}
DECLSPEC void sha512_update_global_utf16le (sha512_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha512_update_global_utf16le (sha512_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -1057,6 +1067,7 @@ DECLSPEC void sha512_update_global_utf16le (sha512_ctx_t *ctx, const __global u3
sha512_update_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7, (len - pos1) * 2);
}
DECLSPEC void sha512_update_global_utf16le_swap (sha512_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha512_update_global_utf16le_swap (sha512_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -1189,6 +1200,7 @@ DECLSPEC void sha512_update_global_utf16le_swap (sha512_ctx_t *ctx, const __glob
sha512_update_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7, (len - pos1) * 2);
}
DECLSPEC void sha512_final (sha512_ctx_t *ctx);
DECLSPEC void sha512_final (sha512_ctx_t *ctx)
{
const int pos = ctx->len & 127;
@ -1248,6 +1260,7 @@ typedef struct sha512_hmac_ctx
} sha512_hmac_ctx_t;
DECLSPEC void sha512_hmac_init_128 (sha512_hmac_ctx_t *ctx, const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, const u32 *w4, const u32 *w5, const u32 *w6, const u32 *w7);
DECLSPEC void sha512_hmac_init_128 (sha512_hmac_ctx_t *ctx, const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, const u32 *w4, const u32 *w5, const u32 *w6, const u32 *w7)
{
u32 t0[4];
@ -1338,6 +1351,7 @@ DECLSPEC void sha512_hmac_init_128 (sha512_hmac_ctx_t *ctx, const u32 *w0, const
sha512_update_128 (&ctx->opad, t0, t1, t2, t3, t4, t5, t6, t7, 128);
}
DECLSPEC void sha512_hmac_init (sha512_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha512_hmac_init (sha512_hmac_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -1431,6 +1445,7 @@ DECLSPEC void sha512_hmac_init (sha512_hmac_ctx_t *ctx, const u32 *w, const int
sha512_hmac_init_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7);
}
DECLSPEC void sha512_hmac_init_swap (sha512_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha512_hmac_init_swap (sha512_hmac_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -1524,6 +1539,7 @@ DECLSPEC void sha512_hmac_init_swap (sha512_hmac_ctx_t *ctx, const u32 *w, const
sha512_hmac_init_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7);
}
DECLSPEC void sha512_hmac_init_global (sha512_hmac_ctx_t *ctx, __global const u32 *w, const int len);
DECLSPEC void sha512_hmac_init_global (sha512_hmac_ctx_t *ctx, __global const u32 *w, const int len)
{
u32 w0[4];
@ -1617,6 +1633,7 @@ DECLSPEC void sha512_hmac_init_global (sha512_hmac_ctx_t *ctx, __global const u3
sha512_hmac_init_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7);
}
DECLSPEC void sha512_hmac_init_global_swap (sha512_hmac_ctx_t *ctx, __global const u32 *w, const int len);
DECLSPEC void sha512_hmac_init_global_swap (sha512_hmac_ctx_t *ctx, __global const u32 *w, const int len)
{
u32 w0[4];
@ -1710,51 +1727,61 @@ DECLSPEC void sha512_hmac_init_global_swap (sha512_hmac_ctx_t *ctx, __global con
sha512_hmac_init_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7);
}
DECLSPEC void sha512_hmac_update_128 (sha512_hmac_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, u32 *w4, u32 *w5, u32 *w6, u32 *w7, const int len);
DECLSPEC void sha512_hmac_update_128 (sha512_hmac_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, u32 *w4, u32 *w5, u32 *w6, u32 *w7, const int len)
{
sha512_update_128 (&ctx->ipad, w0, w1, w2, w3, w4, w5, w6, w7, len);
}
DECLSPEC void sha512_hmac_update (sha512_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha512_hmac_update (sha512_hmac_ctx_t *ctx, const u32 *w, const int len)
{
sha512_update (&ctx->ipad, w, len);
}
DECLSPEC void sha512_hmac_update_swap (sha512_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha512_hmac_update_swap (sha512_hmac_ctx_t *ctx, const u32 *w, const int len)
{
sha512_update_swap (&ctx->ipad, w, len);
}
DECLSPEC void sha512_hmac_update_utf16le (sha512_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha512_hmac_update_utf16le (sha512_hmac_ctx_t *ctx, const u32 *w, const int len)
{
sha512_update_utf16le (&ctx->ipad, w, len);
}
DECLSPEC void sha512_hmac_update_utf16le_swap (sha512_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void sha512_hmac_update_utf16le_swap (sha512_hmac_ctx_t *ctx, const u32 *w, const int len)
{
sha512_update_utf16le_swap (&ctx->ipad, w, len);
}
DECLSPEC void sha512_hmac_update_global (sha512_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha512_hmac_update_global (sha512_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
sha512_update_global (&ctx->ipad, w, len);
}
DECLSPEC void sha512_hmac_update_global_swap (sha512_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha512_hmac_update_global_swap (sha512_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
sha512_update_global_swap (&ctx->ipad, w, len);
}
DECLSPEC void sha512_hmac_update_global_utf16le (sha512_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha512_hmac_update_global_utf16le (sha512_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
sha512_update_global_utf16le (&ctx->ipad, w, len);
}
DECLSPEC void sha512_hmac_update_global_utf16le_swap (sha512_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void sha512_hmac_update_global_utf16le_swap (sha512_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
sha512_update_global_utf16le_swap (&ctx->ipad, w, len);
}
DECLSPEC void sha512_hmac_final (sha512_hmac_ctx_t *ctx);
DECLSPEC void sha512_hmac_final (sha512_hmac_ctx_t *ctx)
{
sha512_final (&ctx->ipad);
@ -1825,6 +1852,7 @@ typedef struct sha512_ctx_vector
} sha512_ctx_vector_t;
DECLSPEC void sha512_transform_vector (const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, const u32x *w4, const u32x *w5, const u32x *w6, const u32x *w7, u64x *digest);
DECLSPEC void sha512_transform_vector (const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, const u32x *w4, const u32x *w5, const u32x *w6, const u32x *w7, u64x *digest)
{
u64x a = digest[0];
@ -1916,6 +1944,7 @@ DECLSPEC void sha512_transform_vector (const u32x *w0, const u32x *w1, const u32
digest[7] += h;
}
DECLSPEC void sha512_init_vector (sha512_ctx_vector_t *ctx);
DECLSPEC void sha512_init_vector (sha512_ctx_vector_t *ctx)
{
ctx->h[0] = SHA512M_A;
@ -1963,6 +1992,7 @@ DECLSPEC void sha512_init_vector (sha512_ctx_vector_t *ctx)
ctx->len = 0;
}
DECLSPEC void sha512_init_vector_from_scalar (sha512_ctx_vector_t *ctx, sha512_ctx_t *ctx0);
DECLSPEC void sha512_init_vector_from_scalar (sha512_ctx_vector_t *ctx, sha512_ctx_t *ctx0)
{
ctx->h[0] = ctx0->h[0];
@ -2010,6 +2040,7 @@ DECLSPEC void sha512_init_vector_from_scalar (sha512_ctx_vector_t *ctx, sha512_c
ctx->len = ctx0->len;
}
DECLSPEC void sha512_update_vector_128 (sha512_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, u32x *w4, u32x *w5, u32x *w6, u32x *w7, const int len);
DECLSPEC void sha512_update_vector_128 (sha512_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, u32x *w4, u32x *w5, u32x *w6, u32x *w7, const int len)
{
const int pos = ctx->len & 127;
@ -2136,6 +2167,7 @@ DECLSPEC void sha512_update_vector_128 (sha512_ctx_vector_t *ctx, u32x *w0, u32x
}
}
DECLSPEC void sha512_update_vector (sha512_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha512_update_vector (sha512_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -2224,6 +2256,7 @@ DECLSPEC void sha512_update_vector (sha512_ctx_vector_t *ctx, const u32x *w, con
sha512_update_vector_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7, len - pos1);
}
DECLSPEC void sha512_update_vector_swap (sha512_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha512_update_vector_swap (sha512_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -2378,6 +2411,7 @@ DECLSPEC void sha512_update_vector_swap (sha512_ctx_vector_t *ctx, const u32x *w
sha512_update_vector_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7, len - pos1);
}
DECLSPEC void sha512_update_vector_utf16le (sha512_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha512_update_vector_utf16le (sha512_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -2444,6 +2478,7 @@ DECLSPEC void sha512_update_vector_utf16le (sha512_ctx_vector_t *ctx, const u32x
sha512_update_vector_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7, (len - pos1) * 2);
}
DECLSPEC void sha512_update_vector_utf16le_swap (sha512_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha512_update_vector_utf16le_swap (sha512_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -2576,6 +2611,7 @@ DECLSPEC void sha512_update_vector_utf16le_swap (sha512_ctx_vector_t *ctx, const
sha512_update_vector_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7, (len - pos1) * 2);
}
DECLSPEC void sha512_update_vector_utf16beN (sha512_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha512_update_vector_utf16beN (sha512_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -2642,6 +2678,7 @@ DECLSPEC void sha512_update_vector_utf16beN (sha512_ctx_vector_t *ctx, const u32
sha512_update_vector_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7, (len - pos1) * 2);
}
DECLSPEC void sha512_final_vector (sha512_ctx_vector_t *ctx);
DECLSPEC void sha512_final_vector (sha512_ctx_vector_t *ctx)
{
const int pos = ctx->len & 127;
@ -2701,6 +2738,7 @@ typedef struct sha512_hmac_ctx_vector
} sha512_hmac_ctx_vector_t;
DECLSPEC void sha512_hmac_init_vector_128 (sha512_hmac_ctx_vector_t *ctx, const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, const u32x *w4, const u32x *w5, const u32x *w6, const u32x *w7);
DECLSPEC void sha512_hmac_init_vector_128 (sha512_hmac_ctx_vector_t *ctx, const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, const u32x *w4, const u32x *w5, const u32x *w6, const u32x *w7)
{
u32x t0[4];
@ -2791,6 +2829,7 @@ DECLSPEC void sha512_hmac_init_vector_128 (sha512_hmac_ctx_vector_t *ctx, const
sha512_update_vector_128 (&ctx->opad, t0, t1, t2, t3, t4, t5, t6, t7, 128);
}
DECLSPEC void sha512_hmac_init_vector (sha512_hmac_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha512_hmac_init_vector (sha512_hmac_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -2884,16 +2923,19 @@ DECLSPEC void sha512_hmac_init_vector (sha512_hmac_ctx_vector_t *ctx, const u32x
sha512_hmac_init_vector_128 (ctx, w0, w1, w2, w3, w4, w5, w6, w7);
}
DECLSPEC void sha512_hmac_update_vector_128 (sha512_hmac_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, u32x *w4, u32x *w5, u32x *w6, u32x *w7, const int len);
DECLSPEC void sha512_hmac_update_vector_128 (sha512_hmac_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, u32x *w4, u32x *w5, u32x *w6, u32x *w7, const int len)
{
sha512_update_vector_128 (&ctx->ipad, w0, w1, w2, w3, w4, w5, w6, w7, len);
}
DECLSPEC void sha512_hmac_update_vector (sha512_hmac_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void sha512_hmac_update_vector (sha512_hmac_ctx_vector_t *ctx, const u32x *w, const int len)
{
sha512_update_vector (&ctx->ipad, w, len);
}
DECLSPEC void sha512_hmac_final_vector (sha512_hmac_ctx_vector_t *ctx);
DECLSPEC void sha512_hmac_final_vector (sha512_hmac_ctx_vector_t *ctx)
{
sha512_final_vector (&ctx->ipad);

@ -634,6 +634,7 @@ typedef struct streebog256_ctx
} streebog256_ctx_t;
DECLSPEC void streebog256_init (streebog256_ctx_t *ctx, SHM_TYPE u64a (*s_sbob_sl64)[256]);
DECLSPEC void streebog256_init (streebog256_ctx_t *ctx, SHM_TYPE u64a (*s_sbob_sl64)[256])
{
ctx->h[0] = 0x0101010101010101;
@ -688,6 +689,7 @@ DECLSPEC void streebog256_init (streebog256_ctx_t *ctx, SHM_TYPE u64a (*s_sbob_s
ctx->s_sbob_sl64 = s_sbob_sl64;
}
DECLSPEC void streebog256_add (u64 *x, const u64 *y);
DECLSPEC void streebog256_add (u64 *x, const u64 *y)
{
u64 carry = 0;
@ -707,6 +709,7 @@ DECLSPEC void streebog256_add (u64 *x, const u64 *y)
}
}
DECLSPEC void streebog256_g (u64 *h, const u64 *n, const u64 *m, SHM_TYPE u64a (*s_sbob_sl64)[256]);
DECLSPEC void streebog256_g (u64 *h, const u64 *n, const u64 *m, SHM_TYPE u64a (*s_sbob_sl64)[256])
{
u64 k[8];
@ -775,6 +778,7 @@ DECLSPEC void streebog256_g (u64 *h, const u64 *n, const u64 *m, SHM_TYPE u64a (
}
}
DECLSPEC void streebog256_transform (streebog256_ctx_t *ctx, const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3);
DECLSPEC void streebog256_transform (streebog256_ctx_t *ctx, const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3)
{
u64 m[8];
@ -797,6 +801,7 @@ DECLSPEC void streebog256_transform (streebog256_ctx_t *ctx, const u32 *w0, cons
streebog256_add (ctx->s, m);
}
DECLSPEC void streebog256_update_64 (streebog256_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len);
DECLSPEC void streebog256_update_64 (streebog256_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len)
{
const int pos = ctx->len;
@ -873,6 +878,7 @@ DECLSPEC void streebog256_update_64 (streebog256_ctx_t *ctx, u32 *w0, u32 *w1, u
}
}
DECLSPEC void streebog256_update (streebog256_ctx_t *ctx, const u32 *w, int len);
DECLSPEC void streebog256_update (streebog256_ctx_t *ctx, const u32 *w, int len)
{
u32 w0[4];
@ -930,6 +936,7 @@ DECLSPEC void streebog256_update (streebog256_ctx_t *ctx, const u32 *w, int len)
}
}
DECLSPEC void streebog256_update_swap (streebog256_ctx_t *ctx, const u32 *w, int len);
DECLSPEC void streebog256_update_swap (streebog256_ctx_t *ctx, const u32 *w, int len)
{
u32 w0[4];
@ -987,6 +994,7 @@ DECLSPEC void streebog256_update_swap (streebog256_ctx_t *ctx, const u32 *w, int
}
}
DECLSPEC void streebog256_update_global_swap (streebog256_ctx_t *ctx, const __global u32 *w, int len);
DECLSPEC void streebog256_update_global_swap (streebog256_ctx_t *ctx, const __global u32 *w, int len)
{
u32 w0[4];
@ -1044,6 +1052,7 @@ DECLSPEC void streebog256_update_global_swap (streebog256_ctx_t *ctx, const __gl
}
}
DECLSPEC void streebog256_final (streebog256_ctx_t *ctx);
DECLSPEC void streebog256_final (streebog256_ctx_t *ctx)
{
const int pos = ctx->len & 63;
@ -1084,6 +1093,7 @@ typedef struct streebog256_hmac_ctx
} streebog256_hmac_ctx_t;
DECLSPEC void streebog256_hmac_init_64 (streebog256_hmac_ctx_t *ctx, const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, SHM_TYPE u64a (*s_sbob_sl64)[256]);
DECLSPEC void streebog256_hmac_init_64 (streebog256_hmac_ctx_t *ctx, const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, SHM_TYPE u64a (*s_sbob_sl64)[256])
{
u32 t0[4];
@ -1138,6 +1148,7 @@ DECLSPEC void streebog256_hmac_init_64 (streebog256_hmac_ctx_t *ctx, const u32 *
streebog256_update_64 (&ctx->opad, t0, t1, t2, t3, 64);
}
DECLSPEC void streebog256_hmac_init (streebog256_hmac_ctx_t *ctx, const u32 *w, const int len, SHM_TYPE u64a (*s_sbob_sl64)[256]);
DECLSPEC void streebog256_hmac_init (streebog256_hmac_ctx_t *ctx, const u32 *w, const int len, SHM_TYPE u64a (*s_sbob_sl64)[256])
{
u32 w0[4];
@ -1195,6 +1206,7 @@ DECLSPEC void streebog256_hmac_init (streebog256_hmac_ctx_t *ctx, const u32 *w,
streebog256_hmac_init_64 (ctx, w0, w1, w2, w3, s_sbob_sl64);
}
DECLSPEC void streebog256_hmac_init_swap (streebog256_hmac_ctx_t *ctx, const u32 *w, const int len, SHM_TYPE u64a (*s_sbob_sl64)[256]);
DECLSPEC void streebog256_hmac_init_swap (streebog256_hmac_ctx_t *ctx, const u32 *w, const int len, SHM_TYPE u64a (*s_sbob_sl64)[256])
{
u32 w0[4];
@ -1252,26 +1264,31 @@ DECLSPEC void streebog256_hmac_init_swap (streebog256_hmac_ctx_t *ctx, const u32
streebog256_hmac_init_64 (ctx, w0, w1, w2, w3, s_sbob_sl64);
}
DECLSPEC void streebog256_hmac_update_64 (streebog256_hmac_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len);
DECLSPEC void streebog256_hmac_update_64 (streebog256_hmac_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len)
{
streebog256_update_64 (&ctx->ipad, w0, w1, w2, w3, len);
}
DECLSPEC void streebog256_hmac_update (streebog256_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void streebog256_hmac_update (streebog256_hmac_ctx_t *ctx, const u32 *w, const int len)
{
streebog256_update (&ctx->ipad, w, len);
}
DECLSPEC void streebog256_hmac_update_swap (streebog256_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void streebog256_hmac_update_swap (streebog256_hmac_ctx_t *ctx, const u32 *w, const int len)
{
streebog256_update_swap (&ctx->ipad, w, len);
}
DECLSPEC void streebog256_hmac_update_global_swap (streebog256_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void streebog256_hmac_update_global_swap (streebog256_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
streebog256_update_global_swap (&ctx->ipad, w, len);
}
DECLSPEC void streebog256_hmac_final (streebog256_hmac_ctx_t *ctx);
DECLSPEC void streebog256_hmac_final (streebog256_hmac_ctx_t *ctx)
{
streebog256_final (&ctx->ipad);
@ -1322,6 +1339,7 @@ typedef struct streebog256_ctx_vector
} streebog256_ctx_vector_t;
DECLSPEC void streebog256_init_vector (streebog256_ctx_vector_t *ctx, SHM_TYPE u64a (*s_sbob_sl64)[256]);
DECLSPEC void streebog256_init_vector (streebog256_ctx_vector_t *ctx, SHM_TYPE u64a (*s_sbob_sl64)[256])
{
ctx->h[0] = 0x0101010101010101;
@ -1376,6 +1394,7 @@ DECLSPEC void streebog256_init_vector (streebog256_ctx_vector_t *ctx, SHM_TYPE u
ctx->s_sbob_sl64 = s_sbob_sl64;
}
DECLSPEC void streebog256_add_vector (u64x *x, const u64x *y);
DECLSPEC void streebog256_add_vector (u64x *x, const u64x *y)
{
u64x carry = 0;
@ -1395,6 +1414,7 @@ DECLSPEC void streebog256_add_vector (u64x *x, const u64x *y)
}
}
DECLSPEC void streebog256_g_vector (u64x *h, const u64x *n, const u64x *m, SHM_TYPE u64a (*s_sbob_sl64)[256]);
DECLSPEC void streebog256_g_vector (u64x *h, const u64x *n, const u64x *m, SHM_TYPE u64a (*s_sbob_sl64)[256])
{
u64x k[8];
@ -1463,6 +1483,7 @@ DECLSPEC void streebog256_g_vector (u64x *h, const u64x *n, const u64x *m, SHM_T
}
}
DECLSPEC void streebog256_transform_vector (streebog256_ctx_vector_t *ctx, const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3);
DECLSPEC void streebog256_transform_vector (streebog256_ctx_vector_t *ctx, const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3)
{
u64x m[8];
@ -1485,6 +1506,7 @@ DECLSPEC void streebog256_transform_vector (streebog256_ctx_vector_t *ctx, const
streebog256_add_vector (ctx->s, m);
}
DECLSPEC void streebog256_update_vector_64 (streebog256_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len);
DECLSPEC void streebog256_update_vector_64 (streebog256_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len)
{
const int pos = ctx->len;
@ -1561,6 +1583,7 @@ DECLSPEC void streebog256_update_vector_64 (streebog256_ctx_vector_t *ctx, u32x
}
}
DECLSPEC void streebog256_update_vector (streebog256_ctx_vector_t *ctx, const u32x *w, int len);
DECLSPEC void streebog256_update_vector (streebog256_ctx_vector_t *ctx, const u32x *w, int len)
{
u32x w0[4];
@ -1618,6 +1641,7 @@ DECLSPEC void streebog256_update_vector (streebog256_ctx_vector_t *ctx, const u3
}
}
DECLSPEC void streebog256_update_vector_swap (streebog256_ctx_vector_t *ctx, const u32x *w, int len);
DECLSPEC void streebog256_update_vector_swap (streebog256_ctx_vector_t *ctx, const u32x *w, int len)
{
u32x w0[4];
@ -1675,6 +1699,7 @@ DECLSPEC void streebog256_update_vector_swap (streebog256_ctx_vector_t *ctx, con
}
}
DECLSPEC void streebog256_final_vector (streebog256_ctx_vector_t *ctx);
DECLSPEC void streebog256_final_vector (streebog256_ctx_vector_t *ctx)
{
const int pos = ctx->len & 63;
@ -1715,6 +1740,7 @@ typedef struct streebog256_hmac_ctx_vector
} streebog256_hmac_ctx_vector_t;
DECLSPEC void streebog256_hmac_init_vector_64 (streebog256_hmac_ctx_vector_t *ctx, const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, SHM_TYPE u64a (*s_sbob_sl64)[256]);
DECLSPEC void streebog256_hmac_init_vector_64 (streebog256_hmac_ctx_vector_t *ctx, const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, SHM_TYPE u64a (*s_sbob_sl64)[256])
{
u32x t0[4];
@ -1769,6 +1795,7 @@ DECLSPEC void streebog256_hmac_init_vector_64 (streebog256_hmac_ctx_vector_t *ct
streebog256_update_vector_64 (&ctx->opad, t0, t1, t2, t3, 64);
}
DECLSPEC void streebog256_hmac_init_vector (streebog256_hmac_ctx_vector_t *ctx, const u32x *w, const int len, SHM_TYPE u64a (*s_sbob_sl64)[256]);
DECLSPEC void streebog256_hmac_init_vector (streebog256_hmac_ctx_vector_t *ctx, const u32x *w, const int len, SHM_TYPE u64a (*s_sbob_sl64)[256])
{
u32x w0[4];
@ -1826,6 +1853,7 @@ DECLSPEC void streebog256_hmac_init_vector (streebog256_hmac_ctx_vector_t *ctx,
streebog256_hmac_init_vector_64 (ctx, w0, w1, w2, w3, s_sbob_sl64);
}
DECLSPEC void streebog256_hmac_init_vector_swap (streebog256_hmac_ctx_vector_t *ctx, const u32x *w, const int len, SHM_TYPE u64a (*s_sbob_sl64)[256]);
DECLSPEC void streebog256_hmac_init_vector_swap (streebog256_hmac_ctx_vector_t *ctx, const u32x *w, const int len, SHM_TYPE u64a (*s_sbob_sl64)[256])
{
u32x w0[4];
@ -1883,16 +1911,19 @@ DECLSPEC void streebog256_hmac_init_vector_swap (streebog256_hmac_ctx_vector_t *
streebog256_hmac_init_vector_64 (ctx, w0, w1, w2, w3, s_sbob_sl64);
}
DECLSPEC void streebog256_hmac_update_vector (streebog256_hmac_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void streebog256_hmac_update_vector (streebog256_hmac_ctx_vector_t *ctx, const u32x *w, const int len)
{
streebog256_update_vector (&ctx->ipad, w, len);
}
DECLSPEC void streebog256_hmac_update_vector_swap (streebog256_hmac_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void streebog256_hmac_update_vector_swap (streebog256_hmac_ctx_vector_t *ctx, const u32x *w, const int len)
{
streebog256_update_vector_swap (&ctx->ipad, w, len);
}
DECLSPEC void streebog256_hmac_final_vector (streebog256_hmac_ctx_vector_t *ctx);
DECLSPEC void streebog256_hmac_final_vector (streebog256_hmac_ctx_vector_t *ctx)
{
streebog256_final_vector (&ctx->ipad);

@ -634,6 +634,7 @@ typedef struct streebog512_ctx
} streebog512_ctx_t;
DECLSPEC void streebog512_init (streebog512_ctx_t *ctx, SHM_TYPE u64a (*s_sbob_sl64)[256]);
DECLSPEC void streebog512_init (streebog512_ctx_t *ctx, SHM_TYPE u64a (*s_sbob_sl64)[256])
{
ctx->h[0] = 0;
@ -688,6 +689,7 @@ DECLSPEC void streebog512_init (streebog512_ctx_t *ctx, SHM_TYPE u64a (*s_sbob_s
ctx->s_sbob_sl64 = s_sbob_sl64;
}
DECLSPEC void streebog512_add (u64 *x, const u64 *y);
DECLSPEC void streebog512_add (u64 *x, const u64 *y)
{
u64 carry = 0;
@ -707,6 +709,7 @@ DECLSPEC void streebog512_add (u64 *x, const u64 *y)
}
}
DECLSPEC void streebog512_g (u64 *h, const u64 *n, const u64 *m, SHM_TYPE u64a (*s_sbob_sl64)[256]);
DECLSPEC void streebog512_g (u64 *h, const u64 *n, const u64 *m, SHM_TYPE u64a (*s_sbob_sl64)[256])
{
u64 k[8];
@ -775,6 +778,7 @@ DECLSPEC void streebog512_g (u64 *h, const u64 *n, const u64 *m, SHM_TYPE u64a (
}
}
DECLSPEC void streebog512_transform (streebog512_ctx_t *ctx, const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3);
DECLSPEC void streebog512_transform (streebog512_ctx_t *ctx, const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3)
{
u64 m[8];
@ -797,6 +801,7 @@ DECLSPEC void streebog512_transform (streebog512_ctx_t *ctx, const u32 *w0, cons
streebog512_add (ctx->s, m);
}
DECLSPEC void streebog512_update_64 (streebog512_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len);
DECLSPEC void streebog512_update_64 (streebog512_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len)
{
const int pos = ctx->len;
@ -873,6 +878,7 @@ DECLSPEC void streebog512_update_64 (streebog512_ctx_t *ctx, u32 *w0, u32 *w1, u
}
}
DECLSPEC void streebog512_update (streebog512_ctx_t *ctx, const u32 *w, int len);
DECLSPEC void streebog512_update (streebog512_ctx_t *ctx, const u32 *w, int len)
{
u32 w0[4];
@ -930,6 +936,7 @@ DECLSPEC void streebog512_update (streebog512_ctx_t *ctx, const u32 *w, int len)
}
}
DECLSPEC void streebog512_update_swap (streebog512_ctx_t *ctx, const u32 *w, int len);
DECLSPEC void streebog512_update_swap (streebog512_ctx_t *ctx, const u32 *w, int len)
{
u32 w0[4];
@ -987,6 +994,7 @@ DECLSPEC void streebog512_update_swap (streebog512_ctx_t *ctx, const u32 *w, int
}
}
DECLSPEC void streebog512_update_global_swap (streebog512_ctx_t *ctx, const __global u32 *w, int len);
DECLSPEC void streebog512_update_global_swap (streebog512_ctx_t *ctx, const __global u32 *w, int len)
{
u32 w0[4];
@ -1044,6 +1052,7 @@ DECLSPEC void streebog512_update_global_swap (streebog512_ctx_t *ctx, const __gl
}
}
DECLSPEC void streebog512_final (streebog512_ctx_t *ctx);
DECLSPEC void streebog512_final (streebog512_ctx_t *ctx)
{
const int pos = ctx->len & 63;
@ -1084,6 +1093,7 @@ typedef struct streebog512_hmac_ctx
} streebog512_hmac_ctx_t;
DECLSPEC void streebog512_hmac_init_64 (streebog512_hmac_ctx_t *ctx, const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, SHM_TYPE u64a (*s_sbob_sl64)[256]);
DECLSPEC void streebog512_hmac_init_64 (streebog512_hmac_ctx_t *ctx, const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, SHM_TYPE u64a (*s_sbob_sl64)[256])
{
u32 t0[4];
@ -1138,6 +1148,7 @@ DECLSPEC void streebog512_hmac_init_64 (streebog512_hmac_ctx_t *ctx, const u32 *
streebog512_update_64 (&ctx->opad, t0, t1, t2, t3, 64);
}
DECLSPEC void streebog512_hmac_init (streebog512_hmac_ctx_t *ctx, const u32 *w, const int len, SHM_TYPE u64a (*s_sbob_sl64)[256]);
DECLSPEC void streebog512_hmac_init (streebog512_hmac_ctx_t *ctx, const u32 *w, const int len, SHM_TYPE u64a (*s_sbob_sl64)[256])
{
u32 w0[4];
@ -1195,6 +1206,7 @@ DECLSPEC void streebog512_hmac_init (streebog512_hmac_ctx_t *ctx, const u32 *w,
streebog512_hmac_init_64 (ctx, w0, w1, w2, w3, s_sbob_sl64);
}
DECLSPEC void streebog512_hmac_init_swap (streebog512_hmac_ctx_t *ctx, const u32 *w, const int len, SHM_TYPE u64a (*s_sbob_sl64)[256]);
DECLSPEC void streebog512_hmac_init_swap (streebog512_hmac_ctx_t *ctx, const u32 *w, const int len, SHM_TYPE u64a (*s_sbob_sl64)[256])
{
u32 w0[4];
@ -1252,26 +1264,31 @@ DECLSPEC void streebog512_hmac_init_swap (streebog512_hmac_ctx_t *ctx, const u32
streebog512_hmac_init_64 (ctx, w0, w1, w2, w3, s_sbob_sl64);
}
DECLSPEC void streebog512_hmac_update_64 (streebog512_hmac_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len);
DECLSPEC void streebog512_hmac_update_64 (streebog512_hmac_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len)
{
streebog512_update_64 (&ctx->ipad, w0, w1, w2, w3, len);
}
DECLSPEC void streebog512_hmac_update (streebog512_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void streebog512_hmac_update (streebog512_hmac_ctx_t *ctx, const u32 *w, const int len)
{
streebog512_update (&ctx->ipad, w, len);
}
DECLSPEC void streebog512_hmac_update_swap (streebog512_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void streebog512_hmac_update_swap (streebog512_hmac_ctx_t *ctx, const u32 *w, const int len)
{
streebog512_update_swap (&ctx->ipad, w, len);
}
DECLSPEC void streebog512_hmac_update_global_swap (streebog512_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void streebog512_hmac_update_global_swap (streebog512_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
streebog512_update_global_swap (&ctx->ipad, w, len);
}
DECLSPEC void streebog512_hmac_final (streebog512_hmac_ctx_t *ctx);
DECLSPEC void streebog512_hmac_final (streebog512_hmac_ctx_t *ctx)
{
streebog512_final (&ctx->ipad);
@ -1322,6 +1339,7 @@ typedef struct streebog512_ctx_vector
} streebog512_ctx_vector_t;
DECLSPEC void streebog512_init_vector (streebog512_ctx_vector_t *ctx, SHM_TYPE u64a (*s_sbob_sl64)[256]);
DECLSPEC void streebog512_init_vector (streebog512_ctx_vector_t *ctx, SHM_TYPE u64a (*s_sbob_sl64)[256])
{
ctx->h[0] = 0;
@ -1376,6 +1394,7 @@ DECLSPEC void streebog512_init_vector (streebog512_ctx_vector_t *ctx, SHM_TYPE u
ctx->s_sbob_sl64 = s_sbob_sl64;
}
DECLSPEC void streebog512_add_vector (u64x *x, const u64x *y);
DECLSPEC void streebog512_add_vector (u64x *x, const u64x *y)
{
u64x carry = 0;
@ -1395,6 +1414,7 @@ DECLSPEC void streebog512_add_vector (u64x *x, const u64x *y)
}
}
DECLSPEC void streebog512_g_vector (u64x *h, const u64x *n, const u64x *m, SHM_TYPE u64a (*s_sbob_sl64)[256]);
DECLSPEC void streebog512_g_vector (u64x *h, const u64x *n, const u64x *m, SHM_TYPE u64a (*s_sbob_sl64)[256])
{
u64x k[8];
@ -1463,6 +1483,7 @@ DECLSPEC void streebog512_g_vector (u64x *h, const u64x *n, const u64x *m, SHM_T
}
}
DECLSPEC void streebog512_transform_vector (streebog512_ctx_vector_t *ctx, const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3);
DECLSPEC void streebog512_transform_vector (streebog512_ctx_vector_t *ctx, const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3)
{
u64x m[8];
@ -1485,6 +1506,7 @@ DECLSPEC void streebog512_transform_vector (streebog512_ctx_vector_t *ctx, const
streebog512_add_vector (ctx->s, m);
}
DECLSPEC void streebog512_update_vector_64 (streebog512_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len);
DECLSPEC void streebog512_update_vector_64 (streebog512_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len)
{
const int pos = ctx->len;
@ -1561,6 +1583,7 @@ DECLSPEC void streebog512_update_vector_64 (streebog512_ctx_vector_t *ctx, u32x
}
}
DECLSPEC void streebog512_update_vector (streebog512_ctx_vector_t *ctx, const u32x *w, int len);
DECLSPEC void streebog512_update_vector (streebog512_ctx_vector_t *ctx, const u32x *w, int len)
{
u32x w0[4];
@ -1618,6 +1641,7 @@ DECLSPEC void streebog512_update_vector (streebog512_ctx_vector_t *ctx, const u3
}
}
DECLSPEC void streebog512_update_vector_swap (streebog512_ctx_vector_t *ctx, const u32x *w, int len);
DECLSPEC void streebog512_update_vector_swap (streebog512_ctx_vector_t *ctx, const u32x *w, int len)
{
u32x w0[4];
@ -1675,6 +1699,7 @@ DECLSPEC void streebog512_update_vector_swap (streebog512_ctx_vector_t *ctx, con
}
}
DECLSPEC void streebog512_final_vector (streebog512_ctx_vector_t *ctx);
DECLSPEC void streebog512_final_vector (streebog512_ctx_vector_t *ctx)
{
const int pos = ctx->len & 63;
@ -1715,6 +1740,7 @@ typedef struct streebog512_hmac_ctx_vector
} streebog512_hmac_ctx_vector_t;
DECLSPEC void streebog512_hmac_init_vector_64 (streebog512_hmac_ctx_vector_t *ctx, const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, SHM_TYPE u64a (*s_sbob_sl64)[256]);
DECLSPEC void streebog512_hmac_init_vector_64 (streebog512_hmac_ctx_vector_t *ctx, const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, SHM_TYPE u64a (*s_sbob_sl64)[256])
{
u32x t0[4];
@ -1769,6 +1795,7 @@ DECLSPEC void streebog512_hmac_init_vector_64 (streebog512_hmac_ctx_vector_t *ct
streebog512_update_vector_64 (&ctx->opad, t0, t1, t2, t3, 64);
}
DECLSPEC void streebog512_hmac_init_vector (streebog512_hmac_ctx_vector_t *ctx, const u32x *w, const int len, SHM_TYPE u64a (*s_sbob_sl64)[256]);
DECLSPEC void streebog512_hmac_init_vector (streebog512_hmac_ctx_vector_t *ctx, const u32x *w, const int len, SHM_TYPE u64a (*s_sbob_sl64)[256])
{
u32x w0[4];
@ -1826,6 +1853,7 @@ DECLSPEC void streebog512_hmac_init_vector (streebog512_hmac_ctx_vector_t *ctx,
streebog512_hmac_init_vector_64 (ctx, w0, w1, w2, w3, s_sbob_sl64);
}
DECLSPEC void streebog512_hmac_init_vector_swap (streebog512_hmac_ctx_vector_t *ctx, const u32x *w, const int len, SHM_TYPE u64a (*s_sbob_sl64)[256]);
DECLSPEC void streebog512_hmac_init_vector_swap (streebog512_hmac_ctx_vector_t *ctx, const u32x *w, const int len, SHM_TYPE u64a (*s_sbob_sl64)[256])
{
u32x w0[4];
@ -1883,16 +1911,19 @@ DECLSPEC void streebog512_hmac_init_vector_swap (streebog512_hmac_ctx_vector_t *
streebog512_hmac_init_vector_64 (ctx, w0, w1, w2, w3, s_sbob_sl64);
}
DECLSPEC void streebog512_hmac_update_vector (streebog512_hmac_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void streebog512_hmac_update_vector (streebog512_hmac_ctx_vector_t *ctx, const u32x *w, const int len)
{
streebog512_update_vector (&ctx->ipad, w, len);
}
DECLSPEC void streebog512_hmac_update_vector_swap (streebog512_hmac_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void streebog512_hmac_update_vector_swap (streebog512_hmac_ctx_vector_t *ctx, const u32x *w, const int len)
{
streebog512_update_vector_swap (&ctx->ipad, w, len);
}
DECLSPEC void streebog512_hmac_final_vector (streebog512_hmac_ctx_vector_t *ctx);
DECLSPEC void streebog512_hmac_final_vector (streebog512_hmac_ctx_vector_t *ctx)
{
streebog512_final_vector (&ctx->ipad);

@ -1130,6 +1130,7 @@ typedef struct whirlpool_ctx
} whirlpool_ctx_t;
DECLSPEC void whirlpool_transform (const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, u32 *digest, __local u32 (*s_Ch)[256], __local u32 (*s_Cl)[256]);
DECLSPEC void whirlpool_transform (const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, u32 *digest, __local u32 (*s_Ch)[256], __local u32 (*s_Cl)[256])
{
u32 Kh[8];
@ -1300,6 +1301,7 @@ DECLSPEC void whirlpool_transform (const u32 *w0, const u32 *w1, const u32 *w2,
digest[15] ^= statel[7] ^ w3[3];
}
DECLSPEC void whirlpool_init (whirlpool_ctx_t *ctx, __local u32 (*s_Ch)[256], __local u32 (*s_Cl)[256]);
DECLSPEC void whirlpool_init (whirlpool_ctx_t *ctx, __local u32 (*s_Ch)[256], __local u32 (*s_Cl)[256])
{
ctx->h[ 0] = 0;
@ -1342,6 +1344,7 @@ DECLSPEC void whirlpool_init (whirlpool_ctx_t *ctx, __local u32 (*s_Ch)[256], __
ctx->s_Cl = s_Cl;
}
DECLSPEC void whirlpool_update_64 (whirlpool_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len);
DECLSPEC void whirlpool_update_64 (whirlpool_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len)
{
const int pos = ctx->len & 63;
@ -1416,6 +1419,7 @@ DECLSPEC void whirlpool_update_64 (whirlpool_ctx_t *ctx, u32 *w0, u32 *w1, u32 *
}
}
DECLSPEC void whirlpool_update (whirlpool_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void whirlpool_update (whirlpool_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -1468,6 +1472,7 @@ DECLSPEC void whirlpool_update (whirlpool_ctx_t *ctx, const u32 *w, const int le
whirlpool_update_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void whirlpool_update_swap (whirlpool_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void whirlpool_update_swap (whirlpool_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -1554,6 +1559,7 @@ DECLSPEC void whirlpool_update_swap (whirlpool_ctx_t *ctx, const u32 *w, const i
whirlpool_update_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void whirlpool_update_utf16le (whirlpool_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void whirlpool_update_utf16le (whirlpool_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -1596,6 +1602,7 @@ DECLSPEC void whirlpool_update_utf16le (whirlpool_ctx_t *ctx, const u32 *w, cons
whirlpool_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void whirlpool_update_utf16le_swap (whirlpool_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void whirlpool_update_utf16le_swap (whirlpool_ctx_t *ctx, const u32 *w, const int len)
{
u32 w0[4];
@ -1672,6 +1679,7 @@ DECLSPEC void whirlpool_update_utf16le_swap (whirlpool_ctx_t *ctx, const u32 *w,
whirlpool_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void whirlpool_update_global (whirlpool_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void whirlpool_update_global (whirlpool_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -1724,6 +1732,7 @@ DECLSPEC void whirlpool_update_global (whirlpool_ctx_t *ctx, const __global u32
whirlpool_update_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void whirlpool_update_global_swap (whirlpool_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void whirlpool_update_global_swap (whirlpool_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -1810,6 +1819,7 @@ DECLSPEC void whirlpool_update_global_swap (whirlpool_ctx_t *ctx, const __global
whirlpool_update_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void whirlpool_update_global_utf16le (whirlpool_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void whirlpool_update_global_utf16le (whirlpool_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -1852,6 +1862,7 @@ DECLSPEC void whirlpool_update_global_utf16le (whirlpool_ctx_t *ctx, const __glo
whirlpool_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void whirlpool_update_global_utf16le_swap (whirlpool_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void whirlpool_update_global_utf16le_swap (whirlpool_ctx_t *ctx, const __global u32 *w, const int len)
{
u32 w0[4];
@ -1928,6 +1939,7 @@ DECLSPEC void whirlpool_update_global_utf16le_swap (whirlpool_ctx_t *ctx, const
whirlpool_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void whirlpool_final (whirlpool_ctx_t *ctx);
DECLSPEC void whirlpool_final (whirlpool_ctx_t *ctx)
{
const int pos = ctx->len & 63;
@ -1971,6 +1983,7 @@ typedef struct whirlpool_hmac_ctx
} whirlpool_hmac_ctx_t;
DECLSPEC void whirlpool_hmac_init_64 (whirlpool_hmac_ctx_t *ctx, const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, __local u32 (*s_Ch)[256], __local u32 (*s_Cl)[256]);
DECLSPEC void whirlpool_hmac_init_64 (whirlpool_hmac_ctx_t *ctx, const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, __local u32 (*s_Ch)[256], __local u32 (*s_Cl)[256])
{
u32 t0[4];
@ -2025,6 +2038,7 @@ DECLSPEC void whirlpool_hmac_init_64 (whirlpool_hmac_ctx_t *ctx, const u32 *w0,
whirlpool_update_64 (&ctx->opad, t0, t1, t2, t3, 64);
}
DECLSPEC void whirlpool_hmac_init (whirlpool_hmac_ctx_t *ctx, const u32 *w, const int len, __local u32 (*s_Ch)[256], __local u32 (*s_Cl)[256]);
DECLSPEC void whirlpool_hmac_init (whirlpool_hmac_ctx_t *ctx, const u32 *w, const int len, __local u32 (*s_Ch)[256], __local u32 (*s_Cl)[256])
{
u32 w0[4];
@ -2082,6 +2096,7 @@ DECLSPEC void whirlpool_hmac_init (whirlpool_hmac_ctx_t *ctx, const u32 *w, cons
whirlpool_hmac_init_64 (ctx, w0, w1, w2, w3, s_Ch, s_Cl);
}
DECLSPEC void whirlpool_hmac_init_swap (whirlpool_hmac_ctx_t *ctx, const u32 *w, const int len, __local u32 (*s_Ch)[256], __local u32 (*s_Cl)[256]);
DECLSPEC void whirlpool_hmac_init_swap (whirlpool_hmac_ctx_t *ctx, const u32 *w, const int len, __local u32 (*s_Ch)[256], __local u32 (*s_Cl)[256])
{
u32 w0[4];
@ -2139,6 +2154,7 @@ DECLSPEC void whirlpool_hmac_init_swap (whirlpool_hmac_ctx_t *ctx, const u32 *w,
whirlpool_hmac_init_64 (ctx, w0, w1, w2, w3, s_Ch, s_Cl);
}
DECLSPEC void whirlpool_hmac_init_global (whirlpool_hmac_ctx_t *ctx, __global const u32 *w, const int len, __local u32 (*s_Ch)[256], __local u32 (*s_Cl)[256]);
DECLSPEC void whirlpool_hmac_init_global (whirlpool_hmac_ctx_t *ctx, __global const u32 *w, const int len, __local u32 (*s_Ch)[256], __local u32 (*s_Cl)[256])
{
u32 w0[4];
@ -2196,6 +2212,7 @@ DECLSPEC void whirlpool_hmac_init_global (whirlpool_hmac_ctx_t *ctx, __global co
whirlpool_hmac_init_64 (ctx, w0, w1, w2, w3, s_Ch, s_Cl);
}
DECLSPEC void whirlpool_hmac_init_global_swap (whirlpool_hmac_ctx_t *ctx, __global const u32 *w, const int len, __local u32 (*s_Ch)[256], __local u32 (*s_Cl)[256]);
DECLSPEC void whirlpool_hmac_init_global_swap (whirlpool_hmac_ctx_t *ctx, __global const u32 *w, const int len, __local u32 (*s_Ch)[256], __local u32 (*s_Cl)[256])
{
u32 w0[4];
@ -2253,51 +2270,61 @@ DECLSPEC void whirlpool_hmac_init_global_swap (whirlpool_hmac_ctx_t *ctx, __glob
whirlpool_hmac_init_64 (ctx, w0, w1, w2, w3, s_Ch, s_Cl);
}
DECLSPEC void whirlpool_hmac_update_64 (whirlpool_hmac_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len);
DECLSPEC void whirlpool_hmac_update_64 (whirlpool_hmac_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len)
{
whirlpool_update_64 (&ctx->ipad, w0, w1, w2, w3, len);
}
DECLSPEC void whirlpool_hmac_update (whirlpool_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void whirlpool_hmac_update (whirlpool_hmac_ctx_t *ctx, const u32 *w, const int len)
{
whirlpool_update (&ctx->ipad, w, len);
}
DECLSPEC void whirlpool_hmac_update_swap (whirlpool_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void whirlpool_hmac_update_swap (whirlpool_hmac_ctx_t *ctx, const u32 *w, const int len)
{
whirlpool_update_swap (&ctx->ipad, w, len);
}
DECLSPEC void whirlpool_hmac_update_utf16le (whirlpool_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void whirlpool_hmac_update_utf16le (whirlpool_hmac_ctx_t *ctx, const u32 *w, const int len)
{
whirlpool_update_utf16le (&ctx->ipad, w, len);
}
DECLSPEC void whirlpool_hmac_update_utf16le_swap (whirlpool_hmac_ctx_t *ctx, const u32 *w, const int len);
DECLSPEC void whirlpool_hmac_update_utf16le_swap (whirlpool_hmac_ctx_t *ctx, const u32 *w, const int len)
{
whirlpool_update_utf16le_swap (&ctx->ipad, w, len);
}
DECLSPEC void whirlpool_hmac_update_global (whirlpool_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void whirlpool_hmac_update_global (whirlpool_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
whirlpool_update_global (&ctx->ipad, w, len);
}
DECLSPEC void whirlpool_hmac_update_global_swap (whirlpool_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void whirlpool_hmac_update_global_swap (whirlpool_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
whirlpool_update_global_swap (&ctx->ipad, w, len);
}
DECLSPEC void whirlpool_hmac_update_global_utf16le (whirlpool_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void whirlpool_hmac_update_global_utf16le (whirlpool_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
whirlpool_update_global_utf16le (&ctx->ipad, w, len);
}
DECLSPEC void whirlpool_hmac_update_global_utf16le_swap (whirlpool_hmac_ctx_t *ctx, const __global u32 *w, const int len);
DECLSPEC void whirlpool_hmac_update_global_utf16le_swap (whirlpool_hmac_ctx_t *ctx, const __global u32 *w, const int len)
{
whirlpool_update_global_utf16le_swap (&ctx->ipad, w, len);
}
DECLSPEC void whirlpool_hmac_final (whirlpool_hmac_ctx_t *ctx);
DECLSPEC void whirlpool_hmac_final (whirlpool_hmac_ctx_t *ctx)
{
whirlpool_final (&ctx->ipad);
@ -2347,6 +2374,7 @@ typedef struct whirlpool_ctx_vector
} whirlpool_ctx_vector_t;
DECLSPEC void whirlpool_transform_vector (const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, u32x *digest, __local u32 (*s_Ch)[256], __local u32 (*s_Cl)[256]);
DECLSPEC void whirlpool_transform_vector (const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, u32x *digest, __local u32 (*s_Ch)[256], __local u32 (*s_Cl)[256])
{
u32x Kh[8];
@ -2517,6 +2545,7 @@ DECLSPEC void whirlpool_transform_vector (const u32x *w0, const u32x *w1, const
digest[15] ^= statel[7] ^ w3[3];
}
DECLSPEC void whirlpool_init_vector (whirlpool_ctx_vector_t *ctx, __local u32 (*s_Ch)[256], __local u32 (*s_Cl)[256]);
DECLSPEC void whirlpool_init_vector (whirlpool_ctx_vector_t *ctx, __local u32 (*s_Ch)[256], __local u32 (*s_Cl)[256])
{
ctx->h[ 0] = 0;
@ -2559,6 +2588,7 @@ DECLSPEC void whirlpool_init_vector (whirlpool_ctx_vector_t *ctx, __local u32 (*
ctx->s_Cl = s_Cl;
}
DECLSPEC void whirlpool_init_vector_from_scalar (whirlpool_ctx_vector_t *ctx, whirlpool_ctx_t *ctx0);
DECLSPEC void whirlpool_init_vector_from_scalar (whirlpool_ctx_vector_t *ctx, whirlpool_ctx_t *ctx0)
{
ctx->h[ 0] = ctx0->h[ 0];
@ -2601,6 +2631,7 @@ DECLSPEC void whirlpool_init_vector_from_scalar (whirlpool_ctx_vector_t *ctx, wh
ctx->s_Cl = ctx0->s_Cl;
}
DECLSPEC void whirlpool_update_vector_64 (whirlpool_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len);
DECLSPEC void whirlpool_update_vector_64 (whirlpool_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len)
{
const int pos = ctx->len & 63;
@ -2675,6 +2706,7 @@ DECLSPEC void whirlpool_update_vector_64 (whirlpool_ctx_vector_t *ctx, u32x *w0,
}
}
DECLSPEC void whirlpool_update_vector (whirlpool_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void whirlpool_update_vector (whirlpool_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -2727,6 +2759,7 @@ DECLSPEC void whirlpool_update_vector (whirlpool_ctx_vector_t *ctx, const u32x *
whirlpool_update_vector_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void whirlpool_update_vector_swap (whirlpool_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void whirlpool_update_vector_swap (whirlpool_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -2813,6 +2846,7 @@ DECLSPEC void whirlpool_update_vector_swap (whirlpool_ctx_vector_t *ctx, const u
whirlpool_update_vector_64 (ctx, w0, w1, w2, w3, len - pos1);
}
DECLSPEC void whirlpool_update_vector_utf16le (whirlpool_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void whirlpool_update_vector_utf16le (whirlpool_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -2855,6 +2889,7 @@ DECLSPEC void whirlpool_update_vector_utf16le (whirlpool_ctx_vector_t *ctx, cons
whirlpool_update_vector_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void whirlpool_update_vector_utf16le_swap (whirlpool_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void whirlpool_update_vector_utf16le_swap (whirlpool_ctx_vector_t *ctx, const u32x *w, const int len)
{
u32x w0[4];
@ -2931,6 +2966,7 @@ DECLSPEC void whirlpool_update_vector_utf16le_swap (whirlpool_ctx_vector_t *ctx,
whirlpool_update_vector_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2);
}
DECLSPEC void whirlpool_final_vector (whirlpool_ctx_vector_t *ctx);
DECLSPEC void whirlpool_final_vector (whirlpool_ctx_vector_t *ctx)
{
const int pos = ctx->len & 63;
@ -2974,6 +3010,7 @@ typedef struct whirlpool_hmac_ctx_vector
} whirlpool_hmac_ctx_vector_t;
DECLSPEC void whirlpool_hmac_init_vector_64 (whirlpool_hmac_ctx_vector_t *ctx, const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, __local u32 (*s_Ch)[256], __local u32 (*s_Cl)[256]);
DECLSPEC void whirlpool_hmac_init_vector_64 (whirlpool_hmac_ctx_vector_t *ctx, const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, __local u32 (*s_Ch)[256], __local u32 (*s_Cl)[256])
{
u32x t0[4];
@ -3028,6 +3065,7 @@ DECLSPEC void whirlpool_hmac_init_vector_64 (whirlpool_hmac_ctx_vector_t *ctx, c
whirlpool_update_vector_64 (&ctx->opad, t0, t1, t2, t3, 64);
}
DECLSPEC void whirlpool_hmac_init_vector (whirlpool_hmac_ctx_vector_t *ctx, const u32x *w, const int len, __local u32 (*s_Ch)[256], __local u32 (*s_Cl)[256]);
DECLSPEC void whirlpool_hmac_init_vector (whirlpool_hmac_ctx_vector_t *ctx, const u32x *w, const int len, __local u32 (*s_Ch)[256], __local u32 (*s_Cl)[256])
{
u32x w0[4];
@ -3085,16 +3123,19 @@ DECLSPEC void whirlpool_hmac_init_vector (whirlpool_hmac_ctx_vector_t *ctx, cons
whirlpool_hmac_init_vector_64 (ctx, w0, w1, w2, w3, s_Ch, s_Cl);
}
DECLSPEC void whirlpool_hmac_update_vector_64 (whirlpool_hmac_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len);
DECLSPEC void whirlpool_hmac_update_vector_64 (whirlpool_hmac_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len)
{
whirlpool_update_vector_64 (&ctx->ipad, w0, w1, w2, w3, len);
}
DECLSPEC void whirlpool_hmac_update_vector (whirlpool_hmac_ctx_vector_t *ctx, const u32x *w, const int len);
DECLSPEC void whirlpool_hmac_update_vector (whirlpool_hmac_ctx_vector_t *ctx, const u32x *w, const int len)
{
whirlpool_update_vector (&ctx->ipad, w, len);
}
DECLSPEC void whirlpool_hmac_final_vector (whirlpool_hmac_ctx_vector_t *ctx);
DECLSPEC void whirlpool_hmac_final_vector (whirlpool_hmac_ctx_vector_t *ctx)
{
whirlpool_final_vector (&ctx->ipad);

@ -1,6 +1,7 @@
// cbc-essiv
DECLSPEC void aes128_decrypt_cbc (const u32 *ks1, const u32 *in, u32 *out, u32 *essiv, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void aes128_decrypt_cbc (const u32 *ks1, const u32 *in, u32 *out, u32 *essiv, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
aes128_decrypt (ks1, in, out, s_td0, s_td1, s_td2, s_td3, s_td4);
@ -16,6 +17,7 @@ DECLSPEC void aes128_decrypt_cbc (const u32 *ks1, const u32 *in, u32 *out, u32 *
essiv[3] = in[3];
}
DECLSPEC void aes256_decrypt_cbc (const u32 *ks1, const u32 *in, u32 *out, u32 *essiv, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void aes256_decrypt_cbc (const u32 *ks1, const u32 *in, u32 *out, u32 *essiv, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
aes256_decrypt (ks1, in, out, s_td0, s_td1, s_td2, s_td3, s_td4);
@ -31,6 +33,7 @@ DECLSPEC void aes256_decrypt_cbc (const u32 *ks1, const u32 *in, u32 *out, u32 *
essiv[3] = in[3];
}
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv128 (__global const u32 *in, u32 *out, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv128 (__global const u32 *in, u32 *out, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -65,6 +68,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_essiv128 (__global const u32 *in, u32
}
}
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv128_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv128_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -102,6 +106,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_essiv128_mk_sha1 (__global const u32 *
}
}
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv128_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv128_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -162,6 +167,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_essiv128_mk_sha1_final (__global const
}
}
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv128_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv128_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -199,6 +205,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_essiv128_mk_sha256 (__global const u32
}
}
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv128_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv128_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -259,6 +266,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_essiv128_mk_sha256_final (__global con
}
}
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv128_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv128_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -296,6 +304,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_essiv128_mk_sha512 (__global const u32
}
}
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv128_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv128_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -356,6 +365,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_essiv128_mk_sha512_final (__global con
}
}
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv128_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv128_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -393,6 +403,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_essiv128_mk_ripemd160 (__global const
}
}
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv128_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv128_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -453,6 +464,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_essiv128_mk_ripemd160_final (__global
}
}
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv256 (__global const u32 *in, u32 *out, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv256 (__global const u32 *in, u32 *out, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -487,6 +499,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_essiv256 (__global const u32 *in, u32
}
}
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv256_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv256_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -524,6 +537,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_essiv256_mk_sha1 (__global const u32 *
}
}
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv256_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv256_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -584,6 +598,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_essiv256_mk_sha1_final (__global const
}
}
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv256_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv256_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -621,6 +636,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_essiv256_mk_sha256 (__global const u32
}
}
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv256_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv256_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -681,6 +697,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_essiv256_mk_sha256_final (__global con
}
}
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv256_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv256_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -718,6 +735,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_essiv256_mk_sha512 (__global const u32
}
}
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv256_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv256_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -778,6 +796,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_essiv256_mk_sha512_final (__global con
}
}
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv256_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv256_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -815,6 +834,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_essiv256_mk_ripemd160 (__global const
}
}
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv256_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_essiv256_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -877,6 +897,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_essiv256_mk_ripemd160_final (__global
// cbc-plain
DECLSPEC void luks_decrypt_sector_aes_cbc_plain128 (__global const u32 *in, u32 *out, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_plain128 (__global const u32 *in, u32 *out, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -907,6 +928,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_plain128 (__global const u32 *in, u32
}
}
DECLSPEC void luks_decrypt_sector_aes_cbc_plain128_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_plain128_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -940,6 +962,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_plain128_mk_sha1 (__global const u32 *
}
}
DECLSPEC void luks_decrypt_sector_aes_cbc_plain128_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_plain128_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -996,6 +1019,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_plain128_mk_sha1_final (__global const
}
}
DECLSPEC void luks_decrypt_sector_aes_cbc_plain128_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_plain128_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1029,6 +1053,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_plain128_mk_sha256 (__global const u32
}
}
DECLSPEC void luks_decrypt_sector_aes_cbc_plain128_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_plain128_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1085,6 +1110,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_plain128_mk_sha256_final (__global con
}
}
DECLSPEC void luks_decrypt_sector_aes_cbc_plain128_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_plain128_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1118,6 +1144,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_plain128_mk_sha512 (__global const u32
}
}
DECLSPEC void luks_decrypt_sector_aes_cbc_plain128_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_plain128_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1174,6 +1201,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_plain128_mk_sha512_final (__global con
}
}
DECLSPEC void luks_decrypt_sector_aes_cbc_plain128_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_plain128_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1207,6 +1235,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_plain128_mk_ripemd160 (__global const
}
}
DECLSPEC void luks_decrypt_sector_aes_cbc_plain128_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_plain128_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1263,6 +1292,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_plain128_mk_ripemd160_final (__global
}
}
DECLSPEC void luks_decrypt_sector_aes_cbc_plain256 (__global const u32 *in, u32 *out, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_plain256 (__global const u32 *in, u32 *out, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1293,6 +1323,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_plain256 (__global const u32 *in, u32
}
}
DECLSPEC void luks_decrypt_sector_aes_cbc_plain256_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_plain256_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1326,6 +1357,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_plain256_mk_sha1 (__global const u32 *
}
}
DECLSPEC void luks_decrypt_sector_aes_cbc_plain256_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_plain256_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1382,6 +1414,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_plain256_mk_sha1_final (__global const
}
}
DECLSPEC void luks_decrypt_sector_aes_cbc_plain256_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_plain256_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1415,6 +1448,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_plain256_mk_sha256 (__global const u32
}
}
DECLSPEC void luks_decrypt_sector_aes_cbc_plain256_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_plain256_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1471,6 +1505,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_plain256_mk_sha256_final (__global con
}
}
DECLSPEC void luks_decrypt_sector_aes_cbc_plain256_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_plain256_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1504,6 +1539,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_plain256_mk_sha512 (__global const u32
}
}
DECLSPEC void luks_decrypt_sector_aes_cbc_plain256_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_plain256_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1560,6 +1596,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_plain256_mk_sha512_final (__global con
}
}
DECLSPEC void luks_decrypt_sector_aes_cbc_plain256_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_plain256_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1593,6 +1630,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_plain256_mk_ripemd160 (__global const
}
}
DECLSPEC void luks_decrypt_sector_aes_cbc_plain256_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_cbc_plain256_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1651,6 +1689,7 @@ DECLSPEC void luks_decrypt_sector_aes_cbc_plain256_mk_ripemd160_final (__global
// xts-plain
DECLSPEC void aes128_decrypt_xts (const u32 *ks1, const u32 *in, u32 *out, u32 *T, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void aes128_decrypt_xts (const u32 *ks1, const u32 *in, u32 *out, u32 *T, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
out[0] = in[0];
@ -1673,6 +1712,7 @@ DECLSPEC void aes128_decrypt_xts (const u32 *ks1, const u32 *in, u32 *out, u32 *
xts_mul2 (T, T);
}
DECLSPEC void aes256_decrypt_xts (const u32 *ks1, const u32 *in, u32 *out, u32 *T, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void aes256_decrypt_xts (const u32 *ks1, const u32 *in, u32 *out, u32 *T, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
out[0] = in[0];
@ -1695,6 +1735,7 @@ DECLSPEC void aes256_decrypt_xts (const u32 *ks1, const u32 *in, u32 *out, u32 *
xts_mul2 (T, T);
}
DECLSPEC void luks_decrypt_sector_aes_xts_plain256 (__global const u32 *in, u32 *out, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_xts_plain256 (__global const u32 *in, u32 *out, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1729,6 +1770,7 @@ DECLSPEC void luks_decrypt_sector_aes_xts_plain256 (__global const u32 *in, u32
}
}
DECLSPEC void luks_decrypt_sector_aes_xts_plain256_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_xts_plain256_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1766,6 +1808,7 @@ DECLSPEC void luks_decrypt_sector_aes_xts_plain256_mk_sha1 (__global const u32 *
}
}
DECLSPEC void luks_decrypt_sector_aes_xts_plain256_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_xts_plain256_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1826,6 +1869,7 @@ DECLSPEC void luks_decrypt_sector_aes_xts_plain256_mk_sha1_final (__global const
}
}
DECLSPEC void luks_decrypt_sector_aes_xts_plain256_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_xts_plain256_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1863,6 +1907,7 @@ DECLSPEC void luks_decrypt_sector_aes_xts_plain256_mk_sha256 (__global const u32
}
}
DECLSPEC void luks_decrypt_sector_aes_xts_plain256_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_xts_plain256_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1923,6 +1968,7 @@ DECLSPEC void luks_decrypt_sector_aes_xts_plain256_mk_sha256_final (__global con
}
}
DECLSPEC void luks_decrypt_sector_aes_xts_plain256_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_xts_plain256_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1960,6 +2006,7 @@ DECLSPEC void luks_decrypt_sector_aes_xts_plain256_mk_sha512 (__global const u32
}
}
DECLSPEC void luks_decrypt_sector_aes_xts_plain256_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_xts_plain256_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2020,6 +2067,7 @@ DECLSPEC void luks_decrypt_sector_aes_xts_plain256_mk_sha512_final (__global con
}
}
DECLSPEC void luks_decrypt_sector_aes_xts_plain256_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_xts_plain256_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2057,6 +2105,7 @@ DECLSPEC void luks_decrypt_sector_aes_xts_plain256_mk_ripemd160 (__global const
}
}
DECLSPEC void luks_decrypt_sector_aes_xts_plain256_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_xts_plain256_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2117,6 +2166,7 @@ DECLSPEC void luks_decrypt_sector_aes_xts_plain256_mk_ripemd160_final (__global
}
}
DECLSPEC void luks_decrypt_sector_aes_xts_plain512 (__global const u32 *in, u32 *out, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_xts_plain512 (__global const u32 *in, u32 *out, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2151,6 +2201,7 @@ DECLSPEC void luks_decrypt_sector_aes_xts_plain512 (__global const u32 *in, u32
}
}
DECLSPEC void luks_decrypt_sector_aes_xts_plain512_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_xts_plain512_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2188,6 +2239,7 @@ DECLSPEC void luks_decrypt_sector_aes_xts_plain512_mk_sha1 (__global const u32 *
}
}
DECLSPEC void luks_decrypt_sector_aes_xts_plain512_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_xts_plain512_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2248,6 +2300,7 @@ DECLSPEC void luks_decrypt_sector_aes_xts_plain512_mk_sha1_final (__global const
}
}
DECLSPEC void luks_decrypt_sector_aes_xts_plain512_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_xts_plain512_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2285,6 +2338,7 @@ DECLSPEC void luks_decrypt_sector_aes_xts_plain512_mk_sha256 (__global const u32
}
}
DECLSPEC void luks_decrypt_sector_aes_xts_plain512_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_xts_plain512_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2345,6 +2399,7 @@ DECLSPEC void luks_decrypt_sector_aes_xts_plain512_mk_sha256_final (__global con
}
}
DECLSPEC void luks_decrypt_sector_aes_xts_plain512_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_xts_plain512_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2382,6 +2437,7 @@ DECLSPEC void luks_decrypt_sector_aes_xts_plain512_mk_sha512 (__global const u32
}
}
DECLSPEC void luks_decrypt_sector_aes_xts_plain512_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_xts_plain512_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2442,6 +2498,7 @@ DECLSPEC void luks_decrypt_sector_aes_xts_plain512_mk_sha512_final (__global con
}
}
DECLSPEC void luks_decrypt_sector_aes_xts_plain512_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_xts_plain512_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2479,6 +2536,7 @@ DECLSPEC void luks_decrypt_sector_aes_xts_plain512_mk_ripemd160 (__global const
}
}
DECLSPEC void luks_decrypt_sector_aes_xts_plain512_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_decrypt_sector_aes_xts_plain512_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2541,6 +2599,7 @@ DECLSPEC void luks_decrypt_sector_aes_xts_plain512_mk_ripemd160_final (__global
// luks helper
DECLSPEC void luks_af_sha1_then_aes_decrypt (__global const luks_t *luks_bufs, __global luks_tmp_t *tmps, u32 *pt_buf, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_af_sha1_then_aes_decrypt (__global const luks_t *luks_bufs, __global luks_tmp_t *tmps, u32 *pt_buf, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
const u32 key_size = luks_bufs->key_size;
@ -2932,6 +2991,7 @@ DECLSPEC void luks_af_sha1_then_aes_decrypt (__global const luks_t *luks_bufs, _
}
}
DECLSPEC void luks_af_sha256_then_aes_decrypt (__global const luks_t *luks_bufs, __global luks_tmp_t *tmps, u32 *pt_buf, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_af_sha256_then_aes_decrypt (__global const luks_t *luks_bufs, __global luks_tmp_t *tmps, u32 *pt_buf, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
const u32 key_size = luks_bufs->key_size;
@ -3291,6 +3351,7 @@ DECLSPEC void luks_af_sha256_then_aes_decrypt (__global const luks_t *luks_bufs,
}
}
DECLSPEC void luks_af_sha512_then_aes_decrypt (__global const luks_t *luks_bufs, __global luks_tmp_t *tmps, u32 *pt_buf, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_af_sha512_then_aes_decrypt (__global const luks_t *luks_bufs, __global luks_tmp_t *tmps, u32 *pt_buf, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
const u32 key_size = luks_bufs->key_size;
@ -3669,6 +3730,7 @@ DECLSPEC void luks_af_sha512_then_aes_decrypt (__global const luks_t *luks_bufs,
}
}
DECLSPEC void luks_af_ripemd160_then_aes_decrypt (__global const luks_t *luks_bufs, __global luks_tmp_t *tmps, u32 *pt_buf, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void luks_af_ripemd160_then_aes_decrypt (__global const luks_t *luks_bufs, __global luks_tmp_t *tmps, u32 *pt_buf, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
const u32 key_size = luks_bufs->key_size;

@ -45,6 +45,7 @@ __constant u64a AF_k_sha512[80] =
SHA512C4c, SHA512C4d, SHA512C4e, SHA512C4f,
};
DECLSPEC void AF_sha1_transform_S (const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, u32 *digest);
DECLSPEC void AF_sha1_transform_S (const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, u32 *digest)
{
u32 A = digest[0];
@ -173,6 +174,7 @@ DECLSPEC void AF_sha1_transform_S (const u32 *w0, const u32 *w1, const u32 *w2,
digest[4] += E;
}
DECLSPEC void AF_sha256_transform_S (const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, u32 *digest);
DECLSPEC void AF_sha256_transform_S (const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, u32 *digest)
{
u32 a = digest[0];
@ -261,6 +263,7 @@ DECLSPEC void AF_sha256_transform_S (const u32 *w0, const u32 *w1, const u32 *w2
digest[7] += h;
}
DECLSPEC void AF_sha512_transform_S (const u64 *w0, const u64 *w1, const u64 *w2, const u64 *w3, u64 *digest);
DECLSPEC void AF_sha512_transform_S (const u64 *w0, const u64 *w1, const u64 *w2, const u64 *w3, u64 *digest)
{
u64 a = digest[0];
@ -349,6 +352,7 @@ DECLSPEC void AF_sha512_transform_S (const u64 *w0, const u64 *w1, const u64 *w2
digest[7] += h;
}
DECLSPEC void AF_ripemd160_transform_S (const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, u32 *digest);
DECLSPEC void AF_ripemd160_transform_S (const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, u32 *digest)
{
u32 w0_t = w0[0];
@ -565,6 +569,7 @@ DECLSPEC void AF_ripemd160_transform_S (const u32 *w0, const u32 *w1, const u32
// diffuse functions
DECLSPEC void AF_sha1_diffuse16 (u32 *out);
DECLSPEC void AF_sha1_diffuse16 (u32 *out)
{
u32 w0[4];
@ -607,6 +612,7 @@ DECLSPEC void AF_sha1_diffuse16 (u32 *out)
out[3] = swap32_S (digest[3]);
}
DECLSPEC void AF_sha1_diffuse32 (u32 *out);
DECLSPEC void AF_sha1_diffuse32 (u32 *out)
{
u32 w0[4];
@ -681,6 +687,7 @@ DECLSPEC void AF_sha1_diffuse32 (u32 *out)
out[7] = swap32_S (digest[2]);
}
DECLSPEC void AF_sha1_diffuse64 (u32 *out);
DECLSPEC void AF_sha1_diffuse64 (u32 *out)
{
u32 w0[4];
@ -819,6 +826,7 @@ DECLSPEC void AF_sha1_diffuse64 (u32 *out)
out[15] = swap32_S (digest[0]);
}
DECLSPEC void AF_sha256_diffuse16 (u32 *out);
DECLSPEC void AF_sha256_diffuse16 (u32 *out)
{
u32 w0[4];
@ -864,6 +872,7 @@ DECLSPEC void AF_sha256_diffuse16 (u32 *out)
out[3] = swap32_S (digest[3]);
}
DECLSPEC void AF_sha256_diffuse32 (u32 *out);
DECLSPEC void AF_sha256_diffuse32 (u32 *out)
{
u32 w0[4];
@ -913,6 +922,7 @@ DECLSPEC void AF_sha256_diffuse32 (u32 *out)
out[7] = swap32_S (digest[7]);
}
DECLSPEC void AF_sha256_diffuse64 (u32 *out);
DECLSPEC void AF_sha256_diffuse64 (u32 *out)
{
u32 w0[4];
@ -1001,6 +1011,7 @@ DECLSPEC void AF_sha256_diffuse64 (u32 *out)
out[15] = swap32_S (digest[7]);
}
DECLSPEC void AF_sha512_diffuse16 (u32 *out);
DECLSPEC void AF_sha512_diffuse16 (u32 *out)
{
u64 w0[4];
@ -1046,6 +1057,7 @@ DECLSPEC void AF_sha512_diffuse16 (u32 *out)
out[3] = swap32_S (l32_from_64_S (digest[1]));
}
DECLSPEC void AF_sha512_diffuse32 (u32 *out);
DECLSPEC void AF_sha512_diffuse32 (u32 *out)
{
u64 w0[4];
@ -1095,6 +1107,7 @@ DECLSPEC void AF_sha512_diffuse32 (u32 *out)
out[7] = swap32_S (l32_from_64_S (digest[3]));
}
DECLSPEC void AF_sha512_diffuse64 (u32 *out);
DECLSPEC void AF_sha512_diffuse64 (u32 *out)
{
u64 w0[4];
@ -1152,6 +1165,7 @@ DECLSPEC void AF_sha512_diffuse64 (u32 *out)
out[15] = swap32_S (l32_from_64_S (digest[7]));
}
DECLSPEC void AF_ripemd160_diffuse16 (u32 *out);
DECLSPEC void AF_ripemd160_diffuse16 (u32 *out)
{
u32 w0[4];
@ -1194,6 +1208,7 @@ DECLSPEC void AF_ripemd160_diffuse16 (u32 *out)
out[3] = digest[3];
}
DECLSPEC void AF_ripemd160_diffuse32 (u32 *out);
DECLSPEC void AF_ripemd160_diffuse32 (u32 *out)
{
u32 w0[4];
@ -1268,6 +1283,7 @@ DECLSPEC void AF_ripemd160_diffuse32 (u32 *out)
out[7] = digest[2];
}
DECLSPEC void AF_ripemd160_diffuse64 (u32 *out);
DECLSPEC void AF_ripemd160_diffuse64 (u32 *out)
{
u32 w0[4];

@ -19,6 +19,7 @@ __constant u32a ESSIV_k_sha256[64] =
};
// basically a normal sha256_transform() but with a different name to avoid collisions with function nameing
DECLSPEC void ESSIV_sha256_transform_S (const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, u32 *digest);
DECLSPEC void ESSIV_sha256_transform_S (const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, u32 *digest)
{
u32 a = digest[0];
@ -107,6 +108,7 @@ DECLSPEC void ESSIV_sha256_transform_S (const u32 *w0, const u32 *w1, const u32
digest[7] += h;
}
DECLSPEC void ESSIV_sha256_init128 (u32 *key, u32 *essivhash);
DECLSPEC void ESSIV_sha256_init128 (u32 *key, u32 *essivhash)
{
essivhash[0] = SHA256M_A;
@ -152,6 +154,7 @@ DECLSPEC void ESSIV_sha256_init128 (u32 *key, u32 *essivhash)
essivhash[7] = swap32_S (essivhash[7]);
}
DECLSPEC void ESSIV_sha256_init256 (u32 *key, u32 *essivhash);
DECLSPEC void ESSIV_sha256_init256 (u32 *key, u32 *essivhash)
{
essivhash[0] = SHA256M_A;

@ -1,6 +1,7 @@
// cbc-essiv
DECLSPEC void serpent128_decrypt_cbc (const u32 *ks1, const u32 *in, u32 *out, u32 *essiv);
DECLSPEC void serpent128_decrypt_cbc (const u32 *ks1, const u32 *in, u32 *out, u32 *essiv)
{
serpent128_decrypt (ks1, in, out);
@ -16,6 +17,7 @@ DECLSPEC void serpent128_decrypt_cbc (const u32 *ks1, const u32 *in, u32 *out, u
essiv[3] = in[3];
}
DECLSPEC void serpent256_decrypt_cbc (const u32 *ks1, const u32 *in, u32 *out, u32 *essiv);
DECLSPEC void serpent256_decrypt_cbc (const u32 *ks1, const u32 *in, u32 *out, u32 *essiv)
{
serpent256_decrypt (ks1, in, out);
@ -31,6 +33,7 @@ DECLSPEC void serpent256_decrypt_cbc (const u32 *ks1, const u32 *in, u32 *out, u
essiv[3] = in[3];
}
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv128 (__global const u32 *in, u32 *out, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv128 (__global const u32 *in, u32 *out, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -65,6 +68,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv128 (__global const u32 *in,
}
}
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv128_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv128_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -102,6 +106,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv128_mk_sha1 (__global const u
}
}
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv128_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv128_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -162,6 +167,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv128_mk_sha1_final (__global c
}
}
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv128_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv128_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -199,6 +205,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv128_mk_sha256 (__global const
}
}
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv128_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv128_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -259,6 +266,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv128_mk_sha256_final (__global
}
}
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv128_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv128_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -296,6 +304,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv128_mk_sha512 (__global const
}
}
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv128_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv128_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -356,6 +365,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv128_mk_sha512_final (__global
}
}
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv128_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv128_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -393,6 +403,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv128_mk_ripemd160 (__global co
}
}
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv128_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv128_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -453,6 +464,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv128_mk_ripemd160_final (__glo
}
}
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv256 (__global const u32 *in, u32 *out, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv256 (__global const u32 *in, u32 *out, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -487,6 +499,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv256 (__global const u32 *in,
}
}
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv256_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv256_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -524,6 +537,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv256_mk_sha1 (__global const u
}
}
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv256_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv256_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -584,6 +598,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv256_mk_sha1_final (__global c
}
}
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv256_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv256_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -621,6 +636,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv256_mk_sha256 (__global const
}
}
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv256_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv256_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -681,6 +697,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv256_mk_sha256_final (__global
}
}
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv256_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv256_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -718,6 +735,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv256_mk_sha512 (__global const
}
}
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv256_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv256_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -778,6 +796,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv256_mk_sha512_final (__global
}
}
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv256_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv256_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -815,6 +834,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv256_mk_ripemd160 (__global co
}
}
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv256_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv256_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -877,6 +897,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_essiv256_mk_ripemd160_final (__glo
// cbc-plain
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain128 (__global const u32 *in, u32 *out, const u32 *ks1, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain128 (__global const u32 *in, u32 *out, const u32 *ks1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -907,6 +928,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_plain128 (__global const u32 *in,
}
}
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain128_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain128_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -940,6 +962,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_plain128_mk_sha1 (__global const u
}
}
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain128_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain128_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -996,6 +1019,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_plain128_mk_sha1_final (__global c
}
}
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain128_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain128_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1029,6 +1053,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_plain128_mk_sha256 (__global const
}
}
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain128_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain128_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1085,6 +1110,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_plain128_mk_sha256_final (__global
}
}
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain128_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain128_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1118,6 +1144,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_plain128_mk_sha512 (__global const
}
}
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain128_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain128_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1174,6 +1201,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_plain128_mk_sha512_final (__global
}
}
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain128_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain128_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1207,6 +1235,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_plain128_mk_ripemd160 (__global co
}
}
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain128_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain128_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1263,6 +1292,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_plain128_mk_ripemd160_final (__glo
}
}
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain256 (__global const u32 *in, u32 *out, const u32 *ks1, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain256 (__global const u32 *in, u32 *out, const u32 *ks1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1293,6 +1323,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_plain256 (__global const u32 *in,
}
}
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain256_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain256_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1326,6 +1357,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_plain256_mk_sha1 (__global const u
}
}
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain256_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain256_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1382,6 +1414,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_plain256_mk_sha1_final (__global c
}
}
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain256_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain256_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1415,6 +1448,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_plain256_mk_sha256 (__global const
}
}
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain256_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain256_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1471,6 +1505,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_plain256_mk_sha256_final (__global
}
}
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain256_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain256_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1504,6 +1539,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_plain256_mk_sha512 (__global const
}
}
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain256_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain256_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1560,6 +1596,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_plain256_mk_sha512_final (__global
}
}
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain256_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain256_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1593,6 +1630,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_plain256_mk_ripemd160 (__global co
}
}
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain256_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_cbc_plain256_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1651,6 +1689,7 @@ DECLSPEC void luks_decrypt_sector_serpent_cbc_plain256_mk_ripemd160_final (__glo
// xts-plain
DECLSPEC void serpent128_decrypt_xts (const u32 *ks1, const u32 *in, u32 *out, u32 *T);
DECLSPEC void serpent128_decrypt_xts (const u32 *ks1, const u32 *in, u32 *out, u32 *T)
{
out[0] = in[0];
@ -1673,6 +1712,7 @@ DECLSPEC void serpent128_decrypt_xts (const u32 *ks1, const u32 *in, u32 *out, u
xts_mul2 (T, T);
}
DECLSPEC void serpent256_decrypt_xts (const u32 *ks1, const u32 *in, u32 *out, u32 *T);
DECLSPEC void serpent256_decrypt_xts (const u32 *ks1, const u32 *in, u32 *out, u32 *T)
{
out[0] = in[0];
@ -1695,6 +1735,7 @@ DECLSPEC void serpent256_decrypt_xts (const u32 *ks1, const u32 *in, u32 *out, u
xts_mul2 (T, T);
}
DECLSPEC void luks_decrypt_sector_serpent_xts_plain256 (__global const u32 *in, u32 *out, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_xts_plain256 (__global const u32 *in, u32 *out, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1729,6 +1770,7 @@ DECLSPEC void luks_decrypt_sector_serpent_xts_plain256 (__global const u32 *in,
}
}
DECLSPEC void luks_decrypt_sector_serpent_xts_plain256_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_xts_plain256_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1766,6 +1808,7 @@ DECLSPEC void luks_decrypt_sector_serpent_xts_plain256_mk_sha1 (__global const u
}
}
DECLSPEC void luks_decrypt_sector_serpent_xts_plain256_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_xts_plain256_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1826,6 +1869,7 @@ DECLSPEC void luks_decrypt_sector_serpent_xts_plain256_mk_sha1_final (__global c
}
}
DECLSPEC void luks_decrypt_sector_serpent_xts_plain256_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_xts_plain256_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1863,6 +1907,7 @@ DECLSPEC void luks_decrypt_sector_serpent_xts_plain256_mk_sha256 (__global const
}
}
DECLSPEC void luks_decrypt_sector_serpent_xts_plain256_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_xts_plain256_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1923,6 +1968,7 @@ DECLSPEC void luks_decrypt_sector_serpent_xts_plain256_mk_sha256_final (__global
}
}
DECLSPEC void luks_decrypt_sector_serpent_xts_plain256_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_xts_plain256_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1960,6 +2006,7 @@ DECLSPEC void luks_decrypt_sector_serpent_xts_plain256_mk_sha512 (__global const
}
}
DECLSPEC void luks_decrypt_sector_serpent_xts_plain256_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_xts_plain256_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2020,6 +2067,7 @@ DECLSPEC void luks_decrypt_sector_serpent_xts_plain256_mk_sha512_final (__global
}
}
DECLSPEC void luks_decrypt_sector_serpent_xts_plain256_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_xts_plain256_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2057,6 +2105,7 @@ DECLSPEC void luks_decrypt_sector_serpent_xts_plain256_mk_ripemd160 (__global co
}
}
DECLSPEC void luks_decrypt_sector_serpent_xts_plain256_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_xts_plain256_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2117,6 +2166,7 @@ DECLSPEC void luks_decrypt_sector_serpent_xts_plain256_mk_ripemd160_final (__glo
}
}
DECLSPEC void luks_decrypt_sector_serpent_xts_plain512 (__global const u32 *in, u32 *out, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_xts_plain512 (__global const u32 *in, u32 *out, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2151,6 +2201,7 @@ DECLSPEC void luks_decrypt_sector_serpent_xts_plain512 (__global const u32 *in,
}
}
DECLSPEC void luks_decrypt_sector_serpent_xts_plain512_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_xts_plain512_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2188,6 +2239,7 @@ DECLSPEC void luks_decrypt_sector_serpent_xts_plain512_mk_sha1 (__global const u
}
}
DECLSPEC void luks_decrypt_sector_serpent_xts_plain512_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_xts_plain512_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2248,6 +2300,7 @@ DECLSPEC void luks_decrypt_sector_serpent_xts_plain512_mk_sha1_final (__global c
}
}
DECLSPEC void luks_decrypt_sector_serpent_xts_plain512_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_xts_plain512_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2285,6 +2338,7 @@ DECLSPEC void luks_decrypt_sector_serpent_xts_plain512_mk_sha256 (__global const
}
}
DECLSPEC void luks_decrypt_sector_serpent_xts_plain512_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_xts_plain512_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2345,6 +2399,7 @@ DECLSPEC void luks_decrypt_sector_serpent_xts_plain512_mk_sha256_final (__global
}
}
DECLSPEC void luks_decrypt_sector_serpent_xts_plain512_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_xts_plain512_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2382,6 +2437,7 @@ DECLSPEC void luks_decrypt_sector_serpent_xts_plain512_mk_sha512 (__global const
}
}
DECLSPEC void luks_decrypt_sector_serpent_xts_plain512_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_xts_plain512_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2442,6 +2498,7 @@ DECLSPEC void luks_decrypt_sector_serpent_xts_plain512_mk_sha512_final (__global
}
}
DECLSPEC void luks_decrypt_sector_serpent_xts_plain512_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_xts_plain512_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2479,6 +2536,7 @@ DECLSPEC void luks_decrypt_sector_serpent_xts_plain512_mk_ripemd160 (__global co
}
}
DECLSPEC void luks_decrypt_sector_serpent_xts_plain512_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector);
DECLSPEC void luks_decrypt_sector_serpent_xts_plain512_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *ks1, const u32 *ks2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2541,6 +2599,7 @@ DECLSPEC void luks_decrypt_sector_serpent_xts_plain512_mk_ripemd160_final (__glo
// luks helper
DECLSPEC void luks_af_sha1_then_serpent_decrypt (__global const luks_t *luks_bufs, __global luks_tmp_t *tmps, u32 *pt_buf);
DECLSPEC void luks_af_sha1_then_serpent_decrypt (__global const luks_t *luks_bufs, __global luks_tmp_t *tmps, u32 *pt_buf)
{
const u32 key_size = luks_bufs->key_size;
@ -2900,6 +2959,7 @@ DECLSPEC void luks_af_sha1_then_serpent_decrypt (__global const luks_t *luks_buf
}
}
DECLSPEC void luks_af_sha256_then_serpent_decrypt (__global const luks_t *luks_bufs, __global luks_tmp_t *tmps, u32 *pt_buf);
DECLSPEC void luks_af_sha256_then_serpent_decrypt (__global const luks_t *luks_bufs, __global luks_tmp_t *tmps, u32 *pt_buf)
{
const u32 key_size = luks_bufs->key_size;
@ -3259,6 +3319,7 @@ DECLSPEC void luks_af_sha256_then_serpent_decrypt (__global const luks_t *luks_b
}
}
DECLSPEC void luks_af_sha512_then_serpent_decrypt (__global const luks_t *luks_bufs, __global luks_tmp_t *tmps, u32 *pt_buf);
DECLSPEC void luks_af_sha512_then_serpent_decrypt (__global const luks_t *luks_bufs, __global luks_tmp_t *tmps, u32 *pt_buf)
{
const u32 key_size = luks_bufs->key_size;
@ -3637,6 +3698,7 @@ DECLSPEC void luks_af_sha512_then_serpent_decrypt (__global const luks_t *luks_b
}
}
DECLSPEC void luks_af_ripemd160_then_serpent_decrypt (__global const luks_t *luks_bufs, __global luks_tmp_t *tmps, u32 *pt_buf);
DECLSPEC void luks_af_ripemd160_then_serpent_decrypt (__global const luks_t *luks_bufs, __global luks_tmp_t *tmps, u32 *pt_buf)
{
const u32 key_size = luks_bufs->key_size;

@ -1,6 +1,7 @@
// cbc-essiv
DECLSPEC void twofish128_decrypt_cbc (const u32 *sk1, const u32 *lk1, const u32 *in, u32 *out, u32 *essiv);
DECLSPEC void twofish128_decrypt_cbc (const u32 *sk1, const u32 *lk1, const u32 *in, u32 *out, u32 *essiv)
{
twofish128_decrypt (sk1, lk1, in, out);
@ -16,6 +17,7 @@ DECLSPEC void twofish128_decrypt_cbc (const u32 *sk1, const u32 *lk1, const u32
essiv[3] = in[3];
}
DECLSPEC void twofish256_decrypt_cbc (const u32 *sk1, const u32 *lk1, const u32 *in, u32 *out, u32 *essiv);
DECLSPEC void twofish256_decrypt_cbc (const u32 *sk1, const u32 *lk1, const u32 *in, u32 *out, u32 *essiv)
{
twofish256_decrypt (sk1, lk1, in, out);
@ -31,6 +33,7 @@ DECLSPEC void twofish256_decrypt_cbc (const u32 *sk1, const u32 *lk1, const u32
essiv[3] = in[3];
}
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv128 (__global const u32 *in, u32 *out, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv128 (__global const u32 *in, u32 *out, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -65,6 +68,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv128 (__global const u32 *in,
}
}
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv128_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv128_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -102,6 +106,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv128_mk_sha1 (__global const u
}
}
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv128_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv128_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -162,6 +167,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv128_mk_sha1_final (__global c
}
}
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv128_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv128_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -199,6 +205,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv128_mk_sha256 (__global const
}
}
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv128_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv128_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -259,6 +266,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv128_mk_sha256_final (__global
}
}
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv128_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv128_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -296,6 +304,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv128_mk_sha512 (__global const
}
}
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv128_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv128_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -356,6 +365,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv128_mk_sha512_final (__global
}
}
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv128_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv128_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -393,6 +403,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv128_mk_ripemd160 (__global co
}
}
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv128_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv128_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -453,6 +464,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv128_mk_ripemd160_final (__glo
}
}
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv256 (__global const u32 *in, u32 *out, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv256 (__global const u32 *in, u32 *out, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -487,6 +499,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv256 (__global const u32 *in,
}
}
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv256_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv256_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -524,6 +537,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv256_mk_sha1 (__global const u
}
}
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv256_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv256_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -584,6 +598,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv256_mk_sha1_final (__global c
}
}
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv256_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv256_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -621,6 +636,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv256_mk_sha256 (__global const
}
}
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv256_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv256_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -681,6 +697,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv256_mk_sha256_final (__global
}
}
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv256_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv256_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -718,6 +735,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv256_mk_sha512 (__global const
}
}
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv256_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv256_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -778,6 +796,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv256_mk_sha512_final (__global
}
}
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv256_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv256_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -815,6 +834,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv256_mk_ripemd160 (__global co
}
}
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv256_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv256_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -877,6 +897,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_essiv256_mk_ripemd160_final (__glo
// cbc-plain
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain128 (__global const u32 *in, u32 *out, const u32 *sk1, const u32 *lk1, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain128 (__global const u32 *in, u32 *out, const u32 *sk1, const u32 *lk1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -907,6 +928,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_plain128 (__global const u32 *in,
}
}
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain128_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain128_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -940,6 +962,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_plain128_mk_sha1 (__global const u
}
}
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain128_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain128_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -996,6 +1019,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_plain128_mk_sha1_final (__global c
}
}
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain128_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain128_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1029,6 +1053,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_plain128_mk_sha256 (__global const
}
}
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain128_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain128_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1085,6 +1110,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_plain128_mk_sha256_final (__global
}
}
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain128_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain128_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1118,6 +1144,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_plain128_mk_sha512 (__global const
}
}
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain128_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain128_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1174,6 +1201,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_plain128_mk_sha512_final (__global
}
}
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain128_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain128_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1207,6 +1235,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_plain128_mk_ripemd160 (__global co
}
}
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain128_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain128_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1263,6 +1292,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_plain128_mk_ripemd160_final (__glo
}
}
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain256 (__global const u32 *in, u32 *out, const u32 *sk1, const u32 *lk1, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain256 (__global const u32 *in, u32 *out, const u32 *sk1, const u32 *lk1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1293,6 +1323,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_plain256 (__global const u32 *in,
}
}
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain256_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain256_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1326,6 +1357,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_plain256_mk_sha1 (__global const u
}
}
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain256_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain256_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1382,6 +1414,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_plain256_mk_sha1_final (__global c
}
}
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain256_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain256_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1415,6 +1448,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_plain256_mk_sha256 (__global const
}
}
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain256_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain256_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1471,6 +1505,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_plain256_mk_sha256_final (__global
}
}
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain256_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain256_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1504,6 +1539,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_plain256_mk_sha512 (__global const
}
}
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain256_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain256_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1560,6 +1596,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_plain256_mk_sha512_final (__global
}
}
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain256_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain256_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1593,6 +1630,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_plain256_mk_ripemd160 (__global co
}
}
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain256_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_cbc_plain256_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1651,6 +1689,7 @@ DECLSPEC void luks_decrypt_sector_twofish_cbc_plain256_mk_ripemd160_final (__glo
// xts-plain
DECLSPEC void twofish128_decrypt_xts (const u32 *sk1, const u32 *lk1, const u32 *in, u32 *out, u32 *T);
DECLSPEC void twofish128_decrypt_xts (const u32 *sk1, const u32 *lk1, const u32 *in, u32 *out, u32 *T)
{
out[0] = in[0];
@ -1673,6 +1712,7 @@ DECLSPEC void twofish128_decrypt_xts (const u32 *sk1, const u32 *lk1, const u32
xts_mul2 (T, T);
}
DECLSPEC void twofish256_decrypt_xts (const u32 *sk1, const u32 *lk1, const u32 *in, u32 *out, u32 *T);
DECLSPEC void twofish256_decrypt_xts (const u32 *sk1, const u32 *lk1, const u32 *in, u32 *out, u32 *T)
{
out[0] = in[0];
@ -1695,6 +1735,7 @@ DECLSPEC void twofish256_decrypt_xts (const u32 *sk1, const u32 *lk1, const u32
xts_mul2 (T, T);
}
DECLSPEC void luks_decrypt_sector_twofish_xts_plain256 (__global const u32 *in, u32 *out, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_xts_plain256 (__global const u32 *in, u32 *out, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1729,6 +1770,7 @@ DECLSPEC void luks_decrypt_sector_twofish_xts_plain256 (__global const u32 *in,
}
}
DECLSPEC void luks_decrypt_sector_twofish_xts_plain256_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_xts_plain256_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1766,6 +1808,7 @@ DECLSPEC void luks_decrypt_sector_twofish_xts_plain256_mk_sha1 (__global const u
}
}
DECLSPEC void luks_decrypt_sector_twofish_xts_plain256_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_xts_plain256_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1826,6 +1869,7 @@ DECLSPEC void luks_decrypt_sector_twofish_xts_plain256_mk_sha1_final (__global c
}
}
DECLSPEC void luks_decrypt_sector_twofish_xts_plain256_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_xts_plain256_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1863,6 +1907,7 @@ DECLSPEC void luks_decrypt_sector_twofish_xts_plain256_mk_sha256 (__global const
}
}
DECLSPEC void luks_decrypt_sector_twofish_xts_plain256_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_xts_plain256_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1923,6 +1968,7 @@ DECLSPEC void luks_decrypt_sector_twofish_xts_plain256_mk_sha256_final (__global
}
}
DECLSPEC void luks_decrypt_sector_twofish_xts_plain256_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_xts_plain256_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -1960,6 +2006,7 @@ DECLSPEC void luks_decrypt_sector_twofish_xts_plain256_mk_sha512 (__global const
}
}
DECLSPEC void luks_decrypt_sector_twofish_xts_plain256_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_xts_plain256_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2020,6 +2067,7 @@ DECLSPEC void luks_decrypt_sector_twofish_xts_plain256_mk_sha512_final (__global
}
}
DECLSPEC void luks_decrypt_sector_twofish_xts_plain256_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_xts_plain256_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2057,6 +2105,7 @@ DECLSPEC void luks_decrypt_sector_twofish_xts_plain256_mk_ripemd160 (__global co
}
}
DECLSPEC void luks_decrypt_sector_twofish_xts_plain256_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_xts_plain256_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2117,6 +2166,7 @@ DECLSPEC void luks_decrypt_sector_twofish_xts_plain256_mk_ripemd160_final (__glo
}
}
DECLSPEC void luks_decrypt_sector_twofish_xts_plain512 (__global const u32 *in, u32 *out, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_xts_plain512 (__global const u32 *in, u32 *out, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2151,6 +2201,7 @@ DECLSPEC void luks_decrypt_sector_twofish_xts_plain512 (__global const u32 *in,
}
}
DECLSPEC void luks_decrypt_sector_twofish_xts_plain512_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_xts_plain512_mk_sha1 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2188,6 +2239,7 @@ DECLSPEC void luks_decrypt_sector_twofish_xts_plain512_mk_sha1 (__global const u
}
}
DECLSPEC void luks_decrypt_sector_twofish_xts_plain512_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_xts_plain512_mk_sha1_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2248,6 +2300,7 @@ DECLSPEC void luks_decrypt_sector_twofish_xts_plain512_mk_sha1_final (__global c
}
}
DECLSPEC void luks_decrypt_sector_twofish_xts_plain512_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_xts_plain512_mk_sha256 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2285,6 +2338,7 @@ DECLSPEC void luks_decrypt_sector_twofish_xts_plain512_mk_sha256 (__global const
}
}
DECLSPEC void luks_decrypt_sector_twofish_xts_plain512_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_xts_plain512_mk_sha256_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2345,6 +2399,7 @@ DECLSPEC void luks_decrypt_sector_twofish_xts_plain512_mk_sha256_final (__global
}
}
DECLSPEC void luks_decrypt_sector_twofish_xts_plain512_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_xts_plain512_mk_sha512 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2382,6 +2437,7 @@ DECLSPEC void luks_decrypt_sector_twofish_xts_plain512_mk_sha512 (__global const
}
}
DECLSPEC void luks_decrypt_sector_twofish_xts_plain512_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_xts_plain512_mk_sha512_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2442,6 +2498,7 @@ DECLSPEC void luks_decrypt_sector_twofish_xts_plain512_mk_sha512_final (__global
}
}
DECLSPEC void luks_decrypt_sector_twofish_xts_plain512_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_xts_plain512_mk_ripemd160 (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2479,6 +2536,7 @@ DECLSPEC void luks_decrypt_sector_twofish_xts_plain512_mk_ripemd160 (__global co
}
}
DECLSPEC void luks_decrypt_sector_twofish_xts_plain512_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector);
DECLSPEC void luks_decrypt_sector_twofish_xts_plain512_mk_ripemd160_final (__global const u32 *in, u32 *mk, const u32 *sk1, const u32 *lk1, const u32 *sk2, const u32 *lk2, const u32 sector)
{
u32 S[4] = { sector, 0, 0, 0 };
@ -2541,6 +2599,7 @@ DECLSPEC void luks_decrypt_sector_twofish_xts_plain512_mk_ripemd160_final (__glo
// luks helper
DECLSPEC void luks_af_sha1_then_twofish_decrypt (__global const luks_t *luks_bufs, __global luks_tmp_t *tmps, u32 *pt_buf);
DECLSPEC void luks_af_sha1_then_twofish_decrypt (__global const luks_t *luks_bufs, __global luks_tmp_t *tmps, u32 *pt_buf)
{
const u32 key_size = luks_bufs->key_size;
@ -2900,6 +2959,7 @@ DECLSPEC void luks_af_sha1_then_twofish_decrypt (__global const luks_t *luks_buf
}
}
DECLSPEC void luks_af_sha256_then_twofish_decrypt (__global const luks_t *luks_bufs, __global luks_tmp_t *tmps, u32 *pt_buf);
DECLSPEC void luks_af_sha256_then_twofish_decrypt (__global const luks_t *luks_bufs, __global luks_tmp_t *tmps, u32 *pt_buf)
{
const u32 key_size = luks_bufs->key_size;
@ -3259,6 +3319,7 @@ DECLSPEC void luks_af_sha256_then_twofish_decrypt (__global const luks_t *luks_b
}
}
DECLSPEC void luks_af_sha512_then_twofish_decrypt (__global const luks_t *luks_bufs, __global luks_tmp_t *tmps, u32 *pt_buf);
DECLSPEC void luks_af_sha512_then_twofish_decrypt (__global const luks_t *luks_bufs, __global luks_tmp_t *tmps, u32 *pt_buf)
{
const u32 key_size = luks_bufs->key_size;
@ -3637,6 +3698,7 @@ DECLSPEC void luks_af_sha512_then_twofish_decrypt (__global const luks_t *luks_b
}
}
DECLSPEC void luks_af_ripemd160_then_twofish_decrypt (__global const luks_t *luks_bufs, __global luks_tmp_t *tmps, u32 *pt_buf);
DECLSPEC void luks_af_ripemd160_then_twofish_decrypt (__global const luks_t *luks_bufs, __global luks_tmp_t *tmps, u32 *pt_buf)
{
const u32 key_size = luks_bufs->key_size;

@ -1,3 +1,4 @@
DECLSPEC void xts_mul2 (u32 *in, u32 *out);
DECLSPEC void xts_mul2 (u32 *in, u32 *out)
{
const u32 c = in[3] >> 31;

@ -3,8 +3,11 @@
* License.....: MIT
*/
#ifndef MAYBE_UNUSED
#define MAYBE_UNUSED
#endif
u32 generate_cmask (const u32 value);
u32 generate_cmask (const u32 value)
{
const u32 rmask = ((value & 0x40404040u) >> 1u)
@ -16,6 +19,7 @@ u32 generate_cmask (const u32 value)
return rmask & ~hmask & lmask;
}
void append_four_byte (const u32 *buf_src, const int off_src, u32 *buf_dst, const int off_dst);
void append_four_byte (const u32 *buf_src, const int off_src, u32 *buf_dst, const int off_dst)
{
const int sd = off_src / 4;
@ -39,6 +43,7 @@ void append_four_byte (const u32 *buf_src, const int off_src, u32 *buf_dst, cons
buf_dst[dd + 1] |= t1;
}
void append_three_byte (const u32 *buf_src, const int off_src, u32 *buf_dst, const int off_dst);
void append_three_byte (const u32 *buf_src, const int off_src, u32 *buf_dst, const int off_dst)
{
const int sd = off_src / 4;
@ -62,6 +67,7 @@ void append_three_byte (const u32 *buf_src, const int off_src, u32 *buf_dst, con
buf_dst[dd + 1] |= t1;
}
void append_two_byte (const u32 *buf_src, const int off_src, u32 *buf_dst, const int off_dst);
void append_two_byte (const u32 *buf_src, const int off_src, u32 *buf_dst, const int off_dst)
{
const int sd = off_src / 4;
@ -85,6 +91,7 @@ void append_two_byte (const u32 *buf_src, const int off_src, u32 *buf_dst, const
buf_dst[dd + 1] |= t1;
}
void append_one_byte (const u32 *buf_src, const int off_src, u32 *buf_dst, const int off_dst);
void append_one_byte (const u32 *buf_src, const int off_src, u32 *buf_dst, const int off_dst)
{
const int sd = off_src / 4;
@ -104,6 +111,7 @@ void append_one_byte (const u32 *buf_src, const int off_src, u32 *buf_dst, const
buf_dst[dd] |= t;
}
void append_block (const u32 *buf_src, const int off_src, u32 *buf_dst, const int off_dst, const int len);
void append_block (const u32 *buf_src, const int off_src, u32 *buf_dst, const int off_dst, const int len)
{
int i;
@ -123,6 +131,7 @@ void append_block (const u32 *buf_src, const int off_src, u32 *buf_dst, const in
}
}
void exchange_byte (u32 *buf, const int off_src, const int off_dst);
void exchange_byte (u32 *buf, const int off_src, const int off_dst)
{
u8 *ptr = (u8 *) buf;
@ -162,6 +171,7 @@ void exchange_byte (u32 *buf, const int off_src, const int off_dst)
*/
}
int mangle_lrest (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len);
int mangle_lrest (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len)
{
for (int i = 0, idx = 0; i < len; i += 4, idx += 1)
@ -174,6 +184,7 @@ int mangle_lrest (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf,
return (len);
}
int mangle_lrest_ufirst (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len);
int mangle_lrest_ufirst (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len)
{
for (int i = 0, idx = 0; i < len; i += 4, idx += 1)
@ -190,6 +201,7 @@ int mangle_lrest_ufirst (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32
return (len);
}
int mangle_urest (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len);
int mangle_urest (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len)
{
for (int i = 0, idx = 0; i < len; i += 4, idx += 1)
@ -202,6 +214,7 @@ int mangle_urest (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf,
return (len);
}
int mangle_urest_lfirst (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len);
int mangle_urest_lfirst (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len)
{
for (int i = 0, idx = 0; i < len; i += 4, idx += 1)
@ -218,6 +231,7 @@ int mangle_urest_lfirst (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32
return (len);
}
int mangle_trest (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len);
int mangle_trest (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len)
{
for (int i = 0, idx = 0; i < len; i += 4, idx += 1)
@ -230,6 +244,7 @@ int mangle_trest (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf,
return (len);
}
int mangle_toggle_at (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len);
int mangle_toggle_at (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len)
{
if (p0 >= len) return (len);
@ -246,6 +261,7 @@ int mangle_toggle_at (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *b
return (len);
}
int mangle_reverse (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len);
int mangle_reverse (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len)
{
for (int l = 0; l < len / 2; l++)
@ -258,6 +274,7 @@ int mangle_reverse (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf
return (len);
}
int mangle_dupeword (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len);
int mangle_dupeword (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len)
{
const int out_len = len * 2;
@ -269,6 +286,7 @@ int mangle_dupeword (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *bu
return (out_len);
}
int mangle_dupeword_times (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len);
int mangle_dupeword_times (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len)
{
const int out_len = (len * p0) + len;
@ -282,6 +300,7 @@ int mangle_dupeword_times (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u
return (out_len);
}
int mangle_reflect (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len);
int mangle_reflect (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len)
{
const int out_len = len * 2;
@ -300,6 +319,7 @@ int mangle_reflect (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf
return out_len;
}
int mangle_append (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len);
int mangle_append (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len)
{
const int out_len = len + 1;
@ -311,6 +331,7 @@ int mangle_append (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf,
return (out_len);
}
int mangle_prepend (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len);
int mangle_prepend (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len)
{
const int out_len = len + 1;
@ -327,6 +348,7 @@ int mangle_prepend (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf,
return (out_len);
}
int mangle_rotate_left (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len);
int mangle_rotate_left (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len)
{
for (int l = 0, r = len - 1; r > l; r--)
@ -337,6 +359,7 @@ int mangle_rotate_left (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32
return (len);
}
int mangle_rotate_right (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len);
int mangle_rotate_right (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len)
{
for (int l = 0, r = len - 1; l < r; l++)
@ -347,6 +370,7 @@ int mangle_rotate_right (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32
return (len);
}
int mangle_delete_at (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len);
int mangle_delete_at (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len)
{
if (p0 >= len) return (len);
@ -361,11 +385,13 @@ int mangle_delete_at (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *bu
return (len - 1);
}
int mangle_delete_first (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len);
int mangle_delete_first (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len)
{
return mangle_delete_at (0, p1, buf, len);
}
int mangle_delete_last (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len);
int mangle_delete_last (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len)
{
if (len == 0) return 0;
@ -373,6 +399,7 @@ int mangle_delete_last (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *
return mangle_delete_at (len - 1, p1, buf, len);
}
int mangle_extract (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len);
int mangle_extract (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len)
{
if (p0 >= len) return (len);
@ -392,6 +419,7 @@ int mangle_extract (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf,
return (p1);
}
int mangle_omit (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len);
int mangle_omit (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len)
{
if (p0 >= len) return (len);
@ -411,6 +439,7 @@ int mangle_omit (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, co
return (len - p1);
}
int mangle_insert (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len);
int mangle_insert (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len)
{
if (p0 >= len + 1) return (len);
@ -429,6 +458,7 @@ int mangle_insert (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf,
return (out_len);
}
int mangle_overstrike (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len);
int mangle_overstrike (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len)
{
if (p0 >= len) return (len);
@ -438,6 +468,7 @@ int mangle_overstrike (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *b
return (len);
}
int mangle_truncate_at (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len);
int mangle_truncate_at (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len)
{
if (p0 >= len) return (len);
@ -450,6 +481,7 @@ int mangle_truncate_at (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *
return (p0);
}
int mangle_replace (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len);
int mangle_replace (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len)
{
for (int pos = 0; pos < len; pos++)
@ -462,6 +494,7 @@ int mangle_replace (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf,
return (len);
}
int mangle_purgechar (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len);
int mangle_purgechar (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len)
{
int out_len = 0;
@ -483,6 +516,7 @@ int mangle_purgechar (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *bu
return (out_len);
}
int mangle_dupechar_first (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len);
int mangle_dupechar_first (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len)
{
const int out_len = len + p0;
@ -499,6 +533,7 @@ int mangle_dupechar_first (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u
return (out_len);
}
int mangle_dupechar_last (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len);
int mangle_dupechar_last (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len)
{
const int out_len = len + p0;
@ -516,6 +551,7 @@ int mangle_dupechar_last (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8
return (out_len);
}
int mangle_dupechar_all (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len);
int mangle_dupechar_all (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len)
{
const int out_len = len + len;
@ -534,6 +570,7 @@ int mangle_dupechar_all (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8
return (out_len);
}
int mangle_switch_first (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len);
int mangle_switch_first (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len)
{
if (len < 2) return (len);
@ -543,6 +580,7 @@ int mangle_switch_first (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32
return (len);
}
int mangle_switch_last (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len);
int mangle_switch_last (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len)
{
if (len < 2) return (len);
@ -552,6 +590,7 @@ int mangle_switch_last (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32
return (len);
}
int mangle_switch_at (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len);
int mangle_switch_at (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len)
{
if (p0 >= len) return (len);
@ -562,6 +601,7 @@ int mangle_switch_at (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *b
return (len);
}
int mangle_chr_shiftl (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len);
int mangle_chr_shiftl (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len)
{
if (p0 >= len) return (len);
@ -571,6 +611,7 @@ int mangle_chr_shiftl (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *b
return (len);
}
int mangle_chr_shiftr (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len);
int mangle_chr_shiftr (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len)
{
if (p0 >= len) return (len);
@ -580,6 +621,7 @@ int mangle_chr_shiftr (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *b
return (len);
}
int mangle_chr_incr (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len);
int mangle_chr_incr (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len)
{
if (p0 >= len) return (len);
@ -589,6 +631,7 @@ int mangle_chr_incr (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf
return (len);
}
int mangle_chr_decr (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len);
int mangle_chr_decr (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len)
{
if (p0 >= len) return (len);
@ -598,6 +641,7 @@ int mangle_chr_decr (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf
return (len);
}
int mangle_replace_np1 (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len);
int mangle_replace_np1 (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len)
{
if ((p0 + 1) >= len) return (len);
@ -607,6 +651,7 @@ int mangle_replace_np1 (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *
return (len);
}
int mangle_replace_nm1 (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len);
int mangle_replace_nm1 (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len)
{
if (p0 == 0) return (len);
@ -618,6 +663,7 @@ int mangle_replace_nm1 (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *
return (len);
}
int mangle_dupeblock_first (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len);
int mangle_dupeblock_first (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len)
{
if (p0 >= len) return (len);
@ -636,6 +682,7 @@ int mangle_dupeblock_first (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1,
return (out_len);
}
int mangle_dupeblock_last (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len);
int mangle_dupeblock_last (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len)
{
if (p0 >= len) return (len);
@ -654,6 +701,7 @@ int mangle_dupeblock_last (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u
return (out_len);
}
int mangle_title_sep (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len);
int mangle_title_sep (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len)
{
if ((len + 4) >= RP_PASSWORD_SIZE) return (len); // cheap way to not need to check for overflow of i + 1
@ -679,6 +727,7 @@ int mangle_title_sep (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *b
return (len);
}
int apply_rule (const u32 name, MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int in_len);
int apply_rule (const u32 name, MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int in_len)
{
int out_len = in_len;
@ -730,6 +779,7 @@ int apply_rule (const u32 name, MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8
return out_len;
}
int apply_rules (__constant const u32 *cmds, u32 *buf, const int in_len);
int apply_rules (__constant const u32 *cmds, u32 *buf, const int in_len)
{
int out_len = in_len;

@ -3,8 +3,11 @@
* License.....: MIT
*/
#ifndef MAYBE_UNUSED
#define MAYBE_UNUSED
#endif
u32 generate_cmask (const u32 value);
u32 generate_cmask (const u32 value)
{
const u32 rmask = ((value & 0x40404040u) >> 1u)
@ -16,6 +19,7 @@ u32 generate_cmask (const u32 value)
return rmask & ~hmask & lmask;
}
void truncate_right (u32 *buf0, u32 *buf1, const u32 offset);
void truncate_right (u32 *buf0, u32 *buf1, const u32 offset)
{
const u32 tmp = (1u << ((offset & 3u) * 8u)) - 1u;
@ -75,6 +79,7 @@ void truncate_right (u32 *buf0, u32 *buf1, const u32 offset)
}
}
void truncate_left (u32 *buf0, u32 *buf1, const u32 offset);
void truncate_left (u32 *buf0, u32 *buf1, const u32 offset)
{
const u32 tmp = ~((1u << ((offset & 3u) * 8u)) - 1u);
@ -134,6 +139,7 @@ void truncate_left (u32 *buf0, u32 *buf1, const u32 offset)
}
}
void lshift_block (const u32 *in0, const u32 *in1, u32 *out0, u32 *out1);
void lshift_block (const u32 *in0, const u32 *in1, u32 *out0, u32 *out1)
{
out0[0] = hc_bytealign_S (in0[1], in0[0], 1);
@ -146,6 +152,7 @@ void lshift_block (const u32 *in0, const u32 *in1, u32 *out0, u32 *out1)
out1[3] = hc_bytealign_S ( 0, in1[3], 1);
}
void rshift_block (const u32 *in0, const u32 *in1, u32 *out0, u32 *out1);
void rshift_block (const u32 *in0, const u32 *in1, u32 *out0, u32 *out1)
{
out1[3] = hc_bytealign_S (in1[3], in1[2], 3);
@ -158,6 +165,7 @@ void rshift_block (const u32 *in0, const u32 *in1, u32 *out0, u32 *out1)
out0[0] = hc_bytealign_S (in0[0], 0, 3);
}
void lshift_block_N (const u32 *in0, const u32 *in1, u32 *out0, u32 *out1, const u32 num);
void lshift_block_N (const u32 *in0, const u32 *in1, u32 *out0, u32 *out1, const u32 num)
{
switch (num)
@ -453,6 +461,7 @@ void lshift_block_N (const u32 *in0, const u32 *in1, u32 *out0, u32 *out1, const
}
}
void rshift_block_N (const u32 *in0, const u32 *in1, u32 *out0, u32 *out1, const u32 num);
void rshift_block_N (const u32 *in0, const u32 *in1, u32 *out0, u32 *out1, const u32 num)
{
switch (num)
@ -748,6 +757,7 @@ void rshift_block_N (const u32 *in0, const u32 *in1, u32 *out0, u32 *out1, const
}
}
void append_block1 (const u32 offset, u32 *buf0, u32 *buf1, const u32 src_r0);
void append_block1 (const u32 offset, u32 *buf0, u32 *buf1, const u32 src_r0)
{
// this version works with 1 byte append only
@ -769,6 +779,7 @@ void append_block1 (const u32 offset, u32 *buf0, u32 *buf1, const u32 src_r0)
}
void append_block8 (const u32 offset, u32 *buf0, u32 *buf1, const u32 *src_l0, const u32 *src_l1, const u32 *src_r0, const u32 *src_r1);
void append_block8 (const u32 offset, u32 *buf0, u32 *buf1, const u32 *src_l0, const u32 *src_l1, const u32 *src_r0, const u32 *src_r1)
{
u32 s0 = 0;
@ -1024,6 +1035,7 @@ void append_block8 (const u32 offset, u32 *buf0, u32 *buf1, const u32 *src_l0, c
buf1[3] = src_l1[3] | s7;
}
void reverse_block (u32 *in0, u32 *in1, u32 *out0, u32 *out1, const u32 len);
void reverse_block (u32 *in0, u32 *in1, u32 *out0, u32 *out1, const u32 len)
{
rshift_block_N (in0, in1, out0, out1, 32 - len);
@ -1050,6 +1062,7 @@ void reverse_block (u32 *in0, u32 *in1, u32 *out0, u32 *out1, const u32 len)
out1[3] = swap32_S (tib41[3]);
}
void exchange_byte (u32 *buf, const int off_src, const int off_dst);
void exchange_byte (u32 *buf, const int off_src, const int off_dst)
{
u8 *ptr = (u8 *) buf;
@ -1060,6 +1073,7 @@ void exchange_byte (u32 *buf, const int off_src, const int off_dst)
ptr[off_dst] = tmp;
}
u32 rule_op_mangle_lrest (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_lrest (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
u32 t;
@ -1076,6 +1090,7 @@ u32 rule_op_mangle_lrest (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1,
return in_len;
}
u32 rule_op_mangle_urest (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_urest (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
u32 t;
@ -1092,6 +1107,7 @@ u32 rule_op_mangle_urest (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1,
return in_len;
}
u32 rule_op_mangle_lrest_ufirst (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_lrest_ufirst (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
u32 t;
@ -1110,6 +1126,7 @@ u32 rule_op_mangle_lrest_ufirst (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u
return in_len;
}
u32 rule_op_mangle_urest_lfirst (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_urest_lfirst (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
u32 t;
@ -1128,6 +1145,7 @@ u32 rule_op_mangle_urest_lfirst (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u
return in_len;
}
u32 rule_op_mangle_trest (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_trest (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
u32 t;
@ -1144,6 +1162,7 @@ u32 rule_op_mangle_trest (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1,
return in_len;
}
u32 rule_op_mangle_toggle_at (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_toggle_at (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
if (p0 >= in_len) return in_len;
@ -1177,6 +1196,7 @@ u32 rule_op_mangle_toggle_at (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32
return (in_len);
}
u32 rule_op_mangle_reverse (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_reverse (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
reverse_block (buf0, buf1, buf0, buf1, in_len);
@ -1184,6 +1204,7 @@ u32 rule_op_mangle_reverse (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1
return in_len;
}
u32 rule_op_mangle_dupeword (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_dupeword (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
if ((in_len + in_len) >= 32) return in_len;
@ -1197,6 +1218,7 @@ u32 rule_op_mangle_dupeword (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p
return out_len;
}
u32 rule_op_mangle_dupeword_times (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_dupeword_times (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
if (((in_len * p0) + in_len) >= 32) return in_len;
@ -1225,6 +1247,7 @@ u32 rule_op_mangle_dupeword_times (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const
return out_len;
}
u32 rule_op_mangle_reflect (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_reflect (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
if ((in_len + in_len) >= 32) return in_len;
@ -1243,6 +1266,7 @@ u32 rule_op_mangle_reflect (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1
return out_len;
}
u32 rule_op_mangle_append (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_append (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
if ((in_len + 1) >= 32) return in_len;
@ -1256,6 +1280,7 @@ u32 rule_op_mangle_append (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1,
return out_len;
}
u32 rule_op_mangle_prepend (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_prepend (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
if ((in_len + 1) >= 32) return in_len;
@ -1271,6 +1296,7 @@ u32 rule_op_mangle_prepend (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1
return out_len;
}
u32 rule_op_mangle_rotate_left (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_rotate_left (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
if (in_len == 0) return in_len;
@ -1286,6 +1312,7 @@ u32 rule_op_mangle_rotate_left (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u3
return in_len;
}
u32 rule_op_mangle_rotate_right (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_rotate_right (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
if (in_len == 0) return in_len;
@ -1328,6 +1355,7 @@ u32 rule_op_mangle_rotate_right (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u
return in_len;
}
u32 rule_op_mangle_delete_first (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_delete_first (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
if (in_len == 0) return in_len;
@ -1339,6 +1367,7 @@ u32 rule_op_mangle_delete_first (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u
return in_len1;
}
u32 rule_op_mangle_delete_last (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_delete_last (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
if (in_len == 0) return in_len;
@ -1359,6 +1388,7 @@ u32 rule_op_mangle_delete_last (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u3
return in_len1;
}
u32 rule_op_mangle_delete_at (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_delete_at (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
if (p0 >= in_len) return in_len;
@ -1440,6 +1470,7 @@ u32 rule_op_mangle_delete_at (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32
return out_len;
}
u32 rule_op_mangle_extract (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_extract (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
if (p0 >= in_len) return in_len;
@ -1455,6 +1486,7 @@ u32 rule_op_mangle_extract (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1
return out_len;
}
u32 rule_op_mangle_omit (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_omit (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
if (p0 >= in_len) return in_len;
@ -1547,6 +1579,7 @@ u32 rule_op_mangle_omit (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, M
return out_len;
}
u32 rule_op_mangle_insert (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_insert (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
if (p0 > in_len) return in_len;
@ -1625,6 +1658,7 @@ u32 rule_op_mangle_insert (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1,
return out_len;
}
u32 rule_op_mangle_overstrike (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_overstrike (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
if (p0 >= in_len) return in_len;
@ -1660,6 +1694,7 @@ u32 rule_op_mangle_overstrike (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32
return in_len;
}
u32 rule_op_mangle_truncate_at (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_truncate_at (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
if (p0 >= in_len) return in_len;
@ -1669,6 +1704,7 @@ u32 rule_op_mangle_truncate_at (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u3
return p0;
}
u32 search_on_register (const u32 in, const u32 p0);
u32 search_on_register (const u32 in, const u32 p0)
{
u32 r = 0;
@ -1681,6 +1717,7 @@ u32 search_on_register (const u32 in, const u32 p0)
return r;
}
u32 replace_on_register (const u32 in, const u32 r, const u32 p1);
u32 replace_on_register (const u32 in, const u32 r, const u32 p1)
{
u32 out = in;
@ -1693,6 +1730,7 @@ u32 replace_on_register (const u32 in, const u32 r, const u32 p1)
return out;
}
u32 rule_op_mangle_replace (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_replace (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
const u32 r0 = search_on_register (buf0[0], p0);
@ -1720,6 +1758,7 @@ u32 rule_op_mangle_replace (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1
return in_len;
}
u32 rule_op_mangle_purgechar (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_purgechar (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
const u32 r0 = search_on_register (buf0[0], p0);
@ -1774,6 +1813,7 @@ u32 rule_op_mangle_purgechar (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32
return out_len;
}
u32 rule_op_mangle_dupechar_first (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_dupechar_first (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
if ( in_len == 0) return in_len;
@ -1809,6 +1849,7 @@ u32 rule_op_mangle_dupechar_first (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const
return out_len;
}
u32 rule_op_mangle_dupechar_last (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_dupechar_last (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
if ( in_len == 0) return in_len;
@ -1855,6 +1896,7 @@ u32 rule_op_mangle_dupechar_last (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const
return out_len;
}
u32 rule_op_mangle_dupechar_all (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_dupechar_all (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
if ( in_len == 0) return in_len;
@ -1888,6 +1930,7 @@ u32 rule_op_mangle_dupechar_all (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u
return out_len;
}
u32 rule_op_mangle_switch_first (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_switch_first (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
if (in_len < 2) return in_len;
@ -1897,6 +1940,7 @@ u32 rule_op_mangle_switch_first (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u
return in_len;
}
u32 rule_op_mangle_switch_last (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_switch_last (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
if (in_len < 2) return in_len;
@ -1926,6 +1970,7 @@ u32 rule_op_mangle_switch_last (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u3
return in_len;
}
u32 rule_op_mangle_switch_at (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_switch_at (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
if (p0 >= in_len) return in_len;
@ -1956,6 +2001,7 @@ u32 rule_op_mangle_switch_at (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32
return in_len;
}
u32 rule_op_mangle_chr_shiftl (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_chr_shiftl (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
if (p0 >= in_len) return in_len;
@ -1990,6 +2036,7 @@ u32 rule_op_mangle_chr_shiftl (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32
return in_len;
}
u32 rule_op_mangle_chr_shiftr (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_chr_shiftr (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
if (p0 >= in_len) return in_len;
@ -2024,6 +2071,7 @@ u32 rule_op_mangle_chr_shiftr (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32
return in_len;
}
u32 rule_op_mangle_chr_incr (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_chr_incr (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
if (p0 >= in_len) return in_len;
@ -2060,6 +2108,7 @@ u32 rule_op_mangle_chr_incr (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p
return in_len;
}
u32 rule_op_mangle_chr_decr (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_chr_decr (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
if (p0 >= in_len) return in_len;
@ -2096,6 +2145,7 @@ u32 rule_op_mangle_chr_decr (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p
return in_len;
}
u32 rule_op_mangle_replace_np1 (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_replace_np1 (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
if ((p0 + 1) >= in_len) return in_len;
@ -2136,6 +2186,7 @@ u32 rule_op_mangle_replace_np1 (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u3
return in_len;
}
u32 rule_op_mangle_replace_nm1 (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_replace_nm1 (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
if (p0 == 0) return in_len;
@ -2178,6 +2229,7 @@ u32 rule_op_mangle_replace_nm1 (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u3
return in_len;
}
u32 rule_op_mangle_dupeblock_first (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_dupeblock_first (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
if (p0 > in_len) return in_len;
@ -2216,6 +2268,7 @@ u32 rule_op_mangle_dupeblock_first (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED cons
return out_len;
}
u32 rule_op_mangle_dupeblock_last (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_dupeblock_last (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
if (p0 > in_len) return in_len;
@ -2245,6 +2298,7 @@ u32 rule_op_mangle_dupeblock_last (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const
return out_len;
}
u32 toggle_on_register (const u32 in, const u32 r);
u32 toggle_on_register (const u32 in, const u32 r)
{
u32 out = in;
@ -2259,6 +2313,7 @@ u32 toggle_on_register (const u32 in, const u32 r)
return out;
}
u32 rule_op_mangle_title_sep (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len);
u32 rule_op_mangle_title_sep (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 *buf0, MAYBE_UNUSED u32 *buf1, const u32 in_len)
{
if (in_len == 0) return in_len;
@ -2299,6 +2354,7 @@ u32 rule_op_mangle_title_sep (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32
return in_len;
}
u32 apply_rule (const u32 name, const u32 p0, const u32 p1, u32 *buf0, u32 *buf1, const u32 in_len);
u32 apply_rule (const u32 name, const u32 p0, const u32 p1, u32 *buf0, u32 *buf1, const u32 in_len)
{
u32 out_len = in_len;
@ -2351,6 +2407,7 @@ u32 apply_rule (const u32 name, const u32 p0, const u32 p1, u32 *buf0, u32 *buf1
return out_len;
}
u32 apply_rules (__constant const u32 *cmds, u32 *buf0, u32 *buf1, const u32 len);
u32 apply_rules (__constant const u32 *cmds, u32 *buf0, u32 *buf1, const u32 len)
{
u32 out_len = len;
@ -2369,6 +2426,7 @@ u32 apply_rules (__constant const u32 *cmds, u32 *buf0, u32 *buf1, const u32 len
return out_len;
}
u32x apply_rules_vect (const u32 *pw_buf0, const u32 *pw_buf1, const u32 pw_len, __constant const kernel_rule_t *rules_buf, const u32 il_pos, u32x *buf0, u32x *buf1);
u32x apply_rules_vect (const u32 *pw_buf0, const u32 *pw_buf1, const u32 pw_len, __constant const kernel_rule_t *rules_buf, const u32 il_pos, u32x *buf0, u32x *buf1)
{
#if VECT_SIZE == 1

@ -1048,6 +1048,7 @@
// attack-mode 0
DECLSPEC u32x ix_create_bft (__global const bf_t *bfs_buf, const u32 il_pos);
DECLSPEC u32x ix_create_bft (__global const bf_t *bfs_buf, const u32 il_pos)
{
#if VECT_SIZE == 1
@ -1067,6 +1068,7 @@ DECLSPEC u32x ix_create_bft (__global const bf_t *bfs_buf, const u32 il_pos)
// attack-mode 1
DECLSPEC u32x pwlenx_create_combt (__global const pw_t *combs_buf, const u32 il_pos);
DECLSPEC u32x pwlenx_create_combt (__global const pw_t *combs_buf, const u32 il_pos)
{
#if VECT_SIZE == 1
@ -1084,6 +1086,7 @@ DECLSPEC u32x pwlenx_create_combt (__global const pw_t *combs_buf, const u32 il_
return pw_lenx;
}
DECLSPEC u32x ix_create_combt (__global const pw_t *combs_buf, const u32 il_pos, const int idx);
DECLSPEC u32x ix_create_combt (__global const pw_t *combs_buf, const u32 il_pos, const int idx)
{
#if VECT_SIZE == 1

@ -66,6 +66,7 @@ __constant u32a crc32tab[0x100] =
0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
};
DECLSPEC u32 round_crc32 (u32 a, const u32 v);
DECLSPEC u32 round_crc32 (u32 a, const u32 v)
{
const u32 k = (a ^ v) & 0xff;
@ -79,6 +80,7 @@ DECLSPEC u32 round_crc32 (u32 a, const u32 v)
return a;
}
DECLSPEC u32 round_crc32_4 (const u32 w, const u32 iv);
DECLSPEC u32 round_crc32_4 (const u32 w, const u32 iv)
{
u32 a = iv;

@ -1,3 +1,4 @@
DECLSPEC u32 u8add (const u32 a, const u32 b);
DECLSPEC u32 u8add (const u32 a, const u32 b)
{
const u32 a1 = (a >> 0) & 0xff;

@ -1,3 +1,4 @@
DECLSPEC void xts_mul2 (u32 *in, u32 *out);
DECLSPEC void xts_mul2 (u32 *in, u32 *out)
{
const u32 c = in[3] >> 31;
@ -10,6 +11,7 @@ DECLSPEC void xts_mul2 (u32 *in, u32 *out)
out[0] ^= c * 0x87;
}
DECLSPEC void aes256_decrypt_xts_first (const u32 *ukey1, const u32 *ukey2, const u32 *in, u32 *out, u32 *S, u32 *T, u32 *ks, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void aes256_decrypt_xts_first (const u32 *ukey1, const u32 *ukey2, const u32 *in, u32 *out, u32 *S, u32 *T, u32 *ks, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
out[0] = in[0];
@ -34,6 +36,7 @@ DECLSPEC void aes256_decrypt_xts_first (const u32 *ukey1, const u32 *ukey2, cons
out[3] ^= T[3];
}
DECLSPEC void aes256_decrypt_xts_next (const u32 *in, u32 *out, u32 *T, u32 *ks, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC void aes256_decrypt_xts_next (const u32 *in, u32 *out, u32 *T, u32 *ks, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
out[0] = in[0];
@ -56,6 +59,7 @@ DECLSPEC void aes256_decrypt_xts_next (const u32 *in, u32 *out, u32 *T, u32 *ks,
out[3] ^= T[3];
}
DECLSPEC void serpent256_decrypt_xts_first (const u32 *ukey1, const u32 *ukey2, const u32 *in, u32 *out, u32 *S, u32 *T, u32 *ks);
DECLSPEC void serpent256_decrypt_xts_first (const u32 *ukey1, const u32 *ukey2, const u32 *in, u32 *out, u32 *S, u32 *T, u32 *ks)
{
out[0] = in[0];
@ -80,6 +84,7 @@ DECLSPEC void serpent256_decrypt_xts_first (const u32 *ukey1, const u32 *ukey2,
out[3] ^= T[3];
}
DECLSPEC void serpent256_decrypt_xts_next (const u32 *in, u32 *out, u32 *T, u32 *ks);
DECLSPEC void serpent256_decrypt_xts_next (const u32 *in, u32 *out, u32 *T, u32 *ks)
{
out[0] = in[0];
@ -102,6 +107,7 @@ DECLSPEC void serpent256_decrypt_xts_next (const u32 *in, u32 *out, u32 *T, u32
out[3] ^= T[3];
}
DECLSPEC void twofish256_decrypt_xts_first (const u32 *ukey1, const u32 *ukey2, const u32 *in, u32 *out, u32 *S, u32 *T, u32 *sk, u32 *lk);
DECLSPEC void twofish256_decrypt_xts_first (const u32 *ukey1, const u32 *ukey2, const u32 *in, u32 *out, u32 *S, u32 *T, u32 *sk, u32 *lk)
{
out[0] = in[0];
@ -126,6 +132,7 @@ DECLSPEC void twofish256_decrypt_xts_first (const u32 *ukey1, const u32 *ukey2,
out[3] ^= T[3];
}
DECLSPEC void twofish256_decrypt_xts_next (const u32 *in, u32 *out, u32 *T, u32 *sk, u32 *lk);
DECLSPEC void twofish256_decrypt_xts_next (const u32 *in, u32 *out, u32 *T, u32 *sk, u32 *lk)
{
out[0] = in[0];
@ -150,6 +157,7 @@ DECLSPEC void twofish256_decrypt_xts_next (const u32 *in, u32 *out, u32 *T, u32
// 512 bit
DECLSPEC int verify_header_aes (__global const tc_t *esalt_bufs, const u32 *ukey1, const u32 *ukey2, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC int verify_header_aes (__global const tc_t *esalt_bufs, const u32 *ukey1, const u32 *ukey2, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 ks_aes[60];
@ -206,6 +214,7 @@ DECLSPEC int verify_header_aes (__global const tc_t *esalt_bufs, const u32 *ukey
return 1;
}
DECLSPEC int verify_header_serpent (__global const tc_t *esalt_bufs, const u32 *ukey1, const u32 *ukey2);
DECLSPEC int verify_header_serpent (__global const tc_t *esalt_bufs, const u32 *ukey1, const u32 *ukey2)
{
u32 ks_serpent[140];
@ -262,6 +271,7 @@ DECLSPEC int verify_header_serpent (__global const tc_t *esalt_bufs, const u32 *
return 1;
}
DECLSPEC int verify_header_twofish (__global const tc_t *esalt_bufs, const u32 *ukey1, const u32 *ukey2);
DECLSPEC int verify_header_twofish (__global const tc_t *esalt_bufs, const u32 *ukey1, const u32 *ukey2)
{
u32 sk_twofish[4];
@ -321,6 +331,7 @@ DECLSPEC int verify_header_twofish (__global const tc_t *esalt_bufs, const u32 *
// 1024 bit
DECLSPEC int verify_header_aes_twofish (__global const tc_t *esalt_bufs, const u32 *ukey1, const u32 *ukey2, const u32 *ukey3, const u32 *ukey4, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC int verify_header_aes_twofish (__global const tc_t *esalt_bufs, const u32 *ukey1, const u32 *ukey2, const u32 *ukey3, const u32 *ukey4, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 ks_aes[60];
@ -384,6 +395,7 @@ DECLSPEC int verify_header_aes_twofish (__global const tc_t *esalt_bufs, const u
return 1;
}
DECLSPEC int verify_header_serpent_aes (__global const tc_t *esalt_bufs, const u32 *ukey1, const u32 *ukey2, const u32 *ukey3, const u32 *ukey4, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC int verify_header_serpent_aes (__global const tc_t *esalt_bufs, const u32 *ukey1, const u32 *ukey2, const u32 *ukey3, const u32 *ukey4, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 ks_serpent[140];
@ -445,6 +457,7 @@ DECLSPEC int verify_header_serpent_aes (__global const tc_t *esalt_bufs, const u
return 1;
}
DECLSPEC int verify_header_twofish_serpent (__global const tc_t *esalt_bufs, const u32 *ukey1, const u32 *ukey2, const u32 *ukey3, const u32 *ukey4);
DECLSPEC int verify_header_twofish_serpent (__global const tc_t *esalt_bufs, const u32 *ukey1, const u32 *ukey2, const u32 *ukey3, const u32 *ukey4)
{
u32 sk_twofish[4];
@ -510,6 +523,7 @@ DECLSPEC int verify_header_twofish_serpent (__global const tc_t *esalt_bufs, con
// 1536 bit
DECLSPEC int verify_header_aes_twofish_serpent (__global const tc_t *esalt_bufs, const u32 *ukey1, const u32 *ukey2, const u32 *ukey3, const u32 *ukey4, const u32 *ukey5, const u32 *ukey6, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC int verify_header_aes_twofish_serpent (__global const tc_t *esalt_bufs, const u32 *ukey1, const u32 *ukey2, const u32 *ukey3, const u32 *ukey4, const u32 *ukey5, const u32 *ukey6, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 ks_aes[60];
@ -579,6 +593,7 @@ DECLSPEC int verify_header_aes_twofish_serpent (__global const tc_t *esalt_bufs,
return 1;
}
DECLSPEC int verify_header_serpent_twofish_aes (__global const tc_t *esalt_bufs, const u32 *ukey1, const u32 *ukey2, const u32 *ukey3, const u32 *ukey4, const u32 *ukey5, const u32 *ukey6, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC int verify_header_serpent_twofish_aes (__global const tc_t *esalt_bufs, const u32 *ukey1, const u32 *ukey2, const u32 *ukey3, const u32 *ukey4, const u32 *ukey5, const u32 *ukey6, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 ks_serpent[140];

@ -39,6 +39,7 @@ typedef VTYPE(uint, VECT_SIZE) u32x;
typedef VTYPE(ulong, VECT_SIZE) u64x;
#endif
DECLSPEC u32 l32_from_64_S (u64 a);
DECLSPEC u32 l32_from_64_S (u64 a)
{
const u32 r = (u32) (a);
@ -46,6 +47,7 @@ DECLSPEC u32 l32_from_64_S (u64 a)
return r;
}
DECLSPEC u32 h32_from_64_S (u64 a);
DECLSPEC u32 h32_from_64_S (u64 a)
{
a >>= 32;
@ -55,11 +57,13 @@ DECLSPEC u32 h32_from_64_S (u64 a)
return r;
}
DECLSPEC u64 hl32_to_64_S (const u32 a, const u32 b);
DECLSPEC u64 hl32_to_64_S (const u32 a, const u32 b)
{
return as_ulong ((uint2) (b, a));
}
DECLSPEC u32x l32_from_64 (u64x a);
DECLSPEC u32x l32_from_64 (u64x a)
{
u32x r;
@ -99,6 +103,7 @@ DECLSPEC u32x l32_from_64 (u64x a)
return r;
}
DECLSPEC u32x h32_from_64 (u64x a);
DECLSPEC u32x h32_from_64 (u64x a)
{
a >>= 32;
@ -140,6 +145,7 @@ DECLSPEC u32x h32_from_64 (u64x a)
return r;
}
DECLSPEC u64x hl32_to_64 (const u32x a, const u32x b);
DECLSPEC u64x hl32_to_64 (const u32x a, const u32x b)
{
u64x r;
@ -182,6 +188,7 @@ DECLSPEC u64x hl32_to_64 (const u32x a, const u32x b)
#ifdef IS_AMD
#if HAS_VPERM
DECLSPEC u32 swap32_S (const u32 v);
DECLSPEC u32 swap32_S (const u32 v)
{
u32 r;
@ -191,6 +198,7 @@ DECLSPEC u32 swap32_S (const u32 v)
return r;
}
DECLSPEC u64 swap64_S (const u64 v);
DECLSPEC u64 swap64_S (const u64 v)
{
const u32 v0 = h32_from_64_S (v);
@ -207,27 +215,32 @@ DECLSPEC u64 swap64_S (const u64 v)
return r;
}
#else
DECLSPEC u32 swap32_S (const u32 v);
DECLSPEC u32 swap32_S (const u32 v)
{
return as_uint (as_uchar4 (v).s3210);
}
DECLSPEC u64 swap64_S (const u64 v);
DECLSPEC u64 swap64_S (const u64 v)
{
return (as_ulong (as_uchar8 (v).s76543210));
}
#endif
DECLSPEC u32 rotr32_S (const u32 a, const u32 n);
DECLSPEC u32 rotr32_S (const u32 a, const u32 n)
{
return rotate (a, (32 - n));
}
DECLSPEC u32 rotl32_S (const u32 a, const u32 n);
DECLSPEC u32 rotl32_S (const u32 a, const u32 n)
{
return rotate (a, n);
}
DECLSPEC u64 rotr64_S (const u64 a, const u32 n);
DECLSPEC u64 rotr64_S (const u64 a, const u32 n)
{
const u32 a0 = h32_from_64_S (a);
@ -241,17 +254,20 @@ DECLSPEC u64 rotr64_S (const u64 a, const u32 n)
return r;
}
DECLSPEC u64 rotl64_S (const u64 a, const u32 n);
DECLSPEC u64 rotl64_S (const u64 a, const u32 n)
{
return rotr64_S (a, 64 - n);
}
#if HAS_VPERM
DECLSPEC u32x swap32 (const u32x v);
DECLSPEC u32x swap32 (const u32x v)
{
return bitselect (rotate (v, 24u), rotate (v, 8u), 0x00ff00ffu);
}
DECLSPEC u64x swap64 (const u64x v);
DECLSPEC u64x swap64 (const u64x v)
{
const u32x a0 = h32_from_64 (v);
@ -314,11 +330,13 @@ DECLSPEC u64x swap64 (const u64x v)
return r;
}
#else
DECLSPEC u32x swap32 (const u32x v);
DECLSPEC u32x swap32 (const u32x v)
{
return bitselect (rotate (v, 24u), rotate (v, 8u), 0x00ff00ffu);
}
DECLSPEC u64x swap64 (const u64x v);
DECLSPEC u64x swap64 (const u64x v)
{
return bitselect (bitselect (rotate (v, 24ul),
@ -329,16 +347,19 @@ DECLSPEC u64x swap64 (const u64x v)
}
#endif
DECLSPEC u32x rotr32 (const u32x a, const u32 n);
DECLSPEC u32x rotr32 (const u32x a, const u32 n)
{
return rotate (a, (32 - n));
}
DECLSPEC u32x rotl32 (const u32x a, const u32 n);
DECLSPEC u32x rotl32 (const u32x a, const u32 n)
{
return rotate (a, n);
}
DECLSPEC u64x rotr64 (const u64x a, const u32 n);
DECLSPEC u64x rotr64 (const u64x a, const u32 n)
{
const u32x a0 = h32_from_64 (a);
@ -352,11 +373,13 @@ DECLSPEC u64x rotr64 (const u64x a, const u32 n)
return r;
}
DECLSPEC u64x rotl64 (const u64x a, const u32 n);
DECLSPEC u64x rotl64 (const u64x a, const u32 n)
{
return rotr64 (a, 64 - n);
}
DECLSPEC u32x hc_bfe (const u32x a, const u32x b, const u32x c);
DECLSPEC u32x hc_bfe (const u32x a, const u32x b, const u32x c)
{
#define BIT(x) ((u32x) (1u) << (x))
@ -370,6 +393,7 @@ DECLSPEC u32x hc_bfe (const u32x a, const u32x b, const u32x c)
#undef BFE
}
DECLSPEC u32 hc_bfe_S (const u32 a, const u32 b, const u32 c);
DECLSPEC u32 hc_bfe_S (const u32 a, const u32 b, const u32 c)
{
#define BIT(x) (1u << (x))
@ -383,6 +407,7 @@ DECLSPEC u32 hc_bfe_S (const u32 a, const u32 b, const u32 c)
#undef BFE
}
DECLSPEC u32x hc_bytealign_be (const u32x a, const u32x b, const u32 c);
DECLSPEC u32x hc_bytealign_be (const u32x a, const u32x b, const u32 c)
{
u32x r;
@ -398,6 +423,7 @@ DECLSPEC u32x hc_bytealign_be (const u32x a, const u32x b, const u32 c)
return r;
}
DECLSPEC u32 hc_bytealign_be_S (const u32 a, const u32 b, const u32 c);
DECLSPEC u32 hc_bytealign_be_S (const u32 a, const u32 b, const u32 c)
{
u32 r;
@ -413,6 +439,7 @@ DECLSPEC u32 hc_bytealign_be_S (const u32 a, const u32 b, const u32 c)
return r;
}
DECLSPEC u32x hc_bytealign (const u32x a, const u32x b, const u32 c);
DECLSPEC u32x hc_bytealign (const u32x a, const u32x b, const u32 c)
{
u32x r;
@ -428,6 +455,7 @@ DECLSPEC u32x hc_bytealign (const u32x a, const u32x b, const u32 c)
return r;
}
DECLSPEC u32 hc_bytealign_S (const u32 a, const u32 b, const u32 c);
DECLSPEC u32 hc_bytealign_S (const u32 a, const u32 b, const u32 c)
{
u32 r;
@ -444,6 +472,7 @@ DECLSPEC u32 hc_bytealign_S (const u32 a, const u32 b, const u32 c)
}
#if HAS_VPERM
DECLSPEC u32x hc_byte_perm (const u32x a, const u32x b, const u32x c);
DECLSPEC u32x hc_byte_perm (const u32x a, const u32x b, const u32x c)
{
u32x r;
@ -497,6 +526,7 @@ DECLSPEC u32x hc_byte_perm (const u32x a, const u32x b, const u32x c)
return r;
}
DECLSPEC u32 hc_byte_perm_S (const u32 a, const u32 b, const u32 c);
DECLSPEC u32 hc_byte_perm_S (const u32 a, const u32 b, const u32 c)
{
u32 r;
@ -508,6 +538,7 @@ DECLSPEC u32 hc_byte_perm_S (const u32 a, const u32 b, const u32 c)
#endif
#if HAS_VADD3
DECLSPEC u32x hc_add3 (const u32x a, const u32x b, const u32x c);
DECLSPEC u32x hc_add3 (const u32x a, const u32x b, const u32x c)
{
u32x r;
@ -561,6 +592,7 @@ DECLSPEC u32x hc_add3 (const u32x a, const u32x b, const u32x c)
return r;
}
DECLSPEC u32 hc_add3_S (const u32 a, const u32 b, const u32 c);
DECLSPEC u32 hc_add3_S (const u32 a, const u32 b, const u32 c)
{
u32 r;
@ -570,22 +602,26 @@ DECLSPEC u32 hc_add3_S (const u32 a, const u32 b, const u32 c)
return r;
}
#else
DECLSPEC u32x hc_add3 (const u32x a, const u32x b, const u32x c);
DECLSPEC u32x hc_add3 (const u32x a, const u32x b, const u32x c)
{
return a + b + c;
}
DECLSPEC u32 hc_add3_S (const u32 a, const u32 b, const u32 c);
DECLSPEC u32 hc_add3_S (const u32 a, const u32 b, const u32 c)
{
return a + b + c;
}
#endif
DECLSPEC u32x hc_lop_0x96 (const u32x a, const u32x b, const u32x c);
DECLSPEC u32x hc_lop_0x96 (const u32x a, const u32x b, const u32x c)
{
return a ^ b ^ c;
}
DECLSPEC u32 hc_lop_0x96_S (const u32 a, const u32 b, const u32 c);
DECLSPEC u32 hc_lop_0x96_S (const u32 a, const u32 b, const u32 c)
{
return a ^ b ^ c;
@ -594,6 +630,7 @@ DECLSPEC u32 hc_lop_0x96_S (const u32 a, const u32 b, const u32 c)
#endif
#ifdef IS_NV
DECLSPEC u32 swap32_S (const u32 v);
DECLSPEC u32 swap32_S (const u32 v)
{
u32 r;
@ -603,6 +640,7 @@ DECLSPEC u32 swap32_S (const u32 v)
return r;
}
DECLSPEC u64 swap64_S (const u64 v);
DECLSPEC u64 swap64_S (const u64 v)
{
u32 il;
@ -623,26 +661,31 @@ DECLSPEC u64 swap64_S (const u64 v)
return r;
}
DECLSPEC u32 rotr32_S (const u32 a, const u32 n);
DECLSPEC u32 rotr32_S (const u32 a, const u32 n)
{
return rotate (a, (32 - n));
}
DECLSPEC u32 rotl32_S (const u32 a, const u32 n);
DECLSPEC u32 rotl32_S (const u32 a, const u32 n)
{
return rotate (a, n);
}
DECLSPEC u64 rotr64_S (const u64 a, const u32 n);
DECLSPEC u64 rotr64_S (const u64 a, const u32 n)
{
return rotate (a, (u64) (64 - n));
}
DECLSPEC u64 rotl64_S (const u64 a, const u32 n);
DECLSPEC u64 rotl64_S (const u64 a, const u32 n)
{
return rotate (a, (u64) n);
}
DECLSPEC u32x swap32 (const u32x v);
DECLSPEC u32x swap32 (const u32x v)
{
u32x r;
@ -682,6 +725,7 @@ DECLSPEC u32x swap32 (const u32x v)
return r;
}
DECLSPEC u64x swap64 (const u64x v);
DECLSPEC u64x swap64 (const u64x v)
{
u32x il;
@ -808,26 +852,31 @@ DECLSPEC u64x swap64 (const u64x v)
return r;
}
DECLSPEC u32x rotr32 (const u32x a, const u32 n);
DECLSPEC u32x rotr32 (const u32x a, const u32 n)
{
return rotate (a, (32 - n));
}
DECLSPEC u32x rotl32 (const u32x a, const u32 n);
DECLSPEC u32x rotl32 (const u32x a, const u32 n)
{
return rotate (a, n);
}
DECLSPEC u64x rotr64 (const u64x a, const u32 n);
DECLSPEC u64x rotr64 (const u64x a, const u32 n)
{
return rotate (a, (u64x) (64 - n));
}
DECLSPEC u64x rotl64 (const u64x a, const u32 n);
DECLSPEC u64x rotl64 (const u64x a, const u32 n)
{
return rotate (a, (u64x) n);
}
DECLSPEC u32x hc_byte_perm (const u32x a, const u32x b, const u32x c);
DECLSPEC u32x hc_byte_perm (const u32x a, const u32x b, const u32x c)
{
u32x r;
@ -867,6 +916,7 @@ DECLSPEC u32x hc_byte_perm (const u32x a, const u32x b, const u32x c)
return r;
}
DECLSPEC u32 hc_byte_perm_S (const u32 a, const u32 b, const u32 c);
DECLSPEC u32 hc_byte_perm_S (const u32 a, const u32 b, const u32 c)
{
u32 r;
@ -876,6 +926,7 @@ DECLSPEC u32 hc_byte_perm_S (const u32 a, const u32 b, const u32 c)
return r;
}
DECLSPEC u32x hc_bfe (const u32x a, const u32x b, const u32x c);
DECLSPEC u32x hc_bfe (const u32x a, const u32x b, const u32x c)
{
u32x r;
@ -915,6 +966,7 @@ DECLSPEC u32x hc_bfe (const u32x a, const u32x b, const u32x c)
return r;
}
DECLSPEC u32 hc_bfe_S (const u32 a, const u32 b, const u32 c);
DECLSPEC u32 hc_bfe_S (const u32 a, const u32 b, const u32 c)
{
u32 r;
@ -924,6 +976,7 @@ DECLSPEC u32 hc_bfe_S (const u32 a, const u32 b, const u32 c)
return r;
}
DECLSPEC u32x hc_bytealign (const u32x a, const u32x b, const u32x c);
DECLSPEC u32x hc_bytealign (const u32x a, const u32x b, const u32x c)
{
u32x r;
@ -971,6 +1024,7 @@ DECLSPEC u32x hc_bytealign (const u32x a, const u32x b, const u32x c)
return r;
}
DECLSPEC u32 hc_bytealign_S (const u32 a, const u32 b, const u32 c);
DECLSPEC u32 hc_bytealign_S (const u32 a, const u32 b, const u32 c)
{
u32 r;
@ -988,16 +1042,19 @@ DECLSPEC u32 hc_bytealign_S (const u32 a, const u32 b, const u32 c)
return r;
}
DECLSPEC u32x hc_add3 (const u32x a, const u32x b, const u32x c);
DECLSPEC u32x hc_add3 (const u32x a, const u32x b, const u32x c)
{
return a + b + c;
}
DECLSPEC u32 hc_add3_S (const u32 a, const u32 b, const u32 c);
DECLSPEC u32 hc_add3_S (const u32 a, const u32 b, const u32 c)
{
return a + b + c;
}
DECLSPEC u32x hc_lop_0x96 (const u32x a, const u32x b, const u32x c);
DECLSPEC u32x hc_lop_0x96 (const u32x a, const u32x b, const u32x c)
{
u32x r;
@ -1045,6 +1102,7 @@ DECLSPEC u32x hc_lop_0x96 (const u32x a, const u32x b, const u32x c)
return r;
}
DECLSPEC u32 hc_lop_0x96_S (const u32 a, const u32 b, const u32 c);
DECLSPEC u32 hc_lop_0x96_S (const u32 a, const u32 b, const u32 c)
{
u32 r;
@ -1065,36 +1123,43 @@ DECLSPEC u32 hc_lop_0x96_S (const u32 a, const u32 b, const u32 c)
#endif
#ifdef IS_GENERIC
DECLSPEC u32 swap32_S (const u32 v);
DECLSPEC u32 swap32_S (const u32 v)
{
return (as_uint (as_uchar4 (v).s3210));
}
DECLSPEC u64 swap64_S (const u64 v);
DECLSPEC u64 swap64_S (const u64 v)
{
return (as_ulong (as_uchar8 (v).s76543210));
}
DECLSPEC u32 rotr32_S (const u32 a, const u32 n);
DECLSPEC u32 rotr32_S (const u32 a, const u32 n)
{
return rotate (a, (32 - n));
}
DECLSPEC u32 rotl32_S (const u32 a, const u32 n);
DECLSPEC u32 rotl32_S (const u32 a, const u32 n)
{
return rotate (a, n);
}
DECLSPEC u64 rotr64_S (const u64 a, const u32 n);
DECLSPEC u64 rotr64_S (const u64 a, const u32 n)
{
return rotate (a, (u64) (64 - n));
}
DECLSPEC u64 rotl64_S (const u64 a, const u32 n);
DECLSPEC u64 rotl64_S (const u64 a, const u32 n)
{
return rotate (a, (u64) n);
}
DECLSPEC u32x swap32 (const u32x v);
DECLSPEC u32x swap32 (const u32x v)
{
return ((v >> 24) & 0x000000ff)
@ -1103,6 +1168,7 @@ DECLSPEC u32x swap32 (const u32x v)
| ((v << 24) & 0xff000000);
}
DECLSPEC u64x swap64 (const u64x v);
DECLSPEC u64x swap64 (const u64x v)
{
return ((v >> 56) & 0x00000000000000ff)
@ -1115,26 +1181,31 @@ DECLSPEC u64x swap64 (const u64x v)
| ((v << 56) & 0xff00000000000000);
}
DECLSPEC u32x rotr32 (const u32x a, const u32 n);
DECLSPEC u32x rotr32 (const u32x a, const u32 n)
{
return rotate (a, (32 - n));
}
DECLSPEC u32x rotl32 (const u32x a, const u32 n);
DECLSPEC u32x rotl32 (const u32x a, const u32 n)
{
return rotate (a, n);
}
DECLSPEC u64x rotr64 (const u64x a, const u32 n);
DECLSPEC u64x rotr64 (const u64x a, const u32 n)
{
return rotate (a, (u64x) (64 - n));
}
DECLSPEC u64x rotl64 (const u64x a, const u32 n);
DECLSPEC u64x rotl64 (const u64x a, const u32 n)
{
return rotate (a, (u64x) n);
}
DECLSPEC u32x hc_bfe (const u32x a, const u32x b, const u32x c);
DECLSPEC u32x hc_bfe (const u32x a, const u32x b, const u32x c)
{
#define BIT(x) ((u32x) (1u) << (x))
@ -1148,6 +1219,7 @@ DECLSPEC u32x hc_bfe (const u32x a, const u32x b, const u32x c)
#undef BFE
}
DECLSPEC u32 hc_bfe_S (const u32 a, const u32 b, const u32 c);
DECLSPEC u32 hc_bfe_S (const u32 a, const u32 b, const u32 c)
{
#define BIT(x) (1u << (x))
@ -1161,6 +1233,7 @@ DECLSPEC u32 hc_bfe_S (const u32 a, const u32 b, const u32 c)
#undef BFE
}
DECLSPEC u32x hc_bytealign_be (const u32x a, const u32x b, const u32 c);
DECLSPEC u32x hc_bytealign_be (const u32x a, const u32x b, const u32 c)
{
u32x r;
@ -1176,6 +1249,7 @@ DECLSPEC u32x hc_bytealign_be (const u32x a, const u32x b, const u32 c)
return r;
}
DECLSPEC u32 hc_bytealign_be_S (const u32 a, const u32 b, const u32 c);
DECLSPEC u32 hc_bytealign_be_S (const u32 a, const u32 b, const u32 c)
{
u32 r;
@ -1191,6 +1265,7 @@ DECLSPEC u32 hc_bytealign_be_S (const u32 a, const u32 b, const u32 c)
return r;
}
DECLSPEC u32x hc_bytealign (const u32x a, const u32x b, const u32 c);
DECLSPEC u32x hc_bytealign (const u32x a, const u32x b, const u32 c)
{
u32x r;
@ -1206,6 +1281,7 @@ DECLSPEC u32x hc_bytealign (const u32x a, const u32x b, const u32 c)
return r;
}
DECLSPEC u32 hc_bytealign_S (const u32 a, const u32 b, const u32 c);
DECLSPEC u32 hc_bytealign_S (const u32 a, const u32 b, const u32 c)
{
u32 r;
@ -1221,21 +1297,25 @@ DECLSPEC u32 hc_bytealign_S (const u32 a, const u32 b, const u32 c)
return r;
}
DECLSPEC u32x hc_add3 (const u32x a, const u32x b, const u32x c);
DECLSPEC u32x hc_add3 (const u32x a, const u32x b, const u32x c)
{
return a + b + c;
}
DECLSPEC u32 hc_add3_S (const u32 a, const u32 b, const u32 c);
DECLSPEC u32 hc_add3_S (const u32 a, const u32 b, const u32 c)
{
return a + b + c;
}
DECLSPEC u32x hc_lop_0x96 (const u32x a, const u32x b, const u32x c);
DECLSPEC u32x hc_lop_0x96 (const u32x a, const u32x b, const u32x c)
{
return a ^ b ^ c;
}
DECLSPEC u32 hc_lop_0x96_S (const u32 a, const u32 b, const u32 c);
DECLSPEC u32 hc_lop_0x96_S (const u32 a, const u32 b, const u32 c)
{
return a ^ b ^ c;

@ -1,3 +1,4 @@
DECLSPEC void camellia256_decrypt_xts_first (const u32 *ukey1, const u32 *ukey2, const u32 *in, u32 *out, u32 *S, u32 *T, u32 *ks);
DECLSPEC void camellia256_decrypt_xts_first (const u32 *ukey1, const u32 *ukey2, const u32 *in, u32 *out, u32 *S, u32 *T, u32 *ks)
{
out[0] = in[0];
@ -22,6 +23,7 @@ DECLSPEC void camellia256_decrypt_xts_first (const u32 *ukey1, const u32 *ukey2,
out[3] ^= T[3];
}
DECLSPEC void camellia256_decrypt_xts_next (const u32 *in, u32 *out, u32 *T, u32 *ks);
DECLSPEC void camellia256_decrypt_xts_next (const u32 *in, u32 *out, u32 *T, u32 *ks)
{
out[0] = in[0];
@ -44,6 +46,7 @@ DECLSPEC void camellia256_decrypt_xts_next (const u32 *in, u32 *out, u32 *T, u32
out[3] ^= T[3];
}
DECLSPEC void kuznyechik_decrypt_xts_first (const u32 *ukey1, const u32 *ukey2, const u32 *in, u32 *out, u32 *S, u32 *T, u32 *ks);
DECLSPEC void kuznyechik_decrypt_xts_first (const u32 *ukey1, const u32 *ukey2, const u32 *in, u32 *out, u32 *S, u32 *T, u32 *ks)
{
out[0] = in[0];
@ -68,6 +71,7 @@ DECLSPEC void kuznyechik_decrypt_xts_first (const u32 *ukey1, const u32 *ukey2,
out[3] ^= T[3];
}
DECLSPEC void kuznyechik_decrypt_xts_next (const u32 *in, u32 *out, u32 *T, u32 *ks);
DECLSPEC void kuznyechik_decrypt_xts_next (const u32 *in, u32 *out, u32 *T, u32 *ks)
{
out[0] = in[0];
@ -92,6 +96,7 @@ DECLSPEC void kuznyechik_decrypt_xts_next (const u32 *in, u32 *out, u32 *T, u32
// 512 bit
DECLSPEC int verify_header_camellia (__global const tc_t *esalt_bufs, const u32 *ukey1, const u32 *ukey2);
DECLSPEC int verify_header_camellia (__global const tc_t *esalt_bufs, const u32 *ukey1, const u32 *ukey2)
{
u32 ks_camellia[68];
@ -148,6 +153,7 @@ DECLSPEC int verify_header_camellia (__global const tc_t *esalt_bufs, const u32
return 1;
}
DECLSPEC int verify_header_kuznyechik (__global const tc_t *esalt_bufs, const u32 *ukey1, const u32 *ukey2);
DECLSPEC int verify_header_kuznyechik (__global const tc_t *esalt_bufs, const u32 *ukey1, const u32 *ukey2)
{
u32 ks_kuznyechik[40];
@ -206,6 +212,7 @@ DECLSPEC int verify_header_kuznyechik (__global const tc_t *esalt_bufs, const u3
// 1024 bit
DECLSPEC int verify_header_camellia_kuznyechik (__global const tc_t *esalt_bufs, const u32 *ukey1, const u32 *ukey2, const u32 *ukey3, const u32 *ukey4);
DECLSPEC int verify_header_camellia_kuznyechik (__global const tc_t *esalt_bufs, const u32 *ukey1, const u32 *ukey2, const u32 *ukey3, const u32 *ukey4)
{
u32 ks_camellia[68];
@ -267,6 +274,7 @@ DECLSPEC int verify_header_camellia_kuznyechik (__global const tc_t *esalt_bufs,
return 1;
}
DECLSPEC int verify_header_camellia_serpent (__global const tc_t *esalt_bufs, const u32 *ukey1, const u32 *ukey2, const u32 *ukey3, const u32 *ukey4);
DECLSPEC int verify_header_camellia_serpent (__global const tc_t *esalt_bufs, const u32 *ukey1, const u32 *ukey2, const u32 *ukey3, const u32 *ukey4)
{
u32 ks_camellia[68];
@ -328,6 +336,7 @@ DECLSPEC int verify_header_camellia_serpent (__global const tc_t *esalt_bufs, co
return 1;
}
DECLSPEC int verify_header_kuznyechik_aes (__global const tc_t *esalt_bufs, const u32 *ukey1, const u32 *ukey2, const u32 *ukey3, const u32 *ukey4, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4);
DECLSPEC int verify_header_kuznyechik_aes (__global const tc_t *esalt_bufs, const u32 *ukey1, const u32 *ukey2, const u32 *ukey3, const u32 *ukey4, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4, SHM_TYPE u32 *s_td0, SHM_TYPE u32 *s_td1, SHM_TYPE u32 *s_td2, SHM_TYPE u32 *s_td3, SHM_TYPE u32 *s_td4)
{
u32 ks_kuznyechik[40];
@ -389,6 +398,7 @@ DECLSPEC int verify_header_kuznyechik_aes (__global const tc_t *esalt_bufs, cons
return 1;
}
DECLSPEC int verify_header_kuznyechik_twofish (__global const tc_t *esalt_bufs, const u32 *ukey1, const u32 *ukey2, const u32 *ukey3, const u32 *ukey4);
DECLSPEC int verify_header_kuznyechik_twofish (__global const tc_t *esalt_bufs, const u32 *ukey1, const u32 *ukey2, const u32 *ukey3, const u32 *ukey4)
{
u32 ks_kuznyechik[40];
@ -454,6 +464,7 @@ DECLSPEC int verify_header_kuznyechik_twofish (__global const tc_t *esalt_bufs,
// 1536 bit
DECLSPEC int verify_header_kuznyechik_serpent_camellia (__global const tc_t *esalt_bufs, const u32 *ukey1, const u32 *ukey2, const u32 *ukey3, const u32 *ukey4, const u32 *ukey5, const u32 *ukey6);
DECLSPEC int verify_header_kuznyechik_serpent_camellia (__global const tc_t *esalt_bufs, const u32 *ukey1, const u32 *ukey2, const u32 *ukey3, const u32 *ukey4, const u32 *ukey5, const u32 *ukey6)
{
u32 ks_kuznyechik[40];

@ -433,9 +433,6 @@ __kernel void m15300_comp (KERN_ATTR_TMPS_ESALT (dpapimk_tmp_v1_t, dpapimk_t))
u32 w2[4];
u32 w3[4];
u32 ipad[5];
u32 opad[5];
u32 key[6];
key[0] = swap32_S (tmps[gid].out[0]);

@ -9,6 +9,7 @@
#include "inc_types.cl"
DECLSPEC void generate_pw (u32 *pw_buf, __global const cs_t *root_css_buf, __global const cs_t *markov_css_buf, const u32 pw_l_len, const u32 pw_r_len, const u32 mask80, const u32 bits14, const u32 bits15, u64 val);
DECLSPEC void generate_pw (u32 *pw_buf, __global const cs_t *root_css_buf, __global const cs_t *markov_css_buf, const u32 pw_l_len, const u32 pw_r_len, const u32 mask80, const u32 bits14, const u32 bits15, u64 val)
{
__global const cs_t *cs = &root_css_buf[pw_r_len];

@ -9,6 +9,7 @@
#include "inc_types.cl"
DECLSPEC void generate_pw (u32 *pw_buf, __global const cs_t *root_css_buf, __global const cs_t *markov_css_buf, const u32 pw_l_len, const u32 pw_r_len, const u32 mask80, const u32 bits14, const u32 bits15, u64 val);
DECLSPEC void generate_pw (u32 *pw_buf, __global const cs_t *root_css_buf, __global const cs_t *markov_css_buf, const u32 pw_l_len, const u32 pw_r_len, const u32 mask80, const u32 bits14, const u32 bits15, u64 val)
{
__global const cs_t *cs = &root_css_buf[pw_r_len];

Loading…
Cancel
Save