2016-02-16 15:42:08 +00:00
|
|
|
/**
|
2016-09-11 20:20:15 +00:00
|
|
|
* Author......: See docs/credits.txt
|
2016-02-16 15:42:08 +00:00
|
|
|
* License.....: MIT
|
|
|
|
*/
|
2016-01-17 21:17:50 +00:00
|
|
|
|
2019-03-23 21:15:38 +00:00
|
|
|
#include "inc_vendor.h"
|
|
|
|
#include "inc_types.h"
|
2019-04-26 11:59:43 +00:00
|
|
|
#include "inc_platform.h"
|
2019-03-23 21:15:38 +00:00
|
|
|
#include "inc_common.h"
|
|
|
|
#include "inc_simd.h"
|
2016-01-23 14:32:31 +00:00
|
|
|
|
|
|
|
// attack-mode 0
|
|
|
|
|
2019-05-11 07:32:16 +00:00
|
|
|
DECLSPEC u32x ix_create_bft (CONSTANT_AS const bf_t *arr, const u32 il_pos)
|
2016-01-23 14:32:31 +00:00
|
|
|
{
|
|
|
|
#if VECT_SIZE == 1
|
2019-05-11 07:32:16 +00:00
|
|
|
const u32x ix = make_u32x (arr[il_pos + 0].i);
|
2016-01-23 14:32:31 +00:00
|
|
|
#elif VECT_SIZE == 2
|
2019-05-11 07:32:16 +00:00
|
|
|
const u32x ix = make_u32x (arr[il_pos + 0].i, arr[il_pos + 1].i);
|
2016-01-23 14:32:31 +00:00
|
|
|
#elif VECT_SIZE == 4
|
2019-05-11 07:32:16 +00:00
|
|
|
const u32x ix = make_u32x (arr[il_pos + 0].i, arr[il_pos + 1].i, arr[il_pos + 2].i, arr[il_pos + 3].i);
|
2016-01-23 14:32:31 +00:00
|
|
|
#elif VECT_SIZE == 8
|
2019-05-11 07:32:16 +00:00
|
|
|
const u32x ix = make_u32x (arr[il_pos + 0].i, arr[il_pos + 1].i, arr[il_pos + 2].i, arr[il_pos + 3].i, arr[il_pos + 4].i, arr[il_pos + 5].i, arr[il_pos + 6].i, arr[il_pos + 7].i);
|
2016-02-16 15:42:08 +00:00
|
|
|
#elif VECT_SIZE == 16
|
2019-05-11 07:32:16 +00:00
|
|
|
const u32x ix = make_u32x (arr[il_pos + 0].i, arr[il_pos + 1].i, arr[il_pos + 2].i, arr[il_pos + 3].i, arr[il_pos + 4].i, arr[il_pos + 5].i, arr[il_pos + 6].i, arr[il_pos + 7].i, arr[il_pos + 8].i, arr[il_pos + 9].i, arr[il_pos + 10].i, arr[il_pos + 11].i, arr[il_pos + 12].i, arr[il_pos + 13].i, arr[il_pos + 14].i, arr[il_pos + 15].i);
|
2016-01-23 14:32:31 +00:00
|
|
|
#endif
|
|
|
|
|
2016-02-20 15:13:06 +00:00
|
|
|
return ix;
|
|
|
|
}
|
|
|
|
|
|
|
|
// attack-mode 1
|
|
|
|
|
2019-05-11 07:32:16 +00:00
|
|
|
DECLSPEC u32x pwlenx_create_combt (GLOBAL_AS const pw_t *arr, const u32 il_pos)
|
2016-02-20 15:13:06 +00:00
|
|
|
{
|
|
|
|
#if VECT_SIZE == 1
|
2019-05-11 07:32:16 +00:00
|
|
|
const u32x pw_lenx = make_u32x (arr[il_pos + 0].pw_len);
|
2016-02-20 15:13:06 +00:00
|
|
|
#elif VECT_SIZE == 2
|
2019-05-11 07:32:16 +00:00
|
|
|
const u32x pw_lenx = make_u32x (arr[il_pos + 0].pw_len, arr[il_pos + 1].pw_len);
|
2016-02-20 15:13:06 +00:00
|
|
|
#elif VECT_SIZE == 4
|
2019-05-11 07:32:16 +00:00
|
|
|
const u32x pw_lenx = make_u32x (arr[il_pos + 0].pw_len, arr[il_pos + 1].pw_len, arr[il_pos + 2].pw_len, arr[il_pos + 3].pw_len);
|
2016-02-20 15:13:06 +00:00
|
|
|
#elif VECT_SIZE == 8
|
2019-05-11 07:32:16 +00:00
|
|
|
const u32x pw_lenx = make_u32x (arr[il_pos + 0].pw_len, arr[il_pos + 1].pw_len, arr[il_pos + 2].pw_len, arr[il_pos + 3].pw_len, arr[il_pos + 4].pw_len, arr[il_pos + 5].pw_len, arr[il_pos + 6].pw_len, arr[il_pos + 7].pw_len);
|
2016-02-20 15:13:06 +00:00
|
|
|
#elif VECT_SIZE == 16
|
2019-05-11 07:32:16 +00:00
|
|
|
const u32x pw_lenx = make_u32x (arr[il_pos + 0].pw_len, arr[il_pos + 1].pw_len, arr[il_pos + 2].pw_len, arr[il_pos + 3].pw_len, arr[il_pos + 4].pw_len, arr[il_pos + 5].pw_len, arr[il_pos + 6].pw_len, arr[il_pos + 7].pw_len, arr[il_pos + 8].pw_len, arr[il_pos + 9].pw_len, arr[il_pos + 10].pw_len, arr[il_pos + 11].pw_len, arr[il_pos + 12].pw_len, arr[il_pos + 13].pw_len, arr[il_pos + 14].pw_len, arr[il_pos + 15].pw_len);
|
2016-02-20 15:13:06 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
return pw_lenx;
|
|
|
|
}
|
|
|
|
|
2019-05-11 07:32:16 +00:00
|
|
|
DECLSPEC u32x ix_create_combt (GLOBAL_AS const pw_t *arr, const u32 il_pos, const int idx)
|
2016-02-20 15:13:06 +00:00
|
|
|
{
|
|
|
|
#if VECT_SIZE == 1
|
2019-05-11 07:32:16 +00:00
|
|
|
const u32x ix = make_u32x (arr[il_pos + 0].i[idx]);
|
2016-02-20 15:13:06 +00:00
|
|
|
#elif VECT_SIZE == 2
|
2019-05-11 07:32:16 +00:00
|
|
|
const u32x ix = make_u32x (arr[il_pos + 0].i[idx], arr[il_pos + 1].i[idx]);
|
2016-02-20 15:13:06 +00:00
|
|
|
#elif VECT_SIZE == 4
|
2019-05-11 07:32:16 +00:00
|
|
|
const u32x ix = make_u32x (arr[il_pos + 0].i[idx], arr[il_pos + 1].i[idx], arr[il_pos + 2].i[idx], arr[il_pos + 3].i[idx]);
|
2016-02-20 15:13:06 +00:00
|
|
|
#elif VECT_SIZE == 8
|
2019-05-11 07:32:16 +00:00
|
|
|
const u32x ix = make_u32x (arr[il_pos + 0].i[idx], arr[il_pos + 1].i[idx], arr[il_pos + 2].i[idx], arr[il_pos + 3].i[idx], arr[il_pos + 4].i[idx], arr[il_pos + 5].i[idx], arr[il_pos + 6].i[idx], arr[il_pos + 7].i[idx]);
|
2016-02-20 15:13:06 +00:00
|
|
|
#elif VECT_SIZE == 16
|
2019-05-11 07:32:16 +00:00
|
|
|
const u32x ix = make_u32x (arr[il_pos + 0].i[idx], arr[il_pos + 1].i[idx], arr[il_pos + 2].i[idx], arr[il_pos + 3].i[idx], arr[il_pos + 4].i[idx], arr[il_pos + 5].i[idx], arr[il_pos + 6].i[idx], arr[il_pos + 7].i[idx], arr[il_pos + 8].i[idx], arr[il_pos + 9].i[idx], arr[il_pos + 10].i[idx], arr[il_pos + 11].i[idx], arr[il_pos + 12].i[idx], arr[il_pos + 13].i[idx], arr[il_pos + 14].i[idx], arr[il_pos + 15].i[idx]);
|
2016-02-20 15:13:06 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
return ix;
|
2016-01-23 14:32:31 +00:00
|
|
|
}
|