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-03-22 21:27:58 +00:00
|
|
|
DECLSPEC u32x ix_create_bft (GLOBAL_AS const bf_t *bfs_buf, const u32 il_pos)
|
2016-01-23 14:32:31 +00:00
|
|
|
{
|
|
|
|
#if VECT_SIZE == 1
|
2019-05-08 13:21:22 +00:00
|
|
|
const u32x ix = make_u32x (bfs_buf[il_pos + 0].i);
|
2016-01-23 14:32:31 +00:00
|
|
|
#elif VECT_SIZE == 2
|
2019-05-08 13:21:22 +00:00
|
|
|
const u32x ix = make_u32x (bfs_buf[il_pos + 0].i, bfs_buf[il_pos + 1].i);
|
2016-01-23 14:32:31 +00:00
|
|
|
#elif VECT_SIZE == 4
|
2019-05-08 13:21:22 +00:00
|
|
|
const u32x ix = make_u32x (bfs_buf[il_pos + 0].i, bfs_buf[il_pos + 1].i, bfs_buf[il_pos + 2].i, bfs_buf[il_pos + 3].i);
|
2016-01-23 14:32:31 +00:00
|
|
|
#elif VECT_SIZE == 8
|
2019-05-08 13:21:22 +00:00
|
|
|
const u32x ix = make_u32x (bfs_buf[il_pos + 0].i, bfs_buf[il_pos + 1].i, bfs_buf[il_pos + 2].i, bfs_buf[il_pos + 3].i, bfs_buf[il_pos + 4].i, bfs_buf[il_pos + 5].i, bfs_buf[il_pos + 6].i, bfs_buf[il_pos + 7].i);
|
2016-02-16 15:42:08 +00:00
|
|
|
#elif VECT_SIZE == 16
|
2019-05-08 13:21:22 +00:00
|
|
|
const u32x ix = make_u32x (bfs_buf[il_pos + 0].i, bfs_buf[il_pos + 1].i, bfs_buf[il_pos + 2].i, bfs_buf[il_pos + 3].i, bfs_buf[il_pos + 4].i, bfs_buf[il_pos + 5].i, bfs_buf[il_pos + 6].i, bfs_buf[il_pos + 7].i, bfs_buf[il_pos + 8].i, bfs_buf[il_pos + 9].i, bfs_buf[il_pos + 10].i, bfs_buf[il_pos + 11].i, bfs_buf[il_pos + 12].i, bfs_buf[il_pos + 13].i, bfs_buf[il_pos + 14].i, bfs_buf[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-03-22 21:27:58 +00:00
|
|
|
DECLSPEC u32x pwlenx_create_combt (GLOBAL_AS const pw_t *combs_buf, const u32 il_pos)
|
2016-02-20 15:13:06 +00:00
|
|
|
{
|
|
|
|
#if VECT_SIZE == 1
|
2019-05-08 13:21:22 +00:00
|
|
|
const u32x pw_lenx = make_u32x (combs_buf[il_pos + 0].pw_len);
|
2016-02-20 15:13:06 +00:00
|
|
|
#elif VECT_SIZE == 2
|
2019-05-08 13:21:22 +00:00
|
|
|
const u32x pw_lenx = make_u32x (combs_buf[il_pos + 0].pw_len, combs_buf[il_pos + 1].pw_len);
|
2016-02-20 15:13:06 +00:00
|
|
|
#elif VECT_SIZE == 4
|
2019-05-08 13:21:22 +00:00
|
|
|
const u32x pw_lenx = make_u32x (combs_buf[il_pos + 0].pw_len, combs_buf[il_pos + 1].pw_len, combs_buf[il_pos + 2].pw_len, combs_buf[il_pos + 3].pw_len);
|
2016-02-20 15:13:06 +00:00
|
|
|
#elif VECT_SIZE == 8
|
2019-05-08 13:21:22 +00:00
|
|
|
const u32x pw_lenx = make_u32x (combs_buf[il_pos + 0].pw_len, combs_buf[il_pos + 1].pw_len, combs_buf[il_pos + 2].pw_len, combs_buf[il_pos + 3].pw_len, combs_buf[il_pos + 4].pw_len, combs_buf[il_pos + 5].pw_len, combs_buf[il_pos + 6].pw_len, combs_buf[il_pos + 7].pw_len);
|
2016-02-20 15:13:06 +00:00
|
|
|
#elif VECT_SIZE == 16
|
2019-05-08 13:21:22 +00:00
|
|
|
const u32x pw_lenx = make_u32x (combs_buf[il_pos + 0].pw_len, combs_buf[il_pos + 1].pw_len, combs_buf[il_pos + 2].pw_len, combs_buf[il_pos + 3].pw_len, combs_buf[il_pos + 4].pw_len, combs_buf[il_pos + 5].pw_len, combs_buf[il_pos + 6].pw_len, combs_buf[il_pos + 7].pw_len, combs_buf[il_pos + 8].pw_len, combs_buf[il_pos + 9].pw_len, combs_buf[il_pos + 10].pw_len, combs_buf[il_pos + 11].pw_len, combs_buf[il_pos + 12].pw_len, combs_buf[il_pos + 13].pw_len, combs_buf[il_pos + 14].pw_len, combs_buf[il_pos + 15].pw_len);
|
2016-02-20 15:13:06 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
return pw_lenx;
|
|
|
|
}
|
|
|
|
|
2019-03-22 21:27:58 +00:00
|
|
|
DECLSPEC u32x ix_create_combt (GLOBAL_AS const pw_t *combs_buf, const u32 il_pos, const int idx)
|
2016-02-20 15:13:06 +00:00
|
|
|
{
|
|
|
|
#if VECT_SIZE == 1
|
2019-05-08 13:21:22 +00:00
|
|
|
const u32x ix = make_u32x (combs_buf[il_pos + 0].i[idx]);
|
2016-02-20 15:13:06 +00:00
|
|
|
#elif VECT_SIZE == 2
|
2019-05-08 13:21:22 +00:00
|
|
|
const u32x ix = make_u32x (combs_buf[il_pos + 0].i[idx], combs_buf[il_pos + 1].i[idx]);
|
2016-02-20 15:13:06 +00:00
|
|
|
#elif VECT_SIZE == 4
|
2019-05-08 13:21:22 +00:00
|
|
|
const u32x ix = make_u32x (combs_buf[il_pos + 0].i[idx], combs_buf[il_pos + 1].i[idx], combs_buf[il_pos + 2].i[idx], combs_buf[il_pos + 3].i[idx]);
|
2016-02-20 15:13:06 +00:00
|
|
|
#elif VECT_SIZE == 8
|
2019-05-08 13:21:22 +00:00
|
|
|
const u32x ix = make_u32x (combs_buf[il_pos + 0].i[idx], combs_buf[il_pos + 1].i[idx], combs_buf[il_pos + 2].i[idx], combs_buf[il_pos + 3].i[idx], combs_buf[il_pos + 4].i[idx], combs_buf[il_pos + 5].i[idx], combs_buf[il_pos + 6].i[idx], combs_buf[il_pos + 7].i[idx]);
|
2016-02-20 15:13:06 +00:00
|
|
|
#elif VECT_SIZE == 16
|
2019-05-08 13:21:22 +00:00
|
|
|
const u32x ix = make_u32x (combs_buf[il_pos + 0].i[idx], combs_buf[il_pos + 1].i[idx], combs_buf[il_pos + 2].i[idx], combs_buf[il_pos + 3].i[idx], combs_buf[il_pos + 4].i[idx], combs_buf[il_pos + 5].i[idx], combs_buf[il_pos + 6].i[idx], combs_buf[il_pos + 7].i[idx], combs_buf[il_pos + 8].i[idx], combs_buf[il_pos + 9].i[idx], combs_buf[il_pos + 10].i[idx], combs_buf[il_pos + 11].i[idx], combs_buf[il_pos + 12].i[idx], combs_buf[il_pos + 13].i[idx], combs_buf[il_pos + 14].i[idx], combs_buf[il_pos + 15].i[idx]);
|
2016-02-20 15:13:06 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
return ix;
|
2016-01-23 14:32:31 +00:00
|
|
|
}
|