From 66d94b06e46fb70d7e813a3c71cd7f41b24fa2c5 Mon Sep 17 00:00:00 2001 From: jsteube Date: Mon, 25 Mar 2019 12:24:04 +0100 Subject: [PATCH] Get rid of src/rp_kernel_on_cpu.c and src/rp_kernel_on_cpu_optimized.c and use OpenCL emulated kernel version --- OpenCL/amp_a0.cl | 2 +- OpenCL/amp_a1.cl | 2 +- OpenCL/amp_a3.cl | 2 +- OpenCL/inc_cipher_aes.h | 20 +- OpenCL/inc_cipher_camellia.h | 2 +- OpenCL/inc_cipher_des.h | 4 +- OpenCL/inc_cipher_kuznyechik.h | 4 +- OpenCL/inc_cipher_twofish.cl | 38 +- OpenCL/inc_cipher_twofish.h | 4 +- OpenCL/inc_common.cl | 6 +- OpenCL/inc_common.h | 70 +- OpenCL/inc_hash_md4.cl | 16 +- OpenCL/inc_hash_md4.h | 16 +- OpenCL/inc_hash_md5.cl | 16 +- OpenCL/inc_hash_md5.h | 16 +- OpenCL/inc_hash_ripemd160.cl | 16 +- OpenCL/inc_hash_ripemd160.h | 16 +- OpenCL/inc_hash_sha1.cl | 20 +- OpenCL/inc_hash_sha1.h | 20 +- OpenCL/inc_hash_sha224.cl | 16 +- OpenCL/inc_hash_sha224.h | 18 +- OpenCL/inc_hash_sha256.cl | 16 +- OpenCL/inc_hash_sha256.h | 18 +- OpenCL/inc_hash_sha384.cl | 16 +- OpenCL/inc_hash_sha384.h | 18 +- OpenCL/inc_hash_sha512.cl | 16 +- OpenCL/inc_hash_sha512.h | 18 +- OpenCL/inc_hash_streebog256.cl | 4 +- OpenCL/inc_hash_streebog256.h | 8 +- OpenCL/inc_hash_streebog512.cl | 4 +- OpenCL/inc_hash_streebog512.h | 8 +- OpenCL/inc_hash_whirlpool.cl | 16 +- OpenCL/inc_hash_whirlpool.h | 24 +- OpenCL/inc_rp.cl | 2 +- OpenCL/inc_rp.h | 2 +- OpenCL/inc_rp_optimized.cl | 182 +- OpenCL/inc_rp_optimized.h | 28 +- OpenCL/inc_truecrypt_crc32.h | 2 +- OpenCL/inc_vendor.h | 2 + OpenCL/m00000_a0-optimized.cl | 4 +- OpenCL/m00010_a0-optimized.cl | 4 +- OpenCL/m00020_a0-optimized.cl | 4 +- OpenCL/m00030_a0-optimized.cl | 4 +- OpenCL/m00040_a0-optimized.cl | 4 +- OpenCL/m00050_a0-optimized.cl | 4 +- OpenCL/m00060_a0-optimized.cl | 4 +- OpenCL/m00100_a0-optimized.cl | 4 +- OpenCL/m00110_a0-optimized.cl | 4 +- OpenCL/m00120_a0-optimized.cl | 4 +- OpenCL/m00130_a0-optimized.cl | 4 +- OpenCL/m00140_a0-optimized.cl | 4 +- OpenCL/m00150_a0-optimized.cl | 4 +- OpenCL/m00160_a0-optimized.cl | 4 +- OpenCL/m00200_a0-optimized.cl | 4 +- OpenCL/m00300_a0-optimized.cl | 4 +- OpenCL/m00900_a0-optimized.cl | 4 +- OpenCL/m01000_a0-optimized.cl | 4 +- OpenCL/m01100_a0-optimized.cl | 4 +- OpenCL/m01300_a0-optimized.cl | 4 +- OpenCL/m01400_a0-optimized.cl | 4 +- OpenCL/m01410_a0-optimized.cl | 4 +- OpenCL/m01420_a0-optimized.cl | 4 +- OpenCL/m01430_a0-optimized.cl | 4 +- OpenCL/m01440_a0-optimized.cl | 4 +- OpenCL/m01450_a0-optimized.cl | 4 +- OpenCL/m01460_a0-optimized.cl | 4 +- OpenCL/m01500_a0-pure.cl | 4 +- OpenCL/m01500_a1-pure.cl | 4 +- OpenCL/m01500_a3-pure.cl | 2 +- OpenCL/m01700_a0-optimized.cl | 4 +- OpenCL/m01710_a0-optimized.cl | 4 +- OpenCL/m01720_a0-optimized.cl | 4 +- OpenCL/m01730_a0-optimized.cl | 4 +- OpenCL/m01740_a0-optimized.cl | 4 +- OpenCL/m01750_a0-optimized.cl | 4 +- OpenCL/m01760_a0-optimized.cl | 4 +- OpenCL/m02400_a0-optimized.cl | 4 +- OpenCL/m02410_a0-optimized.cl | 4 +- OpenCL/m02610_a0-optimized.cl | 4 +- OpenCL/m02710_a0-optimized.cl | 4 +- OpenCL/m02810_a0-optimized.cl | 4 +- OpenCL/m03000_a0-pure.cl | 4 +- OpenCL/m03000_a1-pure.cl | 4 +- OpenCL/m03000_a3-pure.cl | 2 +- OpenCL/m03100_a0-optimized.cl | 4 +- OpenCL/m03200-pure.cl | 8 +- OpenCL/m03710_a0-optimized.cl | 4 +- OpenCL/m03800_a0-optimized.cl | 4 +- OpenCL/m03910_a0-optimized.cl | 4 +- OpenCL/m04010_a0-optimized.cl | 4 +- OpenCL/m04110_a0-optimized.cl | 4 +- OpenCL/m04310_a0-optimized.cl | 4 +- OpenCL/m04400_a0-optimized.cl | 4 +- OpenCL/m04500_a0-optimized.cl | 4 +- OpenCL/m04520_a0-optimized.cl | 4 +- OpenCL/m04700_a0-optimized.cl | 4 +- OpenCL/m04800_a0-optimized.cl | 4 +- OpenCL/m04900_a0-optimized.cl | 4 +- OpenCL/m05100_a0-optimized.cl | 4 +- OpenCL/m05300_a0-optimized.cl | 4 +- OpenCL/m05400_a0-optimized.cl | 4 +- OpenCL/m05500_a0-optimized.cl | 8 +- OpenCL/m05500_a0-pure.cl | 4 +- OpenCL/m05500_a1-optimized.cl | 4 +- OpenCL/m05500_a1-pure.cl | 4 +- OpenCL/m05500_a3-optimized.cl | 4 +- OpenCL/m05500_a3-pure.cl | 4 +- OpenCL/m05600_a0-optimized.cl | 4 +- OpenCL/m05800-optimized.cl | 4 +- OpenCL/m05800-pure.cl | 4 +- OpenCL/m06000_a0-optimized.cl | 4 +- OpenCL/m06100_a0-optimized.cl | 4 +- OpenCL/m06900_a0-optimized.cl | 6 +- OpenCL/m06900_a1-optimized.cl | 2 +- OpenCL/m06900_a3-optimized.cl | 2 +- OpenCL/m07000_a0-optimized.cl | 4 +- OpenCL/m07300_a0-optimized.cl | 4 +- OpenCL/m07500_a0-optimized.cl | 4 +- OpenCL/m07700_a0-optimized.cl | 8 +- OpenCL/m07700_a1-optimized.cl | 4 +- OpenCL/m07700_a3-optimized.cl | 4 +- OpenCL/m07701_a0-optimized.cl | 8 +- OpenCL/m07701_a1-optimized.cl | 4 +- OpenCL/m07701_a3-optimized.cl | 4 +- OpenCL/m07800_a0-optimized.cl | 8 +- OpenCL/m07800_a1-optimized.cl | 4 +- OpenCL/m07800_a3-optimized.cl | 4 +- OpenCL/m07801_a0-optimized.cl | 8 +- OpenCL/m07801_a1-optimized.cl | 4 +- OpenCL/m07801_a3-optimized.cl | 4 +- OpenCL/m08000_a0-optimized.cl | 4 +- OpenCL/m08100_a0-optimized.cl | 4 +- OpenCL/m08300_a0-optimized.cl | 4 +- OpenCL/m08400_a0-optimized.cl | 4 +- OpenCL/m08500_a0-pure.cl | 6 +- OpenCL/m08500_a1-pure.cl | 6 +- OpenCL/m08500_a3-pure.cl | 6 +- OpenCL/m08600_a0-pure.cl | 2 +- OpenCL/m08600_a1-pure.cl | 2 +- OpenCL/m08600_a3-pure.cl | 2 +- OpenCL/m08700_a0-optimized.cl | 6 +- OpenCL/m08700_a1-optimized.cl | 2 +- OpenCL/m08700_a3-optimized.cl | 2 +- OpenCL/m08900-pure.cl | 12 +- OpenCL/m09000-pure.cl | 10 +- OpenCL/m09100-pure.cl | 14 +- OpenCL/m09700_a0-optimized.cl | 4 +- OpenCL/m09710_a0-optimized.cl | 4 +- OpenCL/m09720_a0-optimized.cl | 4 +- OpenCL/m09800_a0-optimized.cl | 4 +- OpenCL/m09810_a0-optimized.cl | 4 +- OpenCL/m09820_a0-optimized.cl | 4 +- OpenCL/m09900_a0-optimized.cl | 4 +- OpenCL/m10100_a0-optimized.cl | 4 +- OpenCL/m10400_a0-optimized.cl | 8 +- OpenCL/m10400_a1-optimized.cl | 4 +- OpenCL/m10400_a3-optimized.cl | 4 +- OpenCL/m10410_a0-optimized.cl | 8 +- OpenCL/m10410_a1-optimized.cl | 4 +- OpenCL/m10410_a3-optimized.cl | 4 +- OpenCL/m10420_a0-optimized.cl | 6 +- OpenCL/m10420_a1-optimized.cl | 2 +- OpenCL/m10420_a3-optimized.cl | 2 +- OpenCL/m10500-pure.cl | 2 +- OpenCL/m10800_a0-optimized.cl | 4 +- OpenCL/m11000_a0-optimized.cl | 4 +- OpenCL/m11100_a0-optimized.cl | 4 +- OpenCL/m11200_a0-optimized.cl | 4 +- OpenCL/m11500_a0-optimized.cl | 6 +- OpenCL/m11500_a1-optimized.cl | 2 +- OpenCL/m11500_a3-optimized.cl | 2 +- OpenCL/m11700_a0-optimized.cl | 4 +- OpenCL/m11800_a0-optimized.cl | 4 +- OpenCL/m12400-pure.cl | 4 +- OpenCL/m12600_a0-optimized.cl | 4 +- OpenCL/m13100_a0-optimized.cl | 6 +- OpenCL/m13100_a0-pure.cl | 2 +- OpenCL/m13100_a1-optimized.cl | 2 +- OpenCL/m13100_a1-pure.cl | 2 +- OpenCL/m13100_a3-optimized.cl | 2 +- OpenCL/m13100_a3-pure.cl | 2 +- OpenCL/m13300_a0-optimized.cl | 4 +- OpenCL/m13500_a0-optimized.cl | 4 +- OpenCL/m13800_a0-optimized.cl | 4 +- OpenCL/m13900_a0-optimized.cl | 4 +- OpenCL/m14000_a0-pure.cl | 8 +- OpenCL/m14000_a1-pure.cl | 4 +- OpenCL/m14000_a3-pure.cl | 2 +- OpenCL/m14100_a0-pure.cl | 8 +- OpenCL/m14100_a1-pure.cl | 4 +- OpenCL/m14100_a3-pure.cl | 4 +- OpenCL/m14400_a0-optimized.cl | 4 +- OpenCL/m14900_a0-optimized.cl | 6 +- OpenCL/m14900_a1-optimized.cl | 2 +- OpenCL/m14900_a3-optimized.cl | 2 +- OpenCL/m15000_a0-optimized.cl | 4 +- OpenCL/m15500_a0-optimized.cl | 4 +- OpenCL/m15600-pure.cl | 2 +- OpenCL/m15700-pure.cl | 14 +- OpenCL/m16000_a0-pure.cl | 6 +- OpenCL/m16000_a1-pure.cl | 6 +- OpenCL/m16000_a3-pure.cl | 6 +- OpenCL/m16100_a0-optimized.cl | 4 +- OpenCL/m16300-pure.cl | 2 +- OpenCL/m16400_a0-optimized.cl | 4 +- OpenCL/m16400_a1-pure.cl | 2 +- OpenCL/m16600_a0-optimized.cl | 4 +- OpenCL/m17300_a0-optimized.cl | 6 +- OpenCL/m17300_a1-optimized.cl | 2 +- OpenCL/m17300_a3-optimized.cl | 2 +- OpenCL/m17400_a0-optimized.cl | 6 +- OpenCL/m17400_a1-optimized.cl | 2 +- OpenCL/m17400_a3-optimized.cl | 2 +- OpenCL/m17500_a0-optimized.cl | 6 +- OpenCL/m17500_a1-optimized.cl | 2 +- OpenCL/m17500_a3-optimized.cl | 2 +- OpenCL/m17600_a0-optimized.cl | 6 +- OpenCL/m17600_a1-optimized.cl | 2 +- OpenCL/m17600_a3-optimized.cl | 2 +- OpenCL/m17700_a0-optimized.cl | 6 +- OpenCL/m17700_a1-optimized.cl | 2 +- OpenCL/m17700_a3-optimized.cl | 2 +- OpenCL/m17800_a0-optimized.cl | 6 +- OpenCL/m17800_a1-optimized.cl | 2 +- OpenCL/m17800_a3-optimized.cl | 2 +- OpenCL/m17900_a0-optimized.cl | 6 +- OpenCL/m17900_a1-optimized.cl | 2 +- OpenCL/m17900_a3-optimized.cl | 2 +- OpenCL/m18000_a0-optimized.cl | 6 +- OpenCL/m18000_a1-optimized.cl | 2 +- OpenCL/m18000_a3-optimized.cl | 2 +- OpenCL/m18200_a0-optimized.cl | 6 +- OpenCL/m18200_a0-pure.cl | 2 +- OpenCL/m18200_a1-optimized.cl | 2 +- OpenCL/m18200_a1-pure.cl | 2 +- OpenCL/m18200_a3-optimized.cl | 2 +- OpenCL/m18200_a3-pure.cl | 2 +- OpenCL/m18600-pure.cl | 10 +- OpenCL/m18700_a0-optimized.cl | 4 +- OpenCL/m18700_a1-optimized.cl | 2 +- OpenCL/m18700_a1-pure.cl | 2 +- OpenCL/m19200-pure.cl | 2 +- OpenCL/markov_be.cl | 6 +- OpenCL/markov_le.cl | 6 +- include/cpu_md4.h | 13 - include/emu_general.h | 49 + include/emu_inc_hash_md4.h | 22 + include/emu_inc_rp.h | 24 + include/emu_inc_rp_optimized.h | 24 + include/emu_m02501_pure.h | 45 + include/rp_kernel_on_cpu.h | 11 - include/rp_kernel_on_cpu_optimized.h | 13 - src/Makefile | 17 +- src/cpu_md4.c | 120 -- src/emu_general.c | 31 + src/emu_inc_cipher_aes.c | 21 + src/emu_inc_cipher_camellia.c | 21 + src/emu_inc_cipher_des.c | 21 + src/emu_inc_cipher_kuznyechik.c | 21 + src/emu_inc_cipher_serpent.c | 21 + src/emu_inc_cipher_twofish.c | 21 + src/emu_inc_common.c | 22 + src/emu_inc_hash_md4.c | 21 + src/emu_inc_hash_md5.c | 21 + src/emu_inc_hash_ripemd160.c | 21 + src/emu_inc_hash_sha1.c | 21 + src/emu_inc_hash_sha224.c | 21 + src/emu_inc_hash_sha256.c | 21 + src/emu_inc_hash_sha384.c | 21 + src/emu_inc_hash_sha512.c | 21 + src/emu_inc_hash_streebog256.c | 21 + src/emu_inc_hash_streebog512.c | 21 + src/emu_inc_hash_whirlpool.c | 21 + src/emu_inc_rp.c | 21 + src/emu_inc_rp_optimized.c | 21 + src/emu_inc_scalar.c | 21 + src/emu_inc_simd.c | 21 + src/emu_inc_truecrypt_crc32.c | 21 + src/emu_inc_truecrypt_keyfile.c | 21 + src/emu_inc_truecrypt_xts.c | 21 + src/emu_m02501_pure.c | 21 + src/modules/module_99999.c | 25 +- src/outfile.c | 4 +- src/rp_kernel_on_cpu.c | 774 -------- src/rp_kernel_on_cpu_optimized.c | 2558 -------------------------- src/slow_candidates.c | 4 +- src/stdout.c | 4 +- 287 files changed, 1551 insertions(+), 4290 deletions(-) delete mode 100644 include/cpu_md4.h create mode 100644 include/emu_general.h create mode 100644 include/emu_inc_hash_md4.h create mode 100644 include/emu_inc_rp.h create mode 100644 include/emu_inc_rp_optimized.h create mode 100644 include/emu_m02501_pure.h delete mode 100644 include/rp_kernel_on_cpu.h delete mode 100644 include/rp_kernel_on_cpu_optimized.h delete mode 100644 src/cpu_md4.c create mode 100644 src/emu_general.c create mode 100644 src/emu_inc_cipher_aes.c create mode 100644 src/emu_inc_cipher_camellia.c create mode 100644 src/emu_inc_cipher_des.c create mode 100644 src/emu_inc_cipher_kuznyechik.c create mode 100644 src/emu_inc_cipher_serpent.c create mode 100644 src/emu_inc_cipher_twofish.c create mode 100644 src/emu_inc_common.c create mode 100644 src/emu_inc_hash_md4.c create mode 100644 src/emu_inc_hash_md5.c create mode 100644 src/emu_inc_hash_ripemd160.c create mode 100644 src/emu_inc_hash_sha1.c create mode 100644 src/emu_inc_hash_sha224.c create mode 100644 src/emu_inc_hash_sha256.c create mode 100644 src/emu_inc_hash_sha384.c create mode 100644 src/emu_inc_hash_sha512.c create mode 100644 src/emu_inc_hash_streebog256.c create mode 100644 src/emu_inc_hash_streebog512.c create mode 100644 src/emu_inc_hash_whirlpool.c create mode 100644 src/emu_inc_rp.c create mode 100644 src/emu_inc_rp_optimized.c create mode 100644 src/emu_inc_scalar.c create mode 100644 src/emu_inc_simd.c create mode 100644 src/emu_inc_truecrypt_crc32.c create mode 100644 src/emu_inc_truecrypt_keyfile.c create mode 100644 src/emu_inc_truecrypt_xts.c create mode 100644 src/emu_m02501_pure.c delete mode 100644 src/rp_kernel_on_cpu.c delete mode 100644 src/rp_kernel_on_cpu_optimized.c diff --git a/OpenCL/amp_a0.cl b/OpenCL/amp_a0.cl index d82f39002..58374dac3 100644 --- a/OpenCL/amp_a0.cl +++ b/OpenCL/amp_a0.cl @@ -11,7 +11,7 @@ #include "inc_rp.cl" #endif -KERNEL_FQ void amp (GLOBAL_AS pw_t * restrict pws, GLOBAL_AS pw_t * restrict pws_amp, CONSTANT_AS const kernel_rule_t * restrict rules_buf, GLOBAL_AS const pw_t * restrict combs_buf, GLOBAL_AS const bf_t * restrict bfs_buf, const u32 combs_mode, const u64 gid_max) +KERNEL_FQ void amp (GLOBAL_AS pw_t *pws, GLOBAL_AS pw_t *pws_amp, CONSTANT_AS kernel_rule_t *rules_buf, GLOBAL_AS const pw_t *combs_buf, GLOBAL_AS const bf_t *bfs_buf, const u32 combs_mode, const u64 gid_max) { const u64 gid = get_global_id (0); diff --git a/OpenCL/amp_a1.cl b/OpenCL/amp_a1.cl index b34513a6c..5dda031bf 100644 --- a/OpenCL/amp_a1.cl +++ b/OpenCL/amp_a1.cl @@ -9,7 +9,7 @@ #include "inc_common.cl" #endif -KERNEL_FQ void amp (GLOBAL_AS pw_t * restrict pws, GLOBAL_AS pw_t * restrict pws_amp, GLOBAL_AS const kernel_rule_t * restrict rules_buf, GLOBAL_AS const pw_t * restrict combs_buf, GLOBAL_AS const bf_t * restrict bfs_buf, const u32 combs_mode, const u64 gid_max) +KERNEL_FQ void amp (GLOBAL_AS pw_t *pws, GLOBAL_AS pw_t *pws_amp, GLOBAL_AS const kernel_rule_t *rules_buf, GLOBAL_AS const pw_t *combs_buf, GLOBAL_AS const bf_t *bfs_buf, const u32 combs_mode, const u64 gid_max) { const u64 gid = get_global_id (0); diff --git a/OpenCL/amp_a3.cl b/OpenCL/amp_a3.cl index e24fe1dca..d7ce0ea77 100644 --- a/OpenCL/amp_a3.cl +++ b/OpenCL/amp_a3.cl @@ -8,7 +8,7 @@ #include "inc_types.h" #endif -KERNEL_FQ void amp (GLOBAL_AS pw_t * restrict pws, GLOBAL_AS pw_t * restrict pws_amp, GLOBAL_AS const kernel_rule_t * restrict rules_buf, GLOBAL_AS const pw_t * restrict combs_buf, CONSTANT_AS const bf_t * restrict bfs_buf, const u32 combs_mode, const u64 gid_max) +KERNEL_FQ void amp (GLOBAL_AS pw_t *pws, GLOBAL_AS pw_t *pws_amp, GLOBAL_AS const kernel_rule_t *rules_buf, GLOBAL_AS const pw_t *combs_buf, CONSTANT_AS bf_t *bfs_buf, const u32 combs_mode, const u64 gid_max) { const u64 gid = get_global_id (0); diff --git a/OpenCL/inc_cipher_aes.h b/OpenCL/inc_cipher_aes.h index 5d6e1121e..fda1d6518 100644 --- a/OpenCL/inc_cipher_aes.h +++ b/OpenCL/inc_cipher_aes.h @@ -6,7 +6,7 @@ #ifndef _INC_CIPHER_AES_H #define _INC_CIPHER_AES_H -CONSTANT_AS u32a te0[256] = +CONSTANT_AS CONSTSPEC u32a te0[256] = { 0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d, 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554, @@ -74,7 +74,7 @@ CONSTANT_AS u32a te0[256] = 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a, }; -CONSTANT_AS u32a te1[256] = +CONSTANT_AS CONSTSPEC u32a te1[256] = { 0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b, 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5, @@ -142,7 +142,7 @@ CONSTANT_AS u32a te1[256] = 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616, }; -CONSTANT_AS u32a te2[256] = +CONSTANT_AS CONSTSPEC u32a te2[256] = { 0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b, 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5, @@ -210,7 +210,7 @@ CONSTANT_AS u32a te2[256] = 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16, }; -CONSTANT_AS u32a te3[256] = +CONSTANT_AS CONSTSPEC u32a te3[256] = { 0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6, 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491, @@ -278,7 +278,7 @@ CONSTANT_AS u32a te3[256] = 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c, }; -CONSTANT_AS u32a te4[256] = +CONSTANT_AS CONSTSPEC u32a te4[256] = { 0x63636363, 0x7c7c7c7c, 0x77777777, 0x7b7b7b7b, 0xf2f2f2f2, 0x6b6b6b6b, 0x6f6f6f6f, 0xc5c5c5c5, @@ -346,7 +346,7 @@ CONSTANT_AS u32a te4[256] = 0xb0b0b0b0, 0x54545454, 0xbbbbbbbb, 0x16161616, }; -CONSTANT_AS u32a td0[256] = +CONSTANT_AS CONSTSPEC u32a td0[256] = { 0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96, 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393, @@ -414,7 +414,7 @@ CONSTANT_AS u32a td0[256] = 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742, }; -CONSTANT_AS u32a td1[256] = +CONSTANT_AS CONSTSPEC u32a td1[256] = { 0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e, 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303, @@ -482,7 +482,7 @@ CONSTANT_AS u32a td1[256] = 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857, }; -CONSTANT_AS u32a td2[256] = +CONSTANT_AS CONSTSPEC u32a td2[256] = { 0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27, 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3, @@ -550,7 +550,7 @@ CONSTANT_AS u32a td2[256] = 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8, }; -CONSTANT_AS u32a td3[256] = +CONSTANT_AS CONSTSPEC u32a td3[256] = { 0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a, 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b, @@ -618,7 +618,7 @@ CONSTANT_AS u32a td3[256] = 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0, }; -CONSTANT_AS u32a td4[256] = +CONSTANT_AS CONSTSPEC u32a td4[256] = { 0x52525252, 0x09090909, 0x6a6a6a6a, 0xd5d5d5d5, 0x30303030, 0x36363636, 0xa5a5a5a5, 0x38383838, diff --git a/OpenCL/inc_cipher_camellia.h b/OpenCL/inc_cipher_camellia.h index 7077dc24f..4ad12656b 100644 --- a/OpenCL/inc_cipher_camellia.h +++ b/OpenCL/inc_cipher_camellia.h @@ -6,7 +6,7 @@ #ifndef _INC_CIPHER_CAMELLIA_H #define _INC_CIPHER_CAMELLIA_H -CONSTANT_AS const u32a c_sbox[256] = +CONSTANT_AS CONSTSPEC u32a c_sbox[256] = { 0x70, 0x82, 0x2c, 0xec, 0xb3, 0x27, 0xc0, 0xe5, 0xe4, 0x85, 0x57, 0x35, 0xea, 0x0c, 0xae, 0x41, diff --git a/OpenCL/inc_cipher_des.h b/OpenCL/inc_cipher_des.h index b72c1b906..246d6fdc1 100644 --- a/OpenCL/inc_cipher_des.h +++ b/OpenCL/inc_cipher_des.h @@ -6,7 +6,7 @@ #ifndef _INC_CIPHER_DES_H #define _INC_CIPHER_DES_H -CONSTANT_AS u32a c_SPtrans[8][64] = +CONSTANT_AS CONSTSPEC u32a c_SPtrans[8][64] = { { /* nibble 0 */ @@ -162,7 +162,7 @@ CONSTANT_AS u32a c_SPtrans[8][64] = }, }; -CONSTANT_AS u32a c_skb[8][64] = +CONSTANT_AS CONSTSPEC u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/inc_cipher_kuznyechik.h b/OpenCL/inc_cipher_kuznyechik.h index 07c738c65..c1762ff76 100644 --- a/OpenCL/inc_cipher_kuznyechik.h +++ b/OpenCL/inc_cipher_kuznyechik.h @@ -6,7 +6,7 @@ #ifndef _INC_CIPHER_KUZNYECHIK_H #define _INC_CIPHER_KUZNYECHIK_H -CONSTANT_AS const u32a k_sbox[256] = +CONSTANT_AS CONSTSPEC u32a k_sbox[256] = { 0xfc, 0xee, 0xdd, 0x11, 0xcf, 0x6e, 0x31, 0x16, 0xfb, 0xc4, 0xfa, 0xda, 0x23, 0xc5, 0x04, 0x4d, @@ -42,7 +42,7 @@ CONSTANT_AS const u32a k_sbox[256] = 0xd1, 0x66, 0xaf, 0xc2, 0x39, 0x4b, 0x63, 0xb6 }; -CONSTANT_AS const u32a k_sbox_inv[256] = +CONSTANT_AS CONSTSPEC u32a k_sbox_inv[256] = { 0xa5, 0x2d, 0x32, 0x8f, 0x0e, 0x30, 0x38, 0xc0, 0x54, 0xe6, 0x9e, 0x39, 0x55, 0x7e, 0x52, 0x91, diff --git a/OpenCL/inc_cipher_twofish.cl b/OpenCL/inc_cipher_twofish.cl index 8de65d21f..55ac1716c 100644 --- a/OpenCL/inc_cipher_twofish.cl +++ b/OpenCL/inc_cipher_twofish.cl @@ -351,22 +351,22 @@ DECLSPEC void twofish256_decrypt (const u32 *sk, const u32 *lk, const u32 *in, u out[3] = data[1] ^ lk[3]; } -#define g1_fun128 -#define g0_fun128 -#define f_rnd128 -#define i_rnd128 -#define f_rnd256 -#define i_rnd256 - -#define q - -#define mds - -#define q20 -#define q21 -#define q22 -#define q23 -#define q40 -#define q41 -#define q42 -#define q43 +#undef g1_fun128 +#undef g0_fun128 +#undef f_rnd128 +#undef i_rnd128 +#undef f_rnd256 +#undef i_rnd256 + +#undef q + +#undef mds + +#undef q20 +#undef q21 +#undef q22 +#undef q23 +#undef q40 +#undef q41 +#undef q42 +#undef q43 diff --git a/OpenCL/inc_cipher_twofish.h b/OpenCL/inc_cipher_twofish.h index 5a61e3ddf..43cd9a687 100644 --- a/OpenCL/inc_cipher_twofish.h +++ b/OpenCL/inc_cipher_twofish.h @@ -6,7 +6,7 @@ #ifndef _INC_CIPHER_TWOFISH_H #define _INC_CIPHER_TWOFISH_H -CONSTANT_AS u32a q_tab[2][256] = +CONSTANT_AS CONSTSPEC u32a q_tab[2][256] = { { 0xA9, 0x67, 0xB3, 0xE8, 0x04, 0xFD, 0xA3, 0x76, 0x9A, 0x92, 0x80, 0x78, @@ -58,7 +58,7 @@ CONSTANT_AS u32a q_tab[2][256] = } }; -CONSTANT_AS u32a m_tab[4][256] = +CONSTANT_AS CONSTSPEC u32a m_tab[4][256] = { { 0xBCBC3275, 0xECEC21F3, 0x202043C6, 0xB3B3C9F4, 0xDADA03DB, 0x02028B7B, 0xE2E22BFB, 0x9E9EFAC8, 0xC9C9EC4A, 0xD4D409D3, 0x18186BE6, 0x1E1E9F6B, diff --git a/OpenCL/inc_common.cl b/OpenCL/inc_common.cl index 611ad576e..e25f26dc6 100644 --- a/OpenCL/inc_common.cl +++ b/OpenCL/inc_common.cl @@ -61681,7 +61681,7 @@ DECLSPEC void gpu_decompress_entry (GLOBAL_AS pw_idx_t *pws_idx, GLOBAL_AS u32 * pw->pw_len = len; } -KERNEL_FQ void gpu_decompress (GLOBAL_AS pw_idx_t * restrict pws_idx, GLOBAL_AS u32 * restrict pws_comp, GLOBAL_AS pw_t * restrict pws_buf, const u64 gid_max) +KERNEL_FQ void gpu_decompress (GLOBAL_AS pw_idx_t *pws_idx, GLOBAL_AS u32 *pws_comp, GLOBAL_AS pw_t *pws_buf, const u64 gid_max) { const u64 gid = get_global_id (0); @@ -61694,7 +61694,7 @@ KERNEL_FQ void gpu_decompress (GLOBAL_AS pw_idx_t * restrict pws_idx, GLOBAL_AS pws_buf[gid] = pw; } -KERNEL_FQ void gpu_memset (GLOBAL_AS uint4 * restrict buf, const u32 value, const u64 gid_max) +KERNEL_FQ void gpu_memset (GLOBAL_AS uint4 *buf, const u32 value, const u64 gid_max) { const u64 gid = get_global_id (0); @@ -61703,7 +61703,7 @@ KERNEL_FQ void gpu_memset (GLOBAL_AS uint4 * restrict buf, const u32 value, cons buf[gid] = (uint4) (value); } -KERNEL_FQ void gpu_atinit (GLOBAL_AS pw_t * restrict buf, const u64 gid_max) +KERNEL_FQ void gpu_atinit (GLOBAL_AS pw_t *buf, const u64 gid_max) { const u64 gid = get_global_id (0); diff --git a/OpenCL/inc_common.h b/OpenCL/inc_common.h index 353f10e56..ac9a271b6 100644 --- a/OpenCL/inc_common.h +++ b/OpenCL/inc_common.h @@ -26,31 +26,31 @@ * - P19: Type of the esalt_bufs structure with additional data, or void. */ -#define KERN_ATTR(p2,p4,p5,p6,p19) \ - GLOBAL_AS pw_t * restrict pws, \ - p2 const kernel_rule_t * restrict rules_buf, \ - GLOBAL_AS const pw_t * restrict combs_buf, \ - p4, \ - GLOBAL_AS p5 * restrict tmps, \ - GLOBAL_AS p6 * restrict hooks, \ - GLOBAL_AS const u32 * restrict bitmaps_buf_s1_a, \ - GLOBAL_AS const u32 * restrict bitmaps_buf_s1_b, \ - GLOBAL_AS const u32 * restrict bitmaps_buf_s1_c, \ - GLOBAL_AS const u32 * restrict bitmaps_buf_s1_d, \ - GLOBAL_AS const u32 * restrict bitmaps_buf_s2_a, \ - GLOBAL_AS const u32 * restrict bitmaps_buf_s2_b, \ - GLOBAL_AS const u32 * restrict bitmaps_buf_s2_c, \ - GLOBAL_AS const u32 * restrict bitmaps_buf_s2_d, \ - GLOBAL_AS plain_t * restrict plains_buf, \ - GLOBAL_AS const digest_t * restrict digests_buf, \ - GLOBAL_AS u32 * restrict hashes_shown, \ - GLOBAL_AS const salt_t * restrict salt_bufs, \ - GLOBAL_AS const p19 * restrict esalt_bufs, \ - GLOBAL_AS u32 * restrict d_return_buf, \ - GLOBAL_AS void * restrict d_extra0_buf, \ - GLOBAL_AS void * restrict d_extra1_buf, \ - GLOBAL_AS void * restrict d_extra2_buf, \ - GLOBAL_AS void * restrict d_extra3_buf, \ +#define KERN_ATTR(p2,p4,p5,p6,p19) \ + GLOBAL_AS pw_t *pws, \ + p2 const kernel_rule_t *rules_buf, \ + GLOBAL_AS const pw_t *combs_buf, \ + p4, \ + GLOBAL_AS p5 *tmps, \ + GLOBAL_AS p6 *hooks, \ + GLOBAL_AS const u32 *bitmaps_buf_s1_a, \ + GLOBAL_AS const u32 *bitmaps_buf_s1_b, \ + GLOBAL_AS const u32 *bitmaps_buf_s1_c, \ + GLOBAL_AS const u32 *bitmaps_buf_s1_d, \ + GLOBAL_AS const u32 *bitmaps_buf_s2_a, \ + GLOBAL_AS const u32 *bitmaps_buf_s2_b, \ + GLOBAL_AS const u32 *bitmaps_buf_s2_c, \ + GLOBAL_AS const u32 *bitmaps_buf_s2_d, \ + GLOBAL_AS plain_t *plains_buf, \ + GLOBAL_AS const digest_t *digests_buf, \ + GLOBAL_AS u32 *hashes_shown, \ + GLOBAL_AS const salt_t *salt_bufs, \ + GLOBAL_AS const p19 *esalt_bufs, \ + GLOBAL_AS u32 *d_return_buf, \ + GLOBAL_AS void *d_extra0_buf, \ + GLOBAL_AS void *d_extra1_buf, \ + GLOBAL_AS void *d_extra2_buf, \ + GLOBAL_AS void *d_extra3_buf, \ const u32 bitmap_mask, \ const u32 bitmap_shift1, \ const u32 bitmap_shift2, \ @@ -71,16 +71,16 @@ * do not use rules or tmps, etc. */ -#define KERN_ATTR_BASIC() KERN_ATTR (GLOBAL_AS, GLOBAL_AS const bf_t * restrict bfs_buf, void, void, void) -#define KERN_ATTR_BITSLICE() KERN_ATTR (GLOBAL_AS, CONSTANT_AS const bs_word_t * restrict words_buf_r, void, void, void) -#define KERN_ATTR_ESALT(e) KERN_ATTR (GLOBAL_AS, GLOBAL_AS const bf_t * restrict bfs_buf, void, void, e) -#define KERN_ATTR_RULES() KERN_ATTR (CONSTANT_AS, GLOBAL_AS const bf_t * restrict bfs_buf, void, void, void) -#define KERN_ATTR_RULES_ESALT(e) KERN_ATTR (CONSTANT_AS, GLOBAL_AS const bf_t * restrict bfs_buf, void, void, e) -#define KERN_ATTR_TMPS(t) KERN_ATTR (GLOBAL_AS, GLOBAL_AS const bf_t * restrict bfs_buf, t, void, void) -#define KERN_ATTR_TMPS_ESALT(t,e) KERN_ATTR (GLOBAL_AS, GLOBAL_AS const bf_t * restrict bfs_buf, t, void, e) -#define KERN_ATTR_TMPS_HOOKS(t,h) KERN_ATTR (GLOBAL_AS, GLOBAL_AS const bf_t * restrict bfs_buf, t, h, void) -#define KERN_ATTR_VECTOR() KERN_ATTR (GLOBAL_AS, CONSTANT_AS const u32x * restrict words_buf_r, void, void, void) -#define KERN_ATTR_VECTOR_ESALT(e) KERN_ATTR (GLOBAL_AS, CONSTANT_AS const u32x * restrict words_buf_r, void, void, e) +#define KERN_ATTR_BASIC() KERN_ATTR (GLOBAL_AS, GLOBAL_AS const bf_t *bfs_buf, void, void, void) +#define KERN_ATTR_BITSLICE() KERN_ATTR (GLOBAL_AS, CONSTANT_AS const bs_word_t *words_buf_r, void, void, void) +#define KERN_ATTR_ESALT(e) KERN_ATTR (GLOBAL_AS, GLOBAL_AS const bf_t *bfs_buf, void, void, e) +#define KERN_ATTR_RULES() KERN_ATTR (CONSTANT_AS, GLOBAL_AS const bf_t *bfs_buf, void, void, void) +#define KERN_ATTR_RULES_ESALT(e) KERN_ATTR (CONSTANT_AS, GLOBAL_AS const bf_t *bfs_buf, void, void, e) +#define KERN_ATTR_TMPS(t) KERN_ATTR (GLOBAL_AS, GLOBAL_AS const bf_t *bfs_buf, t, void, void) +#define KERN_ATTR_TMPS_ESALT(t,e) KERN_ATTR (GLOBAL_AS, GLOBAL_AS const bf_t *bfs_buf, t, void, e) +#define KERN_ATTR_TMPS_HOOKS(t,h) KERN_ATTR (GLOBAL_AS, GLOBAL_AS const bf_t *bfs_buf, t, h, void) +#define KERN_ATTR_VECTOR() KERN_ATTR (GLOBAL_AS, CONSTANT_AS const u32x *words_buf_r, void, void, void) +#define KERN_ATTR_VECTOR_ESALT(e) KERN_ATTR (GLOBAL_AS, CONSTANT_AS const u32x *words_buf_r, void, void, e) // union based packing diff --git a/OpenCL/inc_hash_md4.cl b/OpenCL/inc_hash_md4.cl index 509a00394..d02add1fb 100644 --- a/OpenCL/inc_hash_md4.cl +++ b/OpenCL/inc_hash_md4.cl @@ -434,7 +434,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_AS u32 *w, const int len) +DECLSPEC void md4_update_global (md4_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -486,7 +486,7 @@ DECLSPEC void md4_update_global (md4_ctx_t *ctx, const GLOBAL_AS u32 *w, const i md4_update_64 (ctx, w0, w1, w2, w3, len - pos1); } -DECLSPEC void md4_update_global_swap (md4_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len) +DECLSPEC void md4_update_global_swap (md4_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -572,7 +572,7 @@ DECLSPEC void md4_update_global_swap (md4_ctx_t *ctx, const GLOBAL_AS u32 *w, co md4_update_64 (ctx, w0, w1, w2, w3, len - pos1); } -DECLSPEC void md4_update_global_utf16le (md4_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len) +DECLSPEC void md4_update_global_utf16le (md4_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -614,7 +614,7 @@ DECLSPEC void md4_update_global_utf16le (md4_ctx_t *ctx, const GLOBAL_AS 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_AS u32 *w, const int len) +DECLSPEC void md4_update_global_utf16le_swap (md4_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -1033,22 +1033,22 @@ DECLSPEC void md4_hmac_update_utf16le_swap (md4_hmac_ctx_t *ctx, const u32 *w, c md4_update_utf16le_swap (&ctx->ipad, w, len); } -DECLSPEC void md4_hmac_update_global (md4_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len) +DECLSPEC void md4_hmac_update_global (md4_hmac_ctx_t *ctx, GLOBAL_AS const 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_AS u32 *w, const int len) +DECLSPEC void md4_hmac_update_global_swap (md4_hmac_ctx_t *ctx, GLOBAL_AS const 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_AS u32 *w, const int len) +DECLSPEC void md4_hmac_update_global_utf16le (md4_hmac_ctx_t *ctx, GLOBAL_AS const 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_AS u32 *w, const int len) +DECLSPEC void md4_hmac_update_global_utf16le_swap (md4_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { md4_update_global_utf16le_swap (&ctx->ipad, w, len); } diff --git a/OpenCL/inc_hash_md4.h b/OpenCL/inc_hash_md4.h index fed57a074..8dcebba55 100644 --- a/OpenCL/inc_hash_md4.h +++ b/OpenCL/inc_hash_md4.h @@ -101,10 +101,10 @@ DECLSPEC void md4_update (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); DECLSPEC void md4_update_utf16le (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); -DECLSPEC void md4_update_global (md4_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void md4_update_global_swap (md4_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void md4_update_global_utf16le (md4_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void md4_update_global_utf16le_swap (md4_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); +DECLSPEC void md4_update_global (md4_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void md4_update_global_swap (md4_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void md4_update_global_utf16le (md4_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void md4_update_global_utf16le_swap (md4_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void md4_final (md4_ctx_t *ctx); 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 (md4_hmac_ctx_t *ctx, const u32 *w, const int len); @@ -116,10 +116,10 @@ DECLSPEC void md4_hmac_update (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); DECLSPEC void md4_hmac_update_utf16le (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); -DECLSPEC void md4_hmac_update_global (md4_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void md4_hmac_update_global_swap (md4_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void md4_hmac_update_global_utf16le (md4_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void md4_hmac_update_global_utf16le_swap (md4_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); +DECLSPEC void md4_hmac_update_global (md4_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void md4_hmac_update_global_swap (md4_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void md4_hmac_update_global_utf16le (md4_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void md4_hmac_update_global_utf16le_swap (md4_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void md4_hmac_final (md4_hmac_ctx_t *ctx); DECLSPEC void md4_transform_vector (const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, u32x *digest); DECLSPEC void md4_init_vector (md4_ctx_vector_t *ctx); diff --git a/OpenCL/inc_hash_md5.cl b/OpenCL/inc_hash_md5.cl index c587c6bff..b88bb32ea 100644 --- a/OpenCL/inc_hash_md5.cl +++ b/OpenCL/inc_hash_md5.cl @@ -470,7 +470,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_AS u32 *w, const int len) +DECLSPEC void md5_update_global (md5_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -522,7 +522,7 @@ DECLSPEC void md5_update_global (md5_ctx_t *ctx, const GLOBAL_AS u32 *w, const i md5_update_64 (ctx, w0, w1, w2, w3, len - pos1); } -DECLSPEC void md5_update_global_swap (md5_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len) +DECLSPEC void md5_update_global_swap (md5_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -608,7 +608,7 @@ DECLSPEC void md5_update_global_swap (md5_ctx_t *ctx, const GLOBAL_AS u32 *w, co md5_update_64 (ctx, w0, w1, w2, w3, len - pos1); } -DECLSPEC void md5_update_global_utf16le (md5_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len) +DECLSPEC void md5_update_global_utf16le (md5_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -650,7 +650,7 @@ DECLSPEC void md5_update_global_utf16le (md5_ctx_t *ctx, const GLOBAL_AS 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_AS u32 *w, const int len) +DECLSPEC void md5_update_global_utf16le_swap (md5_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -1069,22 +1069,22 @@ DECLSPEC void md5_hmac_update_utf16le_swap (md5_hmac_ctx_t *ctx, const u32 *w, c md5_update_utf16le_swap (&ctx->ipad, w, len); } -DECLSPEC void md5_hmac_update_global (md5_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len) +DECLSPEC void md5_hmac_update_global (md5_hmac_ctx_t *ctx, GLOBAL_AS const 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_AS u32 *w, const int len) +DECLSPEC void md5_hmac_update_global_swap (md5_hmac_ctx_t *ctx, GLOBAL_AS const 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_AS u32 *w, const int len) +DECLSPEC void md5_hmac_update_global_utf16le (md5_hmac_ctx_t *ctx, GLOBAL_AS const 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_AS u32 *w, const int len) +DECLSPEC void md5_hmac_update_global_utf16le_swap (md5_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { md5_update_global_utf16le_swap (&ctx->ipad, w, len); } diff --git a/OpenCL/inc_hash_md5.h b/OpenCL/inc_hash_md5.h index b4f517a5f..f6b4a00b3 100644 --- a/OpenCL/inc_hash_md5.h +++ b/OpenCL/inc_hash_md5.h @@ -114,10 +114,10 @@ DECLSPEC void md5_update (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); DECLSPEC void md5_update_utf16le (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); -DECLSPEC void md5_update_global (md5_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void md5_update_global_swap (md5_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void md5_update_global_utf16le (md5_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void md5_update_global_utf16le_swap (md5_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); +DECLSPEC void md5_update_global (md5_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void md5_update_global_swap (md5_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void md5_update_global_utf16le (md5_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void md5_update_global_utf16le_swap (md5_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void md5_final (md5_ctx_t *ctx); 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 (md5_hmac_ctx_t *ctx, const u32 *w, const int len); @@ -129,10 +129,10 @@ DECLSPEC void md5_hmac_update (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); DECLSPEC void md5_hmac_update_utf16le (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); -DECLSPEC void md5_hmac_update_global (md5_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void md5_hmac_update_global_swap (md5_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void md5_hmac_update_global_utf16le (md5_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void md5_hmac_update_global_utf16le_swap (md5_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); +DECLSPEC void md5_hmac_update_global (md5_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void md5_hmac_update_global_swap (md5_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void md5_hmac_update_global_utf16le (md5_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void md5_hmac_update_global_utf16le_swap (md5_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void md5_hmac_final (md5_hmac_ctx_t *ctx); DECLSPEC void md5_transform_vector (const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, u32x *digest); DECLSPEC void md5_init_vector (md5_ctx_vector_t *ctx); diff --git a/OpenCL/inc_hash_ripemd160.cl b/OpenCL/inc_hash_ripemd160.cl index a8928937d..a02e30452 100644 --- a/OpenCL/inc_hash_ripemd160.cl +++ b/OpenCL/inc_hash_ripemd160.cl @@ -568,7 +568,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_AS u32 *w, const int len) +DECLSPEC void ripemd160_update_global (ripemd160_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -620,7 +620,7 @@ DECLSPEC void ripemd160_update_global (ripemd160_ctx_t *ctx, const GLOBAL_AS u32 ripemd160_update_64 (ctx, w0, w1, w2, w3, len - pos1); } -DECLSPEC void ripemd160_update_global_swap (ripemd160_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len) +DECLSPEC void ripemd160_update_global_swap (ripemd160_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -706,7 +706,7 @@ DECLSPEC void ripemd160_update_global_swap (ripemd160_ctx_t *ctx, const GLOBAL_A ripemd160_update_64 (ctx, w0, w1, w2, w3, len - pos1); } -DECLSPEC void ripemd160_update_global_utf16le (ripemd160_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len) +DECLSPEC void ripemd160_update_global_utf16le (ripemd160_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -748,7 +748,7 @@ DECLSPEC void ripemd160_update_global_utf16le (ripemd160_ctx_t *ctx, const GLOBA ripemd160_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2); } -DECLSPEC void ripemd160_update_global_utf16le_swap (ripemd160_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len) +DECLSPEC void ripemd160_update_global_utf16le_swap (ripemd160_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -1167,22 +1167,22 @@ DECLSPEC void ripemd160_hmac_update_utf16le_swap (ripemd160_hmac_ctx_t *ctx, con ripemd160_update_utf16le_swap (&ctx->ipad, w, len); } -DECLSPEC void ripemd160_hmac_update_global (ripemd160_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len) +DECLSPEC void ripemd160_hmac_update_global (ripemd160_hmac_ctx_t *ctx, GLOBAL_AS const 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_AS u32 *w, const int len) +DECLSPEC void ripemd160_hmac_update_global_swap (ripemd160_hmac_ctx_t *ctx, GLOBAL_AS const 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_AS u32 *w, const int len) +DECLSPEC void ripemd160_hmac_update_global_utf16le (ripemd160_hmac_ctx_t *ctx, GLOBAL_AS const 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_AS u32 *w, const int len) +DECLSPEC void ripemd160_hmac_update_global_utf16le_swap (ripemd160_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { ripemd160_update_global_utf16le_swap (&ctx->ipad, w, len); } diff --git a/OpenCL/inc_hash_ripemd160.h b/OpenCL/inc_hash_ripemd160.h index 25c327869..982f4fdb2 100644 --- a/OpenCL/inc_hash_ripemd160.h +++ b/OpenCL/inc_hash_ripemd160.h @@ -125,10 +125,10 @@ DECLSPEC void ripemd160_update (ripemd160_ctx_t *ctx, const u32 *w, const int le DECLSPEC void ripemd160_update_swap (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); DECLSPEC void ripemd160_update_utf16le_swap (ripemd160_ctx_t *ctx, const u32 *w, const int len); -DECLSPEC void ripemd160_update_global (ripemd160_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void ripemd160_update_global_swap (ripemd160_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void ripemd160_update_global_utf16le (ripemd160_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void ripemd160_update_global_utf16le_swap (ripemd160_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); +DECLSPEC void ripemd160_update_global (ripemd160_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void ripemd160_update_global_swap (ripemd160_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void ripemd160_update_global_utf16le (ripemd160_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void ripemd160_update_global_utf16le_swap (ripemd160_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void ripemd160_final (ripemd160_ctx_t *ctx); 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 (ripemd160_hmac_ctx_t *ctx, const u32 *w, const int len); @@ -140,10 +140,10 @@ DECLSPEC void ripemd160_hmac_update (ripemd160_hmac_ctx_t *ctx, const u32 *w, co DECLSPEC void ripemd160_hmac_update_swap (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); DECLSPEC void ripemd160_hmac_update_utf16le_swap (ripemd160_hmac_ctx_t *ctx, const u32 *w, const int len); -DECLSPEC void ripemd160_hmac_update_global (ripemd160_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void ripemd160_hmac_update_global_swap (ripemd160_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void ripemd160_hmac_update_global_utf16le (ripemd160_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void ripemd160_hmac_update_global_utf16le_swap (ripemd160_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); +DECLSPEC void ripemd160_hmac_update_global (ripemd160_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void ripemd160_hmac_update_global_swap (ripemd160_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void ripemd160_hmac_update_global_utf16le (ripemd160_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void ripemd160_hmac_update_global_utf16le_swap (ripemd160_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void ripemd160_hmac_final (ripemd160_hmac_ctx_t *ctx); DECLSPEC void ripemd160_transform_vector (const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, u32x *digest); DECLSPEC void ripemd160_init_vector (ripemd160_ctx_vector_t *ctx); diff --git a/OpenCL/inc_hash_sha1.cl b/OpenCL/inc_hash_sha1.cl index ae50c81d9..4efea16f0 100644 --- a/OpenCL/inc_hash_sha1.cl +++ b/OpenCL/inc_hash_sha1.cl @@ -618,7 +618,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_AS u32 *w, const int len) +DECLSPEC void sha1_update_global (sha1_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -670,7 +670,7 @@ DECLSPEC void sha1_update_global (sha1_ctx_t *ctx, const GLOBAL_AS 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_AS u32 *w, const int len) +DECLSPEC void sha1_update_global_swap (sha1_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -756,7 +756,7 @@ DECLSPEC void sha1_update_global_swap (sha1_ctx_t *ctx, const GLOBAL_AS u32 *w, sha1_update_64 (ctx, w0, w1, w2, w3, len - pos1); } -DECLSPEC void sha1_update_global_utf16le (sha1_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len) +DECLSPEC void sha1_update_global_utf16le (sha1_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -798,7 +798,7 @@ DECLSPEC void sha1_update_global_utf16le (sha1_ctx_t *ctx, const GLOBAL_AS u32 * sha1_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2); } -DECLSPEC void sha1_update_global_utf16le_swap (sha1_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len) +DECLSPEC void sha1_update_global_utf16le_swap (sha1_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -874,7 +874,7 @@ DECLSPEC void sha1_update_global_utf16le_swap (sha1_ctx_t *ctx, const GLOBAL_AS sha1_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2); } -DECLSPEC void sha1_update_global_utf16be (sha1_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len) +DECLSPEC void sha1_update_global_utf16be (sha1_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -916,7 +916,7 @@ DECLSPEC void sha1_update_global_utf16be (sha1_ctx_t *ctx, const GLOBAL_AS u32 * sha1_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2); } -DECLSPEC void sha1_update_global_utf16be_swap (sha1_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len) +DECLSPEC void sha1_update_global_utf16be_swap (sha1_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -1335,22 +1335,22 @@ DECLSPEC void sha1_hmac_update_utf16le_swap (sha1_hmac_ctx_t *ctx, const u32 *w, sha1_update_utf16le_swap (&ctx->ipad, w, len); } -DECLSPEC void sha1_hmac_update_global (sha1_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len) +DECLSPEC void sha1_hmac_update_global (sha1_hmac_ctx_t *ctx, GLOBAL_AS const 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_AS u32 *w, const int len) +DECLSPEC void sha1_hmac_update_global_swap (sha1_hmac_ctx_t *ctx, GLOBAL_AS const 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_AS u32 *w, const int len) +DECLSPEC void sha1_hmac_update_global_utf16le (sha1_hmac_ctx_t *ctx, GLOBAL_AS const 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_AS u32 *w, const int len) +DECLSPEC void sha1_hmac_update_global_utf16le_swap (sha1_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { sha1_update_global_utf16le_swap (&ctx->ipad, w, len); } diff --git a/OpenCL/inc_hash_sha1.h b/OpenCL/inc_hash_sha1.h index 0972f9829..055516cb8 100644 --- a/OpenCL/inc_hash_sha1.h +++ b/OpenCL/inc_hash_sha1.h @@ -111,12 +111,12 @@ DECLSPEC void sha1_update_utf16le (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); DECLSPEC void sha1_update_utf16be (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); -DECLSPEC void sha1_update_global (sha1_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void sha1_update_global_swap (sha1_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void sha1_update_global_utf16le (sha1_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void sha1_update_global_utf16le_swap (sha1_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void sha1_update_global_utf16be (sha1_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void sha1_update_global_utf16be_swap (sha1_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); +DECLSPEC void sha1_update_global (sha1_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void sha1_update_global_swap (sha1_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void sha1_update_global_utf16le (sha1_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void sha1_update_global_utf16le_swap (sha1_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void sha1_update_global_utf16be (sha1_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void sha1_update_global_utf16be_swap (sha1_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void sha1_final (sha1_ctx_t *ctx); 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 (sha1_hmac_ctx_t *ctx, const u32 *w, const int len); @@ -128,10 +128,10 @@ DECLSPEC void sha1_hmac_update (sha1_hmac_ctx_t *ctx, const u32 *w, const int le DECLSPEC void sha1_hmac_update_swap (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); DECLSPEC void sha1_hmac_update_utf16le_swap (sha1_hmac_ctx_t *ctx, const u32 *w, const int len); -DECLSPEC void sha1_hmac_update_global (sha1_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void sha1_hmac_update_global_swap (sha1_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void sha1_hmac_update_global_utf16le (sha1_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void sha1_hmac_update_global_utf16le_swap (sha1_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); +DECLSPEC void sha1_hmac_update_global (sha1_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void sha1_hmac_update_global_swap (sha1_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void sha1_hmac_update_global_utf16le (sha1_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void sha1_hmac_update_global_utf16le_swap (sha1_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void sha1_hmac_final (sha1_hmac_ctx_t *ctx); DECLSPEC void sha1_transform_vector (const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, u32x *digest); DECLSPEC void sha1_init_vector (sha1_ctx_vector_t *ctx); diff --git a/OpenCL/inc_hash_sha224.cl b/OpenCL/inc_hash_sha224.cl index 741a2fc66..2a8c0a2a2 100644 --- a/OpenCL/inc_hash_sha224.cl +++ b/OpenCL/inc_hash_sha224.cl @@ -465,7 +465,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_AS u32 *w, const int len) +DECLSPEC void sha224_update_global (sha224_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -517,7 +517,7 @@ DECLSPEC void sha224_update_global (sha224_ctx_t *ctx, const GLOBAL_AS u32 *w, c sha224_update_64 (ctx, w0, w1, w2, w3, len - pos1); } -DECLSPEC void sha224_update_global_swap (sha224_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len) +DECLSPEC void sha224_update_global_swap (sha224_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -603,7 +603,7 @@ DECLSPEC void sha224_update_global_swap (sha224_ctx_t *ctx, const GLOBAL_AS u32 sha224_update_64 (ctx, w0, w1, w2, w3, len - pos1); } -DECLSPEC void sha224_update_global_utf16le (sha224_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len) +DECLSPEC void sha224_update_global_utf16le (sha224_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -645,7 +645,7 @@ DECLSPEC void sha224_update_global_utf16le (sha224_ctx_t *ctx, const GLOBAL_AS u sha224_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2); } -DECLSPEC void sha224_update_global_utf16le_swap (sha224_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len) +DECLSPEC void sha224_update_global_utf16le_swap (sha224_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -1064,22 +1064,22 @@ DECLSPEC void sha224_hmac_update_utf16le_swap (sha224_hmac_ctx_t *ctx, const u32 sha224_update_utf16le_swap (&ctx->ipad, w, len); } -DECLSPEC void sha224_hmac_update_global (sha224_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len) +DECLSPEC void sha224_hmac_update_global (sha224_hmac_ctx_t *ctx, GLOBAL_AS const 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_AS u32 *w, const int len) +DECLSPEC void sha224_hmac_update_global_swap (sha224_hmac_ctx_t *ctx, GLOBAL_AS const 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_AS u32 *w, const int len) +DECLSPEC void sha224_hmac_update_global_utf16le (sha224_hmac_ctx_t *ctx, GLOBAL_AS const 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_AS u32 *w, const int len) +DECLSPEC void sha224_hmac_update_global_utf16le_swap (sha224_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { sha224_update_global_utf16le_swap (&ctx->ipad, w, len); } diff --git a/OpenCL/inc_hash_sha224.h b/OpenCL/inc_hash_sha224.h index 19d1e1c12..ed078a2b7 100644 --- a/OpenCL/inc_hash_sha224.h +++ b/OpenCL/inc_hash_sha224.h @@ -59,7 +59,7 @@ #define SHA224_EXPAND(x,y,z,w) (SHA224_S1 (x) + y + SHA224_S0 (z) + w) -CONSTANT_AS u32a k_sha224[64] = +CONSTANT_AS CONSTSPEC u32a k_sha224[64] = { SHA224C00, SHA224C01, SHA224C02, SHA224C03, SHA224C04, SHA224C05, SHA224C06, SHA224C07, @@ -126,10 +126,10 @@ DECLSPEC void sha224_update (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); DECLSPEC void sha224_update_utf16le (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); -DECLSPEC void sha224_update_global (sha224_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void sha224_update_global_swap (sha224_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void sha224_update_global_utf16le (sha224_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void sha224_update_global_utf16le_swap (sha224_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); +DECLSPEC void sha224_update_global (sha224_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void sha224_update_global_swap (sha224_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void sha224_update_global_utf16le (sha224_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void sha224_update_global_utf16le_swap (sha224_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void sha224_final (sha224_ctx_t *ctx); 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 (sha224_hmac_ctx_t *ctx, const u32 *w, const int len); @@ -141,10 +141,10 @@ DECLSPEC void sha224_hmac_update (sha224_hmac_ctx_t *ctx, const u32 *w, const in DECLSPEC void sha224_hmac_update_swap (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); DECLSPEC void sha224_hmac_update_utf16le_swap (sha224_hmac_ctx_t *ctx, const u32 *w, const int len); -DECLSPEC void sha224_hmac_update_global (sha224_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void sha224_hmac_update_global_swap (sha224_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void sha224_hmac_update_global_utf16le (sha224_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void sha224_hmac_update_global_utf16le_swap (sha224_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); +DECLSPEC void sha224_hmac_update_global (sha224_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void sha224_hmac_update_global_swap (sha224_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void sha224_hmac_update_global_utf16le (sha224_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void sha224_hmac_update_global_utf16le_swap (sha224_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void sha224_hmac_final (sha224_hmac_ctx_t *ctx); DECLSPEC void sha224_transform_vector (const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, u32x *digest); DECLSPEC void sha224_init_vector (sha224_ctx_vector_t *ctx); diff --git a/OpenCL/inc_hash_sha256.cl b/OpenCL/inc_hash_sha256.cl index 028cddc8b..de7797881 100644 --- a/OpenCL/inc_hash_sha256.cl +++ b/OpenCL/inc_hash_sha256.cl @@ -465,7 +465,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_AS u32 *w, const int len) +DECLSPEC void sha256_update_global (sha256_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -517,7 +517,7 @@ DECLSPEC void sha256_update_global (sha256_ctx_t *ctx, const GLOBAL_AS u32 *w, c sha256_update_64 (ctx, w0, w1, w2, w3, len - pos1); } -DECLSPEC void sha256_update_global_swap (sha256_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len) +DECLSPEC void sha256_update_global_swap (sha256_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -603,7 +603,7 @@ DECLSPEC void sha256_update_global_swap (sha256_ctx_t *ctx, const GLOBAL_AS u32 sha256_update_64 (ctx, w0, w1, w2, w3, len - pos1); } -DECLSPEC void sha256_update_global_utf16le (sha256_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len) +DECLSPEC void sha256_update_global_utf16le (sha256_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -645,7 +645,7 @@ DECLSPEC void sha256_update_global_utf16le (sha256_ctx_t *ctx, const GLOBAL_AS u sha256_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2); } -DECLSPEC void sha256_update_global_utf16le_swap (sha256_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len) +DECLSPEC void sha256_update_global_utf16le_swap (sha256_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -1064,22 +1064,22 @@ DECLSPEC void sha256_hmac_update_utf16le_swap (sha256_hmac_ctx_t *ctx, const u32 sha256_update_utf16le_swap (&ctx->ipad, w, len); } -DECLSPEC void sha256_hmac_update_global (sha256_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len) +DECLSPEC void sha256_hmac_update_global (sha256_hmac_ctx_t *ctx, GLOBAL_AS const 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_AS u32 *w, const int len) +DECLSPEC void sha256_hmac_update_global_swap (sha256_hmac_ctx_t *ctx, GLOBAL_AS const 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_AS u32 *w, const int len) +DECLSPEC void sha256_hmac_update_global_utf16le (sha256_hmac_ctx_t *ctx, GLOBAL_AS const 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_AS u32 *w, const int len) +DECLSPEC void sha256_hmac_update_global_utf16le_swap (sha256_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { sha256_update_global_utf16le_swap (&ctx->ipad, w, len); } diff --git a/OpenCL/inc_hash_sha256.h b/OpenCL/inc_hash_sha256.h index 5cbc4d971..401c9ba0e 100644 --- a/OpenCL/inc_hash_sha256.h +++ b/OpenCL/inc_hash_sha256.h @@ -99,7 +99,7 @@ typedef struct sha256_hmac_ctx_vector } sha256_hmac_ctx_vector_t; -CONSTANT_AS u32a k_sha256[64] = +CONSTANT_AS CONSTSPEC u32a k_sha256[64] = { SHA256C00, SHA256C01, SHA256C02, SHA256C03, SHA256C04, SHA256C05, SHA256C06, SHA256C07, @@ -126,10 +126,10 @@ DECLSPEC void sha256_update (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); DECLSPEC void sha256_update_utf16le (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); -DECLSPEC void sha256_update_global (sha256_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void sha256_update_global_swap (sha256_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void sha256_update_global_utf16le (sha256_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void sha256_update_global_utf16le_swap (sha256_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); +DECLSPEC void sha256_update_global (sha256_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void sha256_update_global_swap (sha256_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void sha256_update_global_utf16le (sha256_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void sha256_update_global_utf16le_swap (sha256_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void sha256_final (sha256_ctx_t *ctx); 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 (sha256_hmac_ctx_t *ctx, const u32 *w, const int len); @@ -141,10 +141,10 @@ DECLSPEC void sha256_hmac_update (sha256_hmac_ctx_t *ctx, const u32 *w, const in DECLSPEC void sha256_hmac_update_swap (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); DECLSPEC void sha256_hmac_update_utf16le_swap (sha256_hmac_ctx_t *ctx, const u32 *w, const int len); -DECLSPEC void sha256_hmac_update_global (sha256_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void sha256_hmac_update_global_swap (sha256_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void sha256_hmac_update_global_utf16le (sha256_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void sha256_hmac_update_global_utf16le_swap (sha256_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); +DECLSPEC void sha256_hmac_update_global (sha256_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void sha256_hmac_update_global_swap (sha256_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void sha256_hmac_update_global_utf16le (sha256_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void sha256_hmac_update_global_utf16le_swap (sha256_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void sha256_hmac_final (sha256_hmac_ctx_t *ctx); DECLSPEC void sha256_transform_vector (const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, u32x *digest); DECLSPEC void sha256_init_vector (sha256_ctx_vector_t *ctx); diff --git a/OpenCL/inc_hash_sha384.cl b/OpenCL/inc_hash_sha384.cl index bb481a107..d9fe20ff4 100644 --- a/OpenCL/inc_hash_sha384.cl +++ b/OpenCL/inc_hash_sha384.cl @@ -717,7 +717,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_AS u32 *w, const int len) +DECLSPEC void sha384_update_global (sha384_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -805,7 +805,7 @@ DECLSPEC void sha384_update_global (sha384_ctx_t *ctx, const GLOBAL_AS u32 *w, c 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_AS u32 *w, const int len) +DECLSPEC void sha384_update_global_swap (sha384_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -959,7 +959,7 @@ DECLSPEC void sha384_update_global_swap (sha384_ctx_t *ctx, const GLOBAL_AS 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_AS u32 *w, const int len) +DECLSPEC void sha384_update_global_utf16le (sha384_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -1025,7 +1025,7 @@ DECLSPEC void sha384_update_global_utf16le (sha384_ctx_t *ctx, const GLOBAL_AS u 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_AS u32 *w, const int len) +DECLSPEC void sha384_update_global_utf16le_swap (sha384_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -1696,22 +1696,22 @@ DECLSPEC void sha384_hmac_update_utf16le_swap (sha384_hmac_ctx_t *ctx, const u32 sha384_update_utf16le_swap (&ctx->ipad, w, len); } -DECLSPEC void sha384_hmac_update_global (sha384_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len) +DECLSPEC void sha384_hmac_update_global (sha384_hmac_ctx_t *ctx, GLOBAL_AS const 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_AS u32 *w, const int len) +DECLSPEC void sha384_hmac_update_global_swap (sha384_hmac_ctx_t *ctx, GLOBAL_AS const 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_AS u32 *w, const int len) +DECLSPEC void sha384_hmac_update_global_utf16le (sha384_hmac_ctx_t *ctx, GLOBAL_AS const 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_AS u32 *w, const int len) +DECLSPEC void sha384_hmac_update_global_utf16le_swap (sha384_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { sha384_update_global_utf16le_swap (&ctx->ipad, w, len); } diff --git a/OpenCL/inc_hash_sha384.h b/OpenCL/inc_hash_sha384.h index 7a6865d4d..237ceca51 100644 --- a/OpenCL/inc_hash_sha384.h +++ b/OpenCL/inc_hash_sha384.h @@ -62,7 +62,7 @@ #define SHA384_EXPAND(x,y,z,w) (SHA384_S3 (x) + y + SHA384_S2 (z) + w) -CONSTANT_AS u64a k_sha384[80] = +CONSTANT_AS CONSTSPEC u64a k_sha384[80] = { SHA512C00, SHA512C01, SHA512C02, SHA512C03, SHA512C04, SHA512C05, SHA512C06, SHA512C07, @@ -141,10 +141,10 @@ DECLSPEC void sha384_update (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); DECLSPEC void sha384_update_utf16le (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); -DECLSPEC void sha384_update_global (sha384_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void sha384_update_global_swap (sha384_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void sha384_update_global_utf16le (sha384_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void sha384_update_global_utf16le_swap (sha384_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); +DECLSPEC void sha384_update_global (sha384_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void sha384_update_global_swap (sha384_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void sha384_update_global_utf16le (sha384_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void sha384_update_global_utf16le_swap (sha384_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void sha384_final (sha384_ctx_t *ctx); 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 (sha384_hmac_ctx_t *ctx, const u32 *w, const int len); @@ -156,10 +156,10 @@ DECLSPEC void sha384_hmac_update (sha384_hmac_ctx_t *ctx, const u32 *w, const in DECLSPEC void sha384_hmac_update_swap (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); DECLSPEC void sha384_hmac_update_utf16le_swap (sha384_hmac_ctx_t *ctx, const u32 *w, const int len); -DECLSPEC void sha384_hmac_update_global (sha384_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void sha384_hmac_update_global_swap (sha384_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void sha384_hmac_update_global_utf16le (sha384_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void sha384_hmac_update_global_utf16le_swap (sha384_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); +DECLSPEC void sha384_hmac_update_global (sha384_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void sha384_hmac_update_global_swap (sha384_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void sha384_hmac_update_global_utf16le (sha384_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void sha384_hmac_update_global_utf16le_swap (sha384_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void sha384_hmac_final (sha384_hmac_ctx_t *ctx); 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_init_vector (sha384_ctx_vector_t *ctx); diff --git a/OpenCL/inc_hash_sha512.cl b/OpenCL/inc_hash_sha512.cl index 84c3e485a..38fbf43b7 100644 --- a/OpenCL/inc_hash_sha512.cl +++ b/OpenCL/inc_hash_sha512.cl @@ -717,7 +717,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_AS u32 *w, const int len) +DECLSPEC void sha512_update_global (sha512_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -805,7 +805,7 @@ DECLSPEC void sha512_update_global (sha512_ctx_t *ctx, const GLOBAL_AS u32 *w, c 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_AS u32 *w, const int len) +DECLSPEC void sha512_update_global_swap (sha512_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -959,7 +959,7 @@ DECLSPEC void sha512_update_global_swap (sha512_ctx_t *ctx, const GLOBAL_AS 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_AS u32 *w, const int len) +DECLSPEC void sha512_update_global_utf16le (sha512_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -1025,7 +1025,7 @@ DECLSPEC void sha512_update_global_utf16le (sha512_ctx_t *ctx, const GLOBAL_AS u 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_AS u32 *w, const int len) +DECLSPEC void sha512_update_global_utf16le_swap (sha512_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -1696,22 +1696,22 @@ DECLSPEC void sha512_hmac_update_utf16le_swap (sha512_hmac_ctx_t *ctx, const u32 sha512_update_utf16le_swap (&ctx->ipad, w, len); } -DECLSPEC void sha512_hmac_update_global (sha512_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len) +DECLSPEC void sha512_hmac_update_global (sha512_hmac_ctx_t *ctx, GLOBAL_AS const 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_AS u32 *w, const int len) +DECLSPEC void sha512_hmac_update_global_swap (sha512_hmac_ctx_t *ctx, GLOBAL_AS const 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_AS u32 *w, const int len) +DECLSPEC void sha512_hmac_update_global_utf16le (sha512_hmac_ctx_t *ctx, GLOBAL_AS const 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_AS u32 *w, const int len) +DECLSPEC void sha512_hmac_update_global_utf16le_swap (sha512_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { sha512_update_global_utf16le_swap (&ctx->ipad, w, len); } diff --git a/OpenCL/inc_hash_sha512.h b/OpenCL/inc_hash_sha512.h index 53532dae7..2ce509e8c 100644 --- a/OpenCL/inc_hash_sha512.h +++ b/OpenCL/inc_hash_sha512.h @@ -62,7 +62,7 @@ #define SHA512_EXPAND(x,y,z,w) (SHA512_S3 (x) + y + SHA512_S2 (z) + w) -CONSTANT_AS u64a k_sha512[80] = +CONSTANT_AS CONSTSPEC u64a k_sha512[80] = { SHA512C00, SHA512C01, SHA512C02, SHA512C03, SHA512C04, SHA512C05, SHA512C06, SHA512C07, @@ -141,10 +141,10 @@ DECLSPEC void sha512_update (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); DECLSPEC void sha512_update_utf16le (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); -DECLSPEC void sha512_update_global (sha512_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void sha512_update_global_swap (sha512_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void sha512_update_global_utf16le (sha512_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void sha512_update_global_utf16le_swap (sha512_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); +DECLSPEC void sha512_update_global (sha512_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void sha512_update_global_swap (sha512_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void sha512_update_global_utf16le (sha512_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void sha512_update_global_utf16le_swap (sha512_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void sha512_final (sha512_ctx_t *ctx); 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 (sha512_hmac_ctx_t *ctx, const u32 *w, const int len); @@ -156,10 +156,10 @@ DECLSPEC void sha512_hmac_update (sha512_hmac_ctx_t *ctx, const u32 *w, const in DECLSPEC void sha512_hmac_update_swap (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); DECLSPEC void sha512_hmac_update_utf16le_swap (sha512_hmac_ctx_t *ctx, const u32 *w, const int len); -DECLSPEC void sha512_hmac_update_global (sha512_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void sha512_hmac_update_global_swap (sha512_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void sha512_hmac_update_global_utf16le (sha512_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void sha512_hmac_update_global_utf16le_swap (sha512_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); +DECLSPEC void sha512_hmac_update_global (sha512_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void sha512_hmac_update_global_swap (sha512_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void sha512_hmac_update_global_utf16le (sha512_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void sha512_hmac_update_global_utf16le_swap (sha512_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void sha512_hmac_final (sha512_hmac_ctx_t *ctx); 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_init_vector (sha512_ctx_vector_t *ctx); diff --git a/OpenCL/inc_hash_streebog256.cl b/OpenCL/inc_hash_streebog256.cl index 6e14f0b3a..701890755 100644 --- a/OpenCL/inc_hash_streebog256.cl +++ b/OpenCL/inc_hash_streebog256.cl @@ -361,7 +361,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_AS u32 *w, int len) +DECLSPEC void streebog256_update_global_swap (streebog256_ctx_t *ctx, GLOBAL_AS const u32 *w, int len) { u32 w0[4]; u32 w1[4]; @@ -634,7 +634,7 @@ DECLSPEC void streebog256_hmac_update_swap (streebog256_hmac_ctx_t *ctx, const u streebog256_update_swap (&ctx->ipad, w, len); } -DECLSPEC void streebog256_hmac_update_global_swap (streebog256_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len) +DECLSPEC void streebog256_hmac_update_global_swap (streebog256_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { streebog256_update_global_swap (&ctx->ipad, w, len); } diff --git a/OpenCL/inc_hash_streebog256.h b/OpenCL/inc_hash_streebog256.h index b234c6b5d..633c0d578 100644 --- a/OpenCL/inc_hash_streebog256.h +++ b/OpenCL/inc_hash_streebog256.h @@ -6,7 +6,7 @@ #ifndef _INC_HASH_STREEBOG256_H #define _INC_HASH_STREEBOG256_H -CONSTANT_AS u64a sbob_sl64[8][256] = +CONSTANT_AS CONSTSPEC u64a sbob_sl64[8][256] = { { 0xd031c397ce553fe6, 0x16ba5b01b006b525, 0xa89bade6296e70c8, 0x6a1f525d77d3435b, @@ -538,7 +538,7 @@ CONSTANT_AS u64a sbob_sl64[8][256] = }, }; -CONSTANT_AS u64a sbob_rc64[12][8] = +CONSTANT_AS CONSTSPEC u64a sbob_rc64[12][8] = { { 0xe9daca1eda5b08b1, 0x1f7c65c0812fcbeb, 0x16d0452e43766a2f, 0xfcc485758db84e71, @@ -677,7 +677,7 @@ DECLSPEC void streebog256_transform (streebog256_ctx_t *ctx, const u32 *w0, cons DECLSPEC void streebog256_update_64 (streebog256_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len); 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_global_swap (streebog256_ctx_t *ctx, const GLOBAL_AS u32 *w, int len); +DECLSPEC void streebog256_update_global_swap (streebog256_ctx_t *ctx, GLOBAL_AS const u32 *w, int len); DECLSPEC void streebog256_final (streebog256_ctx_t *ctx); 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 (streebog256_hmac_ctx_t *ctx, const u32 *w, const int len, SHM_TYPE u64a (*s_sbob_sl64)[256]); @@ -685,7 +685,7 @@ DECLSPEC void streebog256_hmac_init_swap (streebog256_hmac_ctx_t *ctx, const u32 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 (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); -DECLSPEC void streebog256_hmac_update_global_swap (streebog256_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); +DECLSPEC void streebog256_hmac_update_global_swap (streebog256_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void streebog256_hmac_final (streebog256_hmac_ctx_t *ctx); DECLSPEC void streebog256_init_vector (streebog256_ctx_vector_t *ctx, SHM_TYPE u64a (*s_sbob_sl64)[256]); DECLSPEC void streebog256_add_vector (u64x *x, const u64x *y); diff --git a/OpenCL/inc_hash_streebog512.cl b/OpenCL/inc_hash_streebog512.cl index a32f22efd..038582bdc 100644 --- a/OpenCL/inc_hash_streebog512.cl +++ b/OpenCL/inc_hash_streebog512.cl @@ -361,7 +361,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_AS u32 *w, int len) +DECLSPEC void streebog512_update_global_swap (streebog512_ctx_t *ctx, GLOBAL_AS const u32 *w, int len) { u32 w0[4]; u32 w1[4]; @@ -634,7 +634,7 @@ DECLSPEC void streebog512_hmac_update_swap (streebog512_hmac_ctx_t *ctx, const u streebog512_update_swap (&ctx->ipad, w, len); } -DECLSPEC void streebog512_hmac_update_global_swap (streebog512_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len) +DECLSPEC void streebog512_hmac_update_global_swap (streebog512_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { streebog512_update_global_swap (&ctx->ipad, w, len); } diff --git a/OpenCL/inc_hash_streebog512.h b/OpenCL/inc_hash_streebog512.h index 011e07efe..10dfae436 100644 --- a/OpenCL/inc_hash_streebog512.h +++ b/OpenCL/inc_hash_streebog512.h @@ -6,7 +6,7 @@ #ifndef _INC_HASH_STREEBOG512_H #define _INC_HASH_STREEBOG512_H -CONSTANT_AS u64a sbob_sl64[8][256] = +CONSTANT_AS CONSTSPEC u64a sbob_sl64[8][256] = { { 0xd031c397ce553fe6, 0x16ba5b01b006b525, 0xa89bade6296e70c8, 0x6a1f525d77d3435b, @@ -538,7 +538,7 @@ CONSTANT_AS u64a sbob_sl64[8][256] = }, }; -CONSTANT_AS u64a sbob_rc64[12][8] = +CONSTANT_AS CONSTSPEC u64a sbob_rc64[12][8] = { { 0xe9daca1eda5b08b1, 0x1f7c65c0812fcbeb, 0x16d0452e43766a2f, 0xfcc485758db84e71, @@ -677,7 +677,7 @@ DECLSPEC void streebog512_transform (streebog512_ctx_t *ctx, const u32 *w0, cons DECLSPEC void streebog512_update_64 (streebog512_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len); 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_global_swap (streebog512_ctx_t *ctx, const GLOBAL_AS u32 *w, int len); +DECLSPEC void streebog512_update_global_swap (streebog512_ctx_t *ctx, GLOBAL_AS const u32 *w, int len); DECLSPEC void streebog512_final (streebog512_ctx_t *ctx); 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 (streebog512_hmac_ctx_t *ctx, const u32 *w, const int len, SHM_TYPE u64a (*s_sbob_sl64)[256]); @@ -685,7 +685,7 @@ DECLSPEC void streebog512_hmac_init_swap (streebog512_hmac_ctx_t *ctx, const u32 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 (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); -DECLSPEC void streebog512_hmac_update_global_swap (streebog512_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); +DECLSPEC void streebog512_hmac_update_global_swap (streebog512_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void streebog512_hmac_final (streebog512_hmac_ctx_t *ctx); DECLSPEC void streebog512_init_vector (streebog512_ctx_vector_t *ctx, SHM_TYPE u64a (*s_sbob_sl64)[256]); DECLSPEC void streebog512_add_vector (u64x *x, const u64x *y); diff --git a/OpenCL/inc_hash_whirlpool.cl b/OpenCL/inc_hash_whirlpool.cl index b5e75b7cc..37e749b2f 100644 --- a/OpenCL/inc_hash_whirlpool.cl +++ b/OpenCL/inc_hash_whirlpool.cl @@ -555,7 +555,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_AS u32 *w, const int len) +DECLSPEC void whirlpool_update_global (whirlpool_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -607,7 +607,7 @@ DECLSPEC void whirlpool_update_global (whirlpool_ctx_t *ctx, const GLOBAL_AS u32 whirlpool_update_64 (ctx, w0, w1, w2, w3, len - pos1); } -DECLSPEC void whirlpool_update_global_swap (whirlpool_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len) +DECLSPEC void whirlpool_update_global_swap (whirlpool_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -693,7 +693,7 @@ DECLSPEC void whirlpool_update_global_swap (whirlpool_ctx_t *ctx, const GLOBAL_A whirlpool_update_64 (ctx, w0, w1, w2, w3, len - pos1); } -DECLSPEC void whirlpool_update_global_utf16le (whirlpool_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len) +DECLSPEC void whirlpool_update_global_utf16le (whirlpool_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -735,7 +735,7 @@ DECLSPEC void whirlpool_update_global_utf16le (whirlpool_ctx_t *ctx, const GLOBA whirlpool_update_64 (ctx, w0, w1, w2, w3, (len - pos1) * 2); } -DECLSPEC void whirlpool_update_global_utf16le_swap (whirlpool_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len) +DECLSPEC void whirlpool_update_global_utf16le_swap (whirlpool_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; @@ -1154,22 +1154,22 @@ DECLSPEC void whirlpool_hmac_update_utf16le_swap (whirlpool_hmac_ctx_t *ctx, con whirlpool_update_utf16le_swap (&ctx->ipad, w, len); } -DECLSPEC void whirlpool_hmac_update_global (whirlpool_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len) +DECLSPEC void whirlpool_hmac_update_global (whirlpool_hmac_ctx_t *ctx, GLOBAL_AS const 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_AS u32 *w, const int len) +DECLSPEC void whirlpool_hmac_update_global_swap (whirlpool_hmac_ctx_t *ctx, GLOBAL_AS const 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_AS u32 *w, const int len) +DECLSPEC void whirlpool_hmac_update_global_utf16le (whirlpool_hmac_ctx_t *ctx, GLOBAL_AS const 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_AS u32 *w, const int len) +DECLSPEC void whirlpool_hmac_update_global_utf16le_swap (whirlpool_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { whirlpool_update_global_utf16le_swap (&ctx->ipad, w, len); } diff --git a/OpenCL/inc_hash_whirlpool.h b/OpenCL/inc_hash_whirlpool.h index 71e507267..c5c9798a4 100644 --- a/OpenCL/inc_hash_whirlpool.h +++ b/OpenCL/inc_hash_whirlpool.h @@ -8,7 +8,7 @@ #define R 10 -CONSTANT_AS u32a Ch[8][256] = +CONSTANT_AS CONSTSPEC u32a Ch[8][256] = { { 0x18186018, 0x23238c23, 0xc6c63fc6, 0xe8e887e8, @@ -540,7 +540,7 @@ CONSTANT_AS u32a Ch[8][256] = } }; -CONSTANT_AS u32a Cl[8][256] = +CONSTANT_AS CONSTSPEC u32a Cl[8][256] = { { 0xc07830d8, 0x05af4626, 0x7ef991b8, 0x136fcdfb, @@ -1072,7 +1072,7 @@ CONSTANT_AS u32a Cl[8][256] = }, }; -CONSTANT_AS u32a rch[R + 1] = +CONSTANT_AS CONSTSPEC u32a rch[R + 1] = { 0x00000000, 0x1823c6e8, @@ -1087,7 +1087,7 @@ CONSTANT_AS u32a rch[R + 1] = 0xca2dbf07, }; -CONSTANT_AS u32a rcl[R + 1] = +CONSTANT_AS CONSTSPEC u32a rcl[R + 1] = { 0x00000000, 0x87b8014f, @@ -1169,10 +1169,10 @@ DECLSPEC void whirlpool_update (whirlpool_ctx_t *ctx, const u32 *w, const int le DECLSPEC void whirlpool_update_swap (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); DECLSPEC void whirlpool_update_utf16le_swap (whirlpool_ctx_t *ctx, const u32 *w, const int len); -DECLSPEC void whirlpool_update_global (whirlpool_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void whirlpool_update_global_swap (whirlpool_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void whirlpool_update_global_utf16le (whirlpool_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void whirlpool_update_global_utf16le_swap (whirlpool_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); +DECLSPEC void whirlpool_update_global (whirlpool_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void whirlpool_update_global_swap (whirlpool_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void whirlpool_update_global_utf16le (whirlpool_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void whirlpool_update_global_utf16le_swap (whirlpool_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void whirlpool_final (whirlpool_ctx_t *ctx); DECLSPEC void whirlpool_hmac_init_64 (whirlpool_hmac_ctx_t *ctx, const u32 *w0, const u32 *w1, const u32 *w2, const u32 *w3, SHM_TYPE u32 (*s_Ch)[256], SHM_TYPE u32 (*s_Cl)[256]); DECLSPEC void whirlpool_hmac_init (whirlpool_hmac_ctx_t *ctx, const u32 *w, const int len, SHM_TYPE u32 (*s_Ch)[256], SHM_TYPE u32 (*s_Cl)[256]); @@ -1184,10 +1184,10 @@ DECLSPEC void whirlpool_hmac_update (whirlpool_hmac_ctx_t *ctx, const u32 *w, co DECLSPEC void whirlpool_hmac_update_swap (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); DECLSPEC void whirlpool_hmac_update_utf16le_swap (whirlpool_hmac_ctx_t *ctx, const u32 *w, const int len); -DECLSPEC void whirlpool_hmac_update_global (whirlpool_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void whirlpool_hmac_update_global_swap (whirlpool_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void whirlpool_hmac_update_global_utf16le (whirlpool_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); -DECLSPEC void whirlpool_hmac_update_global_utf16le_swap (whirlpool_hmac_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len); +DECLSPEC void whirlpool_hmac_update_global (whirlpool_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void whirlpool_hmac_update_global_swap (whirlpool_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void whirlpool_hmac_update_global_utf16le (whirlpool_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); +DECLSPEC void whirlpool_hmac_update_global_utf16le_swap (whirlpool_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len); DECLSPEC void whirlpool_hmac_final (whirlpool_hmac_ctx_t *ctx); DECLSPEC void whirlpool_transform_vector (const u32x *w0, const u32x *w1, const u32x *w2, const u32x *w3, u32x *digest, SHM_TYPE u32 (*s_Ch)[256], SHM_TYPE u32 (*s_Cl)[256]); DECLSPEC void whirlpool_init_vector (whirlpool_ctx_vector_t *ctx, SHM_TYPE u32 (*s_Ch)[256], SHM_TYPE u32 (*s_Cl)[256]); diff --git a/OpenCL/inc_rp.cl b/OpenCL/inc_rp.cl index 88d78982f..2cd93787f 100644 --- a/OpenCL/inc_rp.cl +++ b/OpenCL/inc_rp.cl @@ -748,7 +748,7 @@ DECLSPEC int apply_rule (const u32 name, MAYBE_UNUSED const u8 p0, MAYBE_UNUSED return out_len; } -DECLSPEC int apply_rules (CONSTANT_AS const u32 *cmds, u32 *buf, const int in_len) +DECLSPEC int apply_rules (CONSTANT_AS u32 *cmds, u32 *buf, const int in_len) { int out_len = in_len; diff --git a/OpenCL/inc_rp.h b/OpenCL/inc_rp.h index b486444a1..78ab5b7db 100644 --- a/OpenCL/inc_rp.h +++ b/OpenCL/inc_rp.h @@ -113,6 +113,6 @@ DECLSPEC int mangle_dupeblock_first (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED cons DECLSPEC int mangle_dupeblock_last (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len); DECLSPEC int mangle_title_sep (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len); DECLSPEC int apply_rule (const u32 name, MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int in_len); -DECLSPEC int apply_rules (CONSTANT_AS const u32 *cmds, u32 *buf, const int in_len); +DECLSPEC int apply_rules (CONSTANT_AS u32 *cmds, u32 *buf, const int in_len); #endif // _INC_RP_H diff --git a/OpenCL/inc_rp_optimized.cl b/OpenCL/inc_rp_optimized.cl index 1f1c33f9b..8e974f8ce 100644 --- a/OpenCL/inc_rp_optimized.cl +++ b/OpenCL/inc_rp_optimized.cl @@ -12,7 +12,7 @@ #define MAYBE_UNUSED #endif -DECLSPEC u32 generate_cmask (const u32 value) +DECLSPEC u32 generate_cmask_optimized (const u32 value) { const u32 rmask = ((value & 0x40404040u) >> 1u) & ~((value & 0x80808080u) >> 2u); @@ -23,7 +23,7 @@ DECLSPEC u32 generate_cmask (const u32 value) return rmask & ~hmask & lmask; } -DECLSPEC void truncate_right (u32 *buf0, u32 *buf1, const u32 offset) +DECLSPEC void truncate_right_optimized (u32 *buf0, u32 *buf1, const u32 offset) { const u32 tmp = (1u << ((offset & 3u) * 8u)) - 1u; @@ -82,7 +82,7 @@ DECLSPEC void truncate_right (u32 *buf0, u32 *buf1, const u32 offset) } } -DECLSPEC void truncate_left (u32 *buf0, u32 *buf1, const u32 offset) +DECLSPEC void truncate_left_optimized (u32 *buf0, u32 *buf1, const u32 offset) { const u32 tmp = ~((1u << ((offset & 3u) * 8u)) - 1u); @@ -141,7 +141,7 @@ DECLSPEC void truncate_left (u32 *buf0, u32 *buf1, const u32 offset) } } -DECLSPEC void lshift_block (const u32 *in0, const u32 *in1, u32 *out0, u32 *out1) +DECLSPEC void lshift_block_optimized (const u32 *in0, const u32 *in1, u32 *out0, u32 *out1) { out0[0] = hc_bytealign_S (in0[1], in0[0], 1); out0[1] = hc_bytealign_S (in0[2], in0[1], 1); @@ -153,7 +153,7 @@ DECLSPEC void lshift_block (const u32 *in0, const u32 *in1, u32 *out0, u32 *out1 out1[3] = hc_bytealign_S ( 0, in1[3], 1); } -DECLSPEC void rshift_block (const u32 *in0, const u32 *in1, u32 *out0, u32 *out1) +DECLSPEC void rshift_block_optimized (const u32 *in0, const u32 *in1, u32 *out0, u32 *out1) { out1[3] = hc_bytealign_S (in1[3], in1[2], 3); out1[2] = hc_bytealign_S (in1[2], in1[1], 3); @@ -165,7 +165,7 @@ DECLSPEC void rshift_block (const u32 *in0, const u32 *in1, u32 *out0, u32 *out1 out0[0] = hc_bytealign_S (in0[0], 0, 3); } -DECLSPEC void lshift_block_N (const u32 *in0, const u32 *in1, u32 *out0, u32 *out1, const u32 num) +DECLSPEC void lshift_block_optimized_N (const u32 *in0, const u32 *in1, u32 *out0, u32 *out1, const u32 num) { switch (num) { @@ -460,7 +460,7 @@ DECLSPEC void lshift_block_N (const u32 *in0, const u32 *in1, u32 *out0, u32 *ou } } -DECLSPEC void rshift_block_N (const u32 *in0, const u32 *in1, u32 *out0, u32 *out1, const u32 num) +DECLSPEC void rshift_block_optimized_N (const u32 *in0, const u32 *in1, u32 *out0, u32 *out1, const u32 num) { switch (num) { @@ -755,7 +755,7 @@ DECLSPEC void rshift_block_N (const u32 *in0, const u32 *in1, u32 *out0, u32 *ou } } -DECLSPEC void append_block1 (const u32 offset, u32 *buf0, u32 *buf1, const u32 src_r0) +DECLSPEC void append_block1_optimized (const u32 offset, u32 *buf0, u32 *buf1, const u32 src_r0) { // this version works with 1 byte append only const u32 value = src_r0 & 0xff; @@ -775,7 +775,7 @@ DECLSPEC void append_block1 (const u32 offset, u32 *buf0, u32 *buf1, const u32 s append_helper_1x4_S (buf1, ((offset16 == 1) ? tmp : 0), v); } -DECLSPEC 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) +DECLSPEC void append_block8_optimized (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; u32 s1 = 0; @@ -1030,9 +1030,9 @@ DECLSPEC void append_block8 (const u32 offset, u32 *buf0, u32 *buf1, const u32 * buf1[3] = src_l1[3] | s7; } -DECLSPEC void reverse_block (u32 *in0, u32 *in1, u32 *out0, u32 *out1, const u32 len) +DECLSPEC void reverse_block_optimized (u32 *in0, u32 *in1, u32 *out0, u32 *out1, const u32 len) { - rshift_block_N (in0, in1, out0, out1, 32 - len); + rshift_block_optimized_N (in0, in1, out0, out1, 32 - len); u32 tib40[4]; u32 tib41[4]; @@ -1056,7 +1056,7 @@ DECLSPEC void reverse_block (u32 *in0, u32 *in1, u32 *out0, u32 *out1, const u32 out1[3] = hc_swap32_S (tib41[3]); } -DECLSPEC void exchange_byte (u32 *buf, const int off_src, const int off_dst) +DECLSPEC void exchange_byte_optimized (u32 *buf, const int off_src, const int off_dst) { u8 *ptr = (u8 *) buf; @@ -1070,14 +1070,14 @@ DECLSPEC u32 rule_op_mangle_lrest (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const { u32 t; - t = buf0[0]; buf0[0] = t | generate_cmask (t); - t = buf0[1]; buf0[1] = t | generate_cmask (t); - t = buf0[2]; buf0[2] = t | generate_cmask (t); - t = buf0[3]; buf0[3] = t | generate_cmask (t); - t = buf1[0]; buf1[0] = t | generate_cmask (t); - t = buf1[1]; buf1[1] = t | generate_cmask (t); - t = buf1[2]; buf1[2] = t | generate_cmask (t); - t = buf1[3]; buf1[3] = t | generate_cmask (t); + t = buf0[0]; buf0[0] = t | generate_cmask_optimized (t); + t = buf0[1]; buf0[1] = t | generate_cmask_optimized (t); + t = buf0[2]; buf0[2] = t | generate_cmask_optimized (t); + t = buf0[3]; buf0[3] = t | generate_cmask_optimized (t); + t = buf1[0]; buf1[0] = t | generate_cmask_optimized (t); + t = buf1[1]; buf1[1] = t | generate_cmask_optimized (t); + t = buf1[2]; buf1[2] = t | generate_cmask_optimized (t); + t = buf1[3]; buf1[3] = t | generate_cmask_optimized (t); return in_len; } @@ -1086,14 +1086,14 @@ DECLSPEC u32 rule_op_mangle_urest (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const { u32 t; - t = buf0[0]; buf0[0] = t & ~(generate_cmask (t)); - t = buf0[1]; buf0[1] = t & ~(generate_cmask (t)); - t = buf0[2]; buf0[2] = t & ~(generate_cmask (t)); - t = buf0[3]; buf0[3] = t & ~(generate_cmask (t)); - t = buf1[0]; buf1[0] = t & ~(generate_cmask (t)); - t = buf1[1]; buf1[1] = t & ~(generate_cmask (t)); - t = buf1[2]; buf1[2] = t & ~(generate_cmask (t)); - t = buf1[3]; buf1[3] = t & ~(generate_cmask (t)); + t = buf0[0]; buf0[0] = t & ~(generate_cmask_optimized (t)); + t = buf0[1]; buf0[1] = t & ~(generate_cmask_optimized (t)); + t = buf0[2]; buf0[2] = t & ~(generate_cmask_optimized (t)); + t = buf0[3]; buf0[3] = t & ~(generate_cmask_optimized (t)); + t = buf1[0]; buf1[0] = t & ~(generate_cmask_optimized (t)); + t = buf1[1]; buf1[1] = t & ~(generate_cmask_optimized (t)); + t = buf1[2]; buf1[2] = t & ~(generate_cmask_optimized (t)); + t = buf1[3]; buf1[3] = t & ~(generate_cmask_optimized (t)); return in_len; } @@ -1102,16 +1102,16 @@ DECLSPEC u32 rule_op_mangle_lrest_ufirst (MAYBE_UNUSED const u32 p0, MAYBE_UNUSE { u32 t; - t = buf0[0]; buf0[0] = t | generate_cmask (t); - t = buf0[1]; buf0[1] = t | generate_cmask (t); - t = buf0[2]; buf0[2] = t | generate_cmask (t); - t = buf0[3]; buf0[3] = t | generate_cmask (t); - t = buf1[0]; buf1[0] = t | generate_cmask (t); - t = buf1[1]; buf1[1] = t | generate_cmask (t); - t = buf1[2]; buf1[2] = t | generate_cmask (t); - t = buf1[3]; buf1[3] = t | generate_cmask (t); + t = buf0[0]; buf0[0] = t | generate_cmask_optimized (t); + t = buf0[1]; buf0[1] = t | generate_cmask_optimized (t); + t = buf0[2]; buf0[2] = t | generate_cmask_optimized (t); + t = buf0[3]; buf0[3] = t | generate_cmask_optimized (t); + t = buf1[0]; buf1[0] = t | generate_cmask_optimized (t); + t = buf1[1]; buf1[1] = t | generate_cmask_optimized (t); + t = buf1[2]; buf1[2] = t | generate_cmask_optimized (t); + t = buf1[3]; buf1[3] = t | generate_cmask_optimized (t); - t = buf0[0]; buf0[0] = t & ~(0x00000020 & generate_cmask (t)); + t = buf0[0]; buf0[0] = t & ~(0x00000020 & generate_cmask_optimized (t)); return in_len; } @@ -1120,16 +1120,16 @@ DECLSPEC u32 rule_op_mangle_urest_lfirst (MAYBE_UNUSED const u32 p0, MAYBE_UNUSE { u32 t; - t = buf0[0]; buf0[0] = t & ~(generate_cmask (t)); - t = buf0[1]; buf0[1] = t & ~(generate_cmask (t)); - t = buf0[2]; buf0[2] = t & ~(generate_cmask (t)); - t = buf0[3]; buf0[3] = t & ~(generate_cmask (t)); - t = buf1[0]; buf1[0] = t & ~(generate_cmask (t)); - t = buf1[1]; buf1[1] = t & ~(generate_cmask (t)); - t = buf1[2]; buf1[2] = t & ~(generate_cmask (t)); - t = buf1[3]; buf1[3] = t & ~(generate_cmask (t)); + t = buf0[0]; buf0[0] = t & ~(generate_cmask_optimized (t)); + t = buf0[1]; buf0[1] = t & ~(generate_cmask_optimized (t)); + t = buf0[2]; buf0[2] = t & ~(generate_cmask_optimized (t)); + t = buf0[3]; buf0[3] = t & ~(generate_cmask_optimized (t)); + t = buf1[0]; buf1[0] = t & ~(generate_cmask_optimized (t)); + t = buf1[1]; buf1[1] = t & ~(generate_cmask_optimized (t)); + t = buf1[2]; buf1[2] = t & ~(generate_cmask_optimized (t)); + t = buf1[3]; buf1[3] = t & ~(generate_cmask_optimized (t)); - t = buf0[0]; buf0[0] = t | (0x00000020 & generate_cmask (t)); + t = buf0[0]; buf0[0] = t | (0x00000020 & generate_cmask_optimized (t)); return in_len; } @@ -1138,14 +1138,14 @@ DECLSPEC u32 rule_op_mangle_trest (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const { u32 t; - t = buf0[0]; buf0[0] = t ^ generate_cmask (t); - t = buf0[1]; buf0[1] = t ^ generate_cmask (t); - t = buf0[2]; buf0[2] = t ^ generate_cmask (t); - t = buf0[3]; buf0[3] = t ^ generate_cmask (t); - t = buf1[0]; buf1[0] = t ^ generate_cmask (t); - t = buf1[1]; buf1[1] = t ^ generate_cmask (t); - t = buf1[2]; buf1[2] = t ^ generate_cmask (t); - t = buf1[3]; buf1[3] = t ^ generate_cmask (t); + t = buf0[0]; buf0[0] = t ^ generate_cmask_optimized (t); + t = buf0[1]; buf0[1] = t ^ generate_cmask_optimized (t); + t = buf0[2]; buf0[2] = t ^ generate_cmask_optimized (t); + t = buf0[3]; buf0[3] = t ^ generate_cmask_optimized (t); + t = buf1[0]; buf1[0] = t ^ generate_cmask_optimized (t); + t = buf1[1]; buf1[1] = t ^ generate_cmask_optimized (t); + t = buf1[2]; buf1[2] = t ^ generate_cmask_optimized (t); + t = buf1[3]; buf1[3] = t ^ generate_cmask_optimized (t); return in_len; } @@ -1169,7 +1169,7 @@ DECLSPEC u32 rule_op_mangle_toggle_at (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED c const u32 m = 0x20u << ((p0 & 3) * 8); - t[p0 / 4] = tmp ^ (m & generate_cmask (tmp)); + t[p0 / 4] = tmp ^ (m & generate_cmask_optimized (tmp)); buf0[0] = t[0]; buf0[1] = t[1]; @@ -1185,7 +1185,7 @@ DECLSPEC u32 rule_op_mangle_toggle_at (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED c DECLSPEC 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); + reverse_block_optimized (buf0, buf1, buf0, buf1, in_len); return in_len; } @@ -1196,7 +1196,7 @@ DECLSPEC u32 rule_op_mangle_dupeword (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED co u32 out_len = in_len; - append_block8 (out_len, buf0, buf1, buf0, buf1, buf0, buf1); + append_block8_optimized (out_len, buf0, buf1, buf0, buf1, buf0, buf1); out_len += in_len; @@ -1223,7 +1223,7 @@ DECLSPEC u32 rule_op_mangle_dupeword_times (MAYBE_UNUSED const u32 p0, MAYBE_UNU for (u32 i = 0; i < p0; i++) { - append_block8 (out_len, buf0, buf1, buf0, buf1, tib40, tib41); + append_block8_optimized (out_len, buf0, buf1, buf0, buf1, tib40, tib41); out_len += in_len; } @@ -1240,9 +1240,9 @@ DECLSPEC u32 rule_op_mangle_reflect (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED con u32 tib40[4] = { 0 }; u32 tib41[4] = { 0 }; - reverse_block (buf0, buf1, tib40, tib41, out_len); + reverse_block_optimized (buf0, buf1, tib40, tib41, out_len); - append_block8 (out_len, buf0, buf1, buf0, buf1, tib40, tib41); + append_block8_optimized (out_len, buf0, buf1, buf0, buf1, tib40, tib41); out_len += in_len; @@ -1255,7 +1255,7 @@ DECLSPEC u32 rule_op_mangle_append (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED cons u32 out_len = in_len; - append_block1 (out_len, buf0, buf1, p0); + append_block1_optimized (out_len, buf0, buf1, p0); out_len++; @@ -1268,7 +1268,7 @@ DECLSPEC u32 rule_op_mangle_prepend (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED con u32 out_len = in_len; - rshift_block (buf0, buf1, buf0, buf1); + rshift_block_optimized (buf0, buf1, buf0, buf1); buf0[0] = buf0[0] | p0; @@ -1285,9 +1285,9 @@ DECLSPEC u32 rule_op_mangle_rotate_left (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 tmp = buf0[0]; - lshift_block (buf0, buf1, buf0, buf1); + lshift_block_optimized (buf0, buf1, buf0, buf1); - append_block1 (in_len1, buf0, buf1, tmp); + append_block1_optimized (in_len1, buf0, buf1, tmp); return in_len; } @@ -1325,11 +1325,11 @@ DECLSPEC u32 rule_op_mangle_rotate_right (MAYBE_UNUSED const u32 p0, MAYBE_UNUSE tmp = (tmp >> sh) & 0xff; - rshift_block (buf0, buf1, buf0, buf1); + rshift_block_optimized (buf0, buf1, buf0, buf1); buf0[0] |= tmp; - truncate_right (buf0, buf1, in_len); + truncate_right_optimized (buf0, buf1, in_len); return in_len; } @@ -1340,7 +1340,7 @@ DECLSPEC u32 rule_op_mangle_delete_first (MAYBE_UNUSED const u32 p0, MAYBE_UNUSE const u32 in_len1 = in_len - 1; - lshift_block (buf0, buf1, buf0, buf1); + lshift_block_optimized (buf0, buf1, buf0, buf1); return in_len1; } @@ -1374,7 +1374,7 @@ DECLSPEC u32 rule_op_mangle_delete_at (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED c u32 tib40[4]; u32 tib41[4]; - lshift_block (buf0, buf1, tib40, tib41); + lshift_block_optimized (buf0, buf1, tib40, tib41); const u32 ml = (1 << ((p0 & 3) * 8)) - 1; const u32 mr = ~ml; @@ -1454,9 +1454,9 @@ DECLSPEC u32 rule_op_mangle_extract (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED con u32 out_len = p1; - lshift_block_N (buf0, buf1, buf0, buf1, p0); + lshift_block_optimized_N (buf0, buf1, buf0, buf1, p0); - truncate_right (buf0, buf1, out_len); + truncate_right_optimized (buf0, buf1, out_len); return out_len; } @@ -1481,7 +1481,7 @@ DECLSPEC u32 rule_op_mangle_omit (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const tib41[2] = 0; tib41[3] = 0; - lshift_block_N (buf0, buf1, tib40, tib41, p1); + lshift_block_optimized_N (buf0, buf1, tib40, tib41, p1); const u32 ml = (1 << ((p0 & 3) * 8)) - 1; const u32 mr = ~ml; @@ -1564,7 +1564,7 @@ DECLSPEC u32 rule_op_mangle_insert (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED cons u32 tib40[4]; u32 tib41[4]; - rshift_block (buf0, buf1, tib40, tib41); + rshift_block_optimized (buf0, buf1, tib40, tib41); const u32 p1n = p1 << ((p0 & 3) * 8); @@ -1670,7 +1670,7 @@ DECLSPEC u32 rule_op_mangle_truncate_at (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED { if (p0 >= in_len) return in_len; - truncate_right (buf0, buf1, p0); + truncate_right_optimized (buf0, buf1, p0); return p0; } @@ -1794,12 +1794,12 @@ DECLSPEC u32 rule_op_mangle_dupechar_first (MAYBE_UNUSED const u32 p0, MAYBE_UNU | tmp << 16 | tmp << 24; - rshift_block_N (buf0, buf1, buf0, buf1, p0); + rshift_block_optimized_N (buf0, buf1, buf0, buf1, p0); u32 t0[4] = { tmp32, tmp32, tmp32, tmp32 }; u32 t1[4] = { tmp32, tmp32, tmp32, tmp32 }; - truncate_right (t0, t1, p0); + truncate_right_optimized (t0, t1, p0); buf0[0] |= t0[0]; buf0[1] |= t0[1]; @@ -1853,7 +1853,7 @@ DECLSPEC u32 rule_op_mangle_dupechar_last (MAYBE_UNUSED const u32 p0, MAYBE_UNUS for (u32 i = 0; i < p0; i++) { - append_block1 (out_len, buf0, buf1, tmp); + append_block1_optimized (out_len, buf0, buf1, tmp); out_len++; } @@ -1918,7 +1918,7 @@ DECLSPEC u32 rule_op_mangle_switch_last (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED t[6] = buf1[2]; t[7] = buf1[3]; - exchange_byte (t, in_len - 2, in_len - 1); + exchange_byte_optimized (t, in_len - 2, in_len - 1); buf0[0] = t[0]; buf0[1] = t[1]; @@ -1948,7 +1948,7 @@ DECLSPEC u32 rule_op_mangle_switch_at (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED c t[6] = buf1[2]; t[7] = buf1[3]; - exchange_byte (t, p0, p1); + exchange_byte_optimized (t, p0, p1); buf0[0] = t[0]; buf0[1] = t[1]; @@ -2108,7 +2108,7 @@ DECLSPEC u32 rule_op_mangle_replace_np1 (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED u32 tib4x[8]; - lshift_block (buf0, buf1, tib4x + 0, tib4x + 4); + lshift_block_optimized (buf0, buf1, tib4x + 0, tib4x + 4); const u32 mr = 0xffu << ((p0 & 3) * 8); const u32 ml = ~mr; @@ -2150,7 +2150,7 @@ DECLSPEC u32 rule_op_mangle_replace_nm1 (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED u32 tib4x[8]; - rshift_block (buf0, buf1, tib4x + 0, tib4x + 4); + rshift_block_optimized (buf0, buf1, tib4x + 0, tib4x + 4); const u32 mr = 0xffu << ((p0 & 3) * 8); const u32 ml = ~mr; @@ -2204,9 +2204,9 @@ DECLSPEC u32 rule_op_mangle_dupeblock_first (MAYBE_UNUSED const u32 p0, MAYBE_UN tib41[2] = buf1[2]; tib41[3] = buf1[3]; - truncate_right (tib40, tib41, p0); + truncate_right_optimized (tib40, tib41, p0); - rshift_block_N (buf0, buf1, buf0, buf1, p0); + rshift_block_optimized_N (buf0, buf1, buf0, buf1, p0); buf0[0] |= tib40[0]; buf0[1] |= tib40[1]; @@ -2233,9 +2233,9 @@ DECLSPEC u32 rule_op_mangle_dupeblock_last (MAYBE_UNUSED const u32 p0, MAYBE_UNU u32 tib40[4]; u32 tib41[4]; - rshift_block_N (buf0, buf1, tib40, tib41, p0); + rshift_block_optimized_N (buf0, buf1, tib40, tib41, p0); - truncate_left (tib40, tib41, out_len); + truncate_left_optimized (tib40, tib41, out_len); buf0[0] |= tib40[0]; buf0[1] |= tib40[1]; @@ -2255,7 +2255,7 @@ DECLSPEC u32 toggle_on_register (const u32 in, const u32 r) { u32 out = in; - const u32 cmask = generate_cmask (out); + const u32 cmask = generate_cmask_optimized (out); if (r & 1) out = out ^ (0x00000020 & cmask); if (r & 2) out = out ^ (0x00002000 & cmask); @@ -2305,7 +2305,7 @@ DECLSPEC u32 rule_op_mangle_title_sep (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED c return in_len; } -DECLSPEC u32 apply_rule (const u32 name, const u32 p0, const u32 p1, u32 *buf0, u32 *buf1, const u32 in_len) +DECLSPEC u32 apply_rule_optimized (const u32 name, const u32 p0, const u32 p1, u32 *buf0, u32 *buf1, const u32 in_len) { u32 out_len = in_len; @@ -2357,7 +2357,7 @@ DECLSPEC u32 apply_rule (const u32 name, const u32 p0, const u32 p1, u32 *buf0, return out_len; } -DECLSPEC u32 apply_rules (CONSTANT_AS const u32 *cmds, u32 *buf0, u32 *buf1, const u32 len) +DECLSPEC u32 apply_rules_optimized (CONSTANT_AS u32 *cmds, u32 *buf0, u32 *buf1, const u32 len) { u32 out_len = len; @@ -2369,13 +2369,13 @@ DECLSPEC u32 apply_rules (CONSTANT_AS const u32 *cmds, u32 *buf0, u32 *buf1, con const u32 p0 = (cmd >> 8) & 0xff; const u32 p1 = (cmd >> 16) & 0xff; - out_len = apply_rule (name, p0, p1, buf0, buf1, out_len); + out_len = apply_rule_optimized (name, p0, p1, buf0, buf1, out_len); } return out_len; } -DECLSPEC u32x apply_rules_vect (const u32 *pw_buf0, const u32 *pw_buf1, const u32 pw_len, CONSTANT_AS const kernel_rule_t *rules_buf, const u32 il_pos, u32x *buf0, u32x *buf1) +DECLSPEC u32x apply_rules_vect_optimized (const u32 *pw_buf0, const u32 *pw_buf1, const u32 pw_len, CONSTANT_AS kernel_rule_t *rules_buf, const u32 il_pos, u32x *buf0, u32x *buf1) { #if VECT_SIZE == 1 @@ -2388,7 +2388,7 @@ DECLSPEC u32x apply_rules_vect (const u32 *pw_buf0, const u32 *pw_buf1, const u3 buf1[2] = pw_buf1[2]; buf1[3] = pw_buf1[3]; - return apply_rules (rules_buf[il_pos].cmds, buf0, buf1, pw_len); + return apply_rules_optimized (rules_buf[il_pos].cmds, buf0, buf1, pw_len); #else @@ -2411,7 +2411,7 @@ DECLSPEC u32x apply_rules_vect (const u32 *pw_buf0, const u32 *pw_buf1, const u3 tmp1[2] = pw_buf1[2]; tmp1[3] = pw_buf1[3]; - const u32 tmp_len = apply_rules (rules_buf[il_pos + i].cmds, tmp0, tmp1, pw_len); + const u32 tmp_len = apply_rules_optimized (rules_buf[il_pos + i].cmds, tmp0, tmp1, pw_len); switch (i) { diff --git a/OpenCL/inc_rp_optimized.h b/OpenCL/inc_rp_optimized.h index 447de254f..eb3c6ec84 100644 --- a/OpenCL/inc_rp_optimized.h +++ b/OpenCL/inc_rp_optimized.h @@ -64,17 +64,17 @@ #define RULE_OP_MANGLE_DUPEBLOCK_LAST 'Y' #define RULE_OP_MANGLE_TITLE 'E' -DECLSPEC u32 generate_cmask (const u32 value); -DECLSPEC void truncate_right (u32 *buf0, u32 *buf1, const u32 offset); -DECLSPEC void truncate_left (u32 *buf0, u32 *buf1, const u32 offset); -DECLSPEC void lshift_block (const u32 *in0, const u32 *in1, u32 *out0, u32 *out1); -DECLSPEC void rshift_block (const u32 *in0, const u32 *in1, u32 *out0, u32 *out1); -DECLSPEC void lshift_block_N (const u32 *in0, const u32 *in1, u32 *out0, u32 *out1, const u32 num); -DECLSPEC void rshift_block_N (const u32 *in0, const u32 *in1, u32 *out0, u32 *out1, const u32 num); -DECLSPEC void append_block1 (const u32 offset, u32 *buf0, u32 *buf1, const u32 src_r0); -DECLSPEC 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); -DECLSPEC void reverse_block (u32 *in0, u32 *in1, u32 *out0, u32 *out1, const u32 len); -DECLSPEC void exchange_byte (u32 *buf, const int off_src, const int off_dst); +DECLSPEC u32 generate_cmask_optimized (const u32 value); +DECLSPEC void truncate_right_optimized (u32 *buf0, u32 *buf1, const u32 offset); +DECLSPEC void truncate_left_optimized (u32 *buf0, u32 *buf1, const u32 offset); +DECLSPEC void lshift_block_optimized (const u32 *in0, const u32 *in1, u32 *out0, u32 *out1); +DECLSPEC void rshift_block_optimized (const u32 *in0, const u32 *in1, u32 *out0, u32 *out1); +DECLSPEC void lshift_block_optimized_N (const u32 *in0, const u32 *in1, u32 *out0, u32 *out1, const u32 num); +DECLSPEC void rshift_block_optimized_N (const u32 *in0, const u32 *in1, u32 *out0, u32 *out1, const u32 num); +DECLSPEC void append_block1_optimized (const u32 offset, u32 *buf0, u32 *buf1, const u32 src_r0); +DECLSPEC void append_block8_optimized (const u32 offset, u32 *buf0, u32 *buf1, const u32 *src_l0, const u32 *src_l1, const u32 *src_r0, const u32 *src_r1); +DECLSPEC void reverse_block_optimized (u32 *in0, u32 *in1, u32 *out0, u32 *out1, const u32 len); +DECLSPEC void exchange_byte_optimized (u32 *buf, const int off_src, const int off_dst); DECLSPEC 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); DECLSPEC 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); DECLSPEC 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); @@ -117,8 +117,8 @@ DECLSPEC u32 rule_op_mangle_dupeblock_first (MAYBE_UNUSED const u32 p0, MAYBE_UN DECLSPEC 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); DECLSPEC u32 toggle_on_register (const u32 in, const u32 r); DECLSPEC 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); -DECLSPEC u32 apply_rule (const u32 name, const u32 p0, const u32 p1, u32 *buf0, u32 *buf1, const u32 in_len); -DECLSPEC u32 apply_rules (CONSTANT_AS const u32 *cmds, u32 *buf0, u32 *buf1, const u32 len); -DECLSPEC u32x apply_rules_vect (const u32 *pw_buf0, const u32 *pw_buf1, const u32 pw_len, CONSTANT_AS const kernel_rule_t *rules_buf, const u32 il_pos, u32x *buf0, u32x *buf1); +DECLSPEC u32 apply_rule_optimized (const u32 name, const u32 p0, const u32 p1, u32 *buf0, u32 *buf1, const u32 in_len); +DECLSPEC u32 apply_rules_optimized (CONSTANT_AS u32 *cmds, u32 *buf0, u32 *buf1, const u32 len); +DECLSPEC u32x apply_rules_vect_optimized (const u32 *pw_buf0, const u32 *pw_buf1, const u32 pw_len, CONSTANT_AS kernel_rule_t *rules_buf, const u32 il_pos, u32x *buf0, u32x *buf1); #endif // _INC_RP_OPTIMIZED_H diff --git a/OpenCL/inc_truecrypt_crc32.h b/OpenCL/inc_truecrypt_crc32.h index e183391aa..a21029e39 100644 --- a/OpenCL/inc_truecrypt_crc32.h +++ b/OpenCL/inc_truecrypt_crc32.h @@ -6,7 +6,7 @@ #ifndef _INC_TRUECRYPT_CRC32_H #define _INC_TRUECRYPT_CRC32_H -CONSTANT_AS u32a crc32tab[0x100] = +CONSTANT_AS CONSTSPEC u32a crc32tab[0x100] = { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, diff --git a/OpenCL/inc_vendor.h b/OpenCL/inc_vendor.h index e8e82afab..ddbdd1c60 100644 --- a/OpenCL/inc_vendor.h +++ b/OpenCL/inc_vendor.h @@ -7,11 +7,13 @@ #define _INC_VENDOR_H #ifdef _CPU_OPENCL_EMU_H +#define CONSTSPEC static const #define CONSTANT_AS #define GLOBAL_AS #define LOCAL_AS #define KERNEL_FQ #else +#define CONSTSPEC const #define CONSTANT_AS __constant #define GLOBAL_AS __global #define LOCAL_AS __local diff --git a/OpenCL/m00000_a0-optimized.cl b/OpenCL/m00000_a0-optimized.cl index 42bf33228..c7c4fec28 100644 --- a/OpenCL/m00000_a0-optimized.cl +++ b/OpenCL/m00000_a0-optimized.cl @@ -56,7 +56,7 @@ KERNEL_FQ void m00000_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -203,7 +203,7 @@ KERNEL_FQ void m00000_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m00010_a0-optimized.cl b/OpenCL/m00010_a0-optimized.cl index 9596a4f2f..7859648fb 100644 --- a/OpenCL/m00010_a0-optimized.cl +++ b/OpenCL/m00010_a0-optimized.cl @@ -84,7 +84,7 @@ KERNEL_FQ void m00010_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * append salt @@ -305,7 +305,7 @@ KERNEL_FQ void m00010_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * append salt diff --git a/OpenCL/m00020_a0-optimized.cl b/OpenCL/m00020_a0-optimized.cl index 924489454..9e1445335 100644 --- a/OpenCL/m00020_a0-optimized.cl +++ b/OpenCL/m00020_a0-optimized.cl @@ -84,7 +84,7 @@ KERNEL_FQ void m00020_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * prepend salt @@ -285,7 +285,7 @@ KERNEL_FQ void m00020_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * prepend salt diff --git a/OpenCL/m00030_a0-optimized.cl b/OpenCL/m00030_a0-optimized.cl index 61ba25007..7b9cd9516 100644 --- a/OpenCL/m00030_a0-optimized.cl +++ b/OpenCL/m00030_a0-optimized.cl @@ -84,7 +84,7 @@ KERNEL_FQ void m00030_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); make_utf16le (w1, w2, w3); make_utf16le (w0, w0, w1); @@ -310,7 +310,7 @@ KERNEL_FQ void m00030_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); make_utf16le (w1, w2, w3); make_utf16le (w0, w0, w1); diff --git a/OpenCL/m00040_a0-optimized.cl b/OpenCL/m00040_a0-optimized.cl index a6c8b9bda..87a03f7de 100644 --- a/OpenCL/m00040_a0-optimized.cl +++ b/OpenCL/m00040_a0-optimized.cl @@ -84,7 +84,7 @@ KERNEL_FQ void m00040_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); make_utf16le (w1, w2, w3); make_utf16le (w0, w0, w1); @@ -290,7 +290,7 @@ KERNEL_FQ void m00040_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); make_utf16le (w1, w2, w3); make_utf16le (w0, w0, w1); diff --git a/OpenCL/m00050_a0-optimized.cl b/OpenCL/m00050_a0-optimized.cl index 39b8609dd..944006caa 100644 --- a/OpenCL/m00050_a0-optimized.cl +++ b/OpenCL/m00050_a0-optimized.cl @@ -169,7 +169,7 @@ KERNEL_FQ void m00050_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * pads @@ -294,7 +294,7 @@ KERNEL_FQ void m00050_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * pads diff --git a/OpenCL/m00060_a0-optimized.cl b/OpenCL/m00060_a0-optimized.cl index b229735cf..312dd9411 100644 --- a/OpenCL/m00060_a0-optimized.cl +++ b/OpenCL/m00060_a0-optimized.cl @@ -200,7 +200,7 @@ KERNEL_FQ void m00060_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -349,7 +349,7 @@ KERNEL_FQ void m00060_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m00100_a0-optimized.cl b/OpenCL/m00100_a0-optimized.cl index d50f0b29d..1f91fc49a 100644 --- a/OpenCL/m00100_a0-optimized.cl +++ b/OpenCL/m00100_a0-optimized.cl @@ -56,7 +56,7 @@ KERNEL_FQ void m00100_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -254,7 +254,7 @@ KERNEL_FQ void m00100_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m00110_a0-optimized.cl b/OpenCL/m00110_a0-optimized.cl index 5fdb13d2e..475409428 100644 --- a/OpenCL/m00110_a0-optimized.cl +++ b/OpenCL/m00110_a0-optimized.cl @@ -84,7 +84,7 @@ KERNEL_FQ void m00110_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * append salt @@ -355,7 +355,7 @@ KERNEL_FQ void m00110_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * append salt diff --git a/OpenCL/m00120_a0-optimized.cl b/OpenCL/m00120_a0-optimized.cl index 18405a74b..75527d42f 100644 --- a/OpenCL/m00120_a0-optimized.cl +++ b/OpenCL/m00120_a0-optimized.cl @@ -96,7 +96,7 @@ KERNEL_FQ void m00120_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * prepend salt @@ -347,7 +347,7 @@ KERNEL_FQ void m00120_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * prepend salt diff --git a/OpenCL/m00130_a0-optimized.cl b/OpenCL/m00130_a0-optimized.cl index c900b62b9..becbbbc52 100644 --- a/OpenCL/m00130_a0-optimized.cl +++ b/OpenCL/m00130_a0-optimized.cl @@ -84,7 +84,7 @@ KERNEL_FQ void m00130_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); make_utf16le (w1, w2, w3); make_utf16le (w0, w0, w1); @@ -360,7 +360,7 @@ KERNEL_FQ void m00130_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); make_utf16le (w1, w2, w3); make_utf16le (w0, w0, w1); diff --git a/OpenCL/m00140_a0-optimized.cl b/OpenCL/m00140_a0-optimized.cl index 2abb4506c..32eeea008 100644 --- a/OpenCL/m00140_a0-optimized.cl +++ b/OpenCL/m00140_a0-optimized.cl @@ -84,7 +84,7 @@ KERNEL_FQ void m00140_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); make_utf16le (w1, w2, w3); make_utf16le (w0, w0, w1); @@ -340,7 +340,7 @@ KERNEL_FQ void m00140_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); make_utf16le (w1, w2, w3); make_utf16le (w0, w0, w1); diff --git a/OpenCL/m00150_a0-optimized.cl b/OpenCL/m00150_a0-optimized.cl index 9149fadfd..65e8267bd 100644 --- a/OpenCL/m00150_a0-optimized.cl +++ b/OpenCL/m00150_a0-optimized.cl @@ -173,7 +173,7 @@ KERNEL_FQ void m00150_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); w0[0] = hc_swap32 (w0[0]); w0[1] = hc_swap32 (w0[1]); @@ -307,7 +307,7 @@ KERNEL_FQ void m00150_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); w0[0] = hc_swap32 (w0[0]); w0[1] = hc_swap32 (w0[1]); diff --git a/OpenCL/m00160_a0-optimized.cl b/OpenCL/m00160_a0-optimized.cl index 802351e70..28b3cc692 100644 --- a/OpenCL/m00160_a0-optimized.cl +++ b/OpenCL/m00160_a0-optimized.cl @@ -204,7 +204,7 @@ KERNEL_FQ void m00160_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -353,7 +353,7 @@ KERNEL_FQ void m00160_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m00200_a0-optimized.cl b/OpenCL/m00200_a0-optimized.cl index 3b431d867..88144ff0a 100644 --- a/OpenCL/m00200_a0-optimized.cl +++ b/OpenCL/m00200_a0-optimized.cl @@ -56,7 +56,7 @@ KERNEL_FQ void m00200_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); u32x w_t[16]; @@ -194,7 +194,7 @@ KERNEL_FQ void m00200_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); u32x w_t[16]; diff --git a/OpenCL/m00300_a0-optimized.cl b/OpenCL/m00300_a0-optimized.cl index 20fa851c5..df387712d 100644 --- a/OpenCL/m00300_a0-optimized.cl +++ b/OpenCL/m00300_a0-optimized.cl @@ -56,7 +56,7 @@ KERNEL_FQ void m00300_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -379,7 +379,7 @@ KERNEL_FQ void m00300_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m00900_a0-optimized.cl b/OpenCL/m00900_a0-optimized.cl index cf2760c41..d7019c463 100644 --- a/OpenCL/m00900_a0-optimized.cl +++ b/OpenCL/m00900_a0-optimized.cl @@ -56,7 +56,7 @@ KERNEL_FQ void m00900_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -184,7 +184,7 @@ KERNEL_FQ void m00900_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m01000_a0-optimized.cl b/OpenCL/m01000_a0-optimized.cl index 71d80fdd0..70127a82a 100644 --- a/OpenCL/m01000_a0-optimized.cl +++ b/OpenCL/m01000_a0-optimized.cl @@ -56,7 +56,7 @@ KERNEL_FQ void m01000_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -187,7 +187,7 @@ KERNEL_FQ void m01000_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m01100_a0-optimized.cl b/OpenCL/m01100_a0-optimized.cl index 36acfd128..bd0b99fe9 100644 --- a/OpenCL/m01100_a0-optimized.cl +++ b/OpenCL/m01100_a0-optimized.cl @@ -78,7 +78,7 @@ KERNEL_FQ void m01100_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -309,7 +309,7 @@ KERNEL_FQ void m01100_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m01300_a0-optimized.cl b/OpenCL/m01300_a0-optimized.cl index c2fc85119..9b19415d1 100644 --- a/OpenCL/m01300_a0-optimized.cl +++ b/OpenCL/m01300_a0-optimized.cl @@ -69,7 +69,7 @@ KERNEL_FQ void m01300_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -252,7 +252,7 @@ KERNEL_FQ void m01300_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m01400_a0-optimized.cl b/OpenCL/m01400_a0-optimized.cl index 76ea26377..047b4765f 100644 --- a/OpenCL/m01400_a0-optimized.cl +++ b/OpenCL/m01400_a0-optimized.cl @@ -70,7 +70,7 @@ KERNEL_FQ void m01400_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -255,7 +255,7 @@ KERNEL_FQ void m01400_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m01410_a0-optimized.cl b/OpenCL/m01410_a0-optimized.cl index 99f40e6f9..6fae8211a 100644 --- a/OpenCL/m01410_a0-optimized.cl +++ b/OpenCL/m01410_a0-optimized.cl @@ -98,7 +98,7 @@ KERNEL_FQ void m01410_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * append salt @@ -356,7 +356,7 @@ KERNEL_FQ void m01410_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * append salt diff --git a/OpenCL/m01420_a0-optimized.cl b/OpenCL/m01420_a0-optimized.cl index b2e5d5407..154263591 100644 --- a/OpenCL/m01420_a0-optimized.cl +++ b/OpenCL/m01420_a0-optimized.cl @@ -98,7 +98,7 @@ KERNEL_FQ void m01420_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * prepend salt @@ -336,7 +336,7 @@ KERNEL_FQ void m01420_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * prepend salt diff --git a/OpenCL/m01430_a0-optimized.cl b/OpenCL/m01430_a0-optimized.cl index 43b8af917..0839a7e9e 100644 --- a/OpenCL/m01430_a0-optimized.cl +++ b/OpenCL/m01430_a0-optimized.cl @@ -98,7 +98,7 @@ KERNEL_FQ void m01430_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); make_utf16le (w1, w2, w3); make_utf16le (w0, w0, w1); @@ -361,7 +361,7 @@ KERNEL_FQ void m01430_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); make_utf16le (w1, w2, w3); make_utf16le (w0, w0, w1); diff --git a/OpenCL/m01440_a0-optimized.cl b/OpenCL/m01440_a0-optimized.cl index 6dffed7b4..33383622b 100644 --- a/OpenCL/m01440_a0-optimized.cl +++ b/OpenCL/m01440_a0-optimized.cl @@ -98,7 +98,7 @@ KERNEL_FQ void m01440_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); make_utf16le (w1, w2, w3); make_utf16le (w0, w0, w1); @@ -341,7 +341,7 @@ KERNEL_FQ void m01440_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); make_utf16le (w1, w2, w3); make_utf16le (w0, w0, w1); diff --git a/OpenCL/m01450_a0-optimized.cl b/OpenCL/m01450_a0-optimized.cl index d8b3ac0d2..fb0a46c6d 100644 --- a/OpenCL/m01450_a0-optimized.cl +++ b/OpenCL/m01450_a0-optimized.cl @@ -185,7 +185,7 @@ KERNEL_FQ void m01450_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); w0[0] = hc_swap32 (w0[0]); w0[1] = hc_swap32 (w0[1]); @@ -319,7 +319,7 @@ KERNEL_FQ void m01450_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); w0[0] = hc_swap32 (w0[0]); w0[1] = hc_swap32 (w0[1]); diff --git a/OpenCL/m01460_a0-optimized.cl b/OpenCL/m01460_a0-optimized.cl index dde105f71..9afe5e2b3 100644 --- a/OpenCL/m01460_a0-optimized.cl +++ b/OpenCL/m01460_a0-optimized.cl @@ -216,7 +216,7 @@ KERNEL_FQ void m01460_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -365,7 +365,7 @@ KERNEL_FQ void m01460_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m01500_a0-pure.cl b/OpenCL/m01500_a0-pure.cl index f3a4d5913..de7fdcc75 100644 --- a/OpenCL/m01500_a0-pure.cl +++ b/OpenCL/m01500_a0-pure.cl @@ -34,7 +34,7 @@ a = a ^ tt; \ } -CONSTANT_AS u32a c_SPtrans[8][64] = +CONSTANT_AS CONSTSPEC u32a c_SPtrans[8][64] = { { 0x00820200, 0x00020000, 0x80800000, 0x80820200, @@ -182,7 +182,7 @@ CONSTANT_AS u32a c_SPtrans[8][64] = }, }; -CONSTANT_AS u32a c_skb[8][64] = +CONSTANT_AS CONSTSPEC u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m01500_a1-pure.cl b/OpenCL/m01500_a1-pure.cl index 88a06b749..8299e8c23 100644 --- a/OpenCL/m01500_a1-pure.cl +++ b/OpenCL/m01500_a1-pure.cl @@ -32,7 +32,7 @@ a = a ^ tt; \ } -CONSTANT_AS u32a c_SPtrans[8][64] = +CONSTANT_AS CONSTSPEC u32a c_SPtrans[8][64] = { { 0x00820200, 0x00020000, 0x80800000, 0x80820200, @@ -180,7 +180,7 @@ CONSTANT_AS u32a c_SPtrans[8][64] = }, }; -CONSTANT_AS u32a c_skb[8][64] = +CONSTANT_AS CONSTSPEC u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m01500_a3-pure.cl b/OpenCL/m01500_a3-pure.cl index 9d5de4622..ce3cebf22 100644 --- a/OpenCL/m01500_a3-pure.cl +++ b/OpenCL/m01500_a3-pure.cl @@ -1885,7 +1885,7 @@ DECLSPEC void transpose32c (u32 *data) // transpose bitslice mod : attention race conditions, need different buffers for *in and *out // -KERNEL_FQ void m01500_tm (GLOBAL_AS u32 * restrict mod, GLOBAL_AS bs_word_t * restrict words_buf_r) +KERNEL_FQ void m01500_tm (GLOBAL_AS u32 *mod, GLOBAL_AS bs_word_t *words_buf_r) { const u64 gid = get_global_id (0); diff --git a/OpenCL/m01700_a0-optimized.cl b/OpenCL/m01700_a0-optimized.cl index 33690fcd1..695c97f08 100644 --- a/OpenCL/m01700_a0-optimized.cl +++ b/OpenCL/m01700_a0-optimized.cl @@ -155,7 +155,7 @@ KERNEL_FQ void m01700_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -268,7 +268,7 @@ KERNEL_FQ void m01700_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m01710_a0-optimized.cl b/OpenCL/m01710_a0-optimized.cl index 36f1391d2..8bc710215 100644 --- a/OpenCL/m01710_a0-optimized.cl +++ b/OpenCL/m01710_a0-optimized.cl @@ -183,7 +183,7 @@ KERNEL_FQ void m01710_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * append salt @@ -369,7 +369,7 @@ KERNEL_FQ void m01710_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * append salt diff --git a/OpenCL/m01720_a0-optimized.cl b/OpenCL/m01720_a0-optimized.cl index c16fa2b02..d2b6624a2 100644 --- a/OpenCL/m01720_a0-optimized.cl +++ b/OpenCL/m01720_a0-optimized.cl @@ -183,7 +183,7 @@ KERNEL_FQ void m01720_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * prepend salt @@ -349,7 +349,7 @@ KERNEL_FQ void m01720_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * prepend salt diff --git a/OpenCL/m01730_a0-optimized.cl b/OpenCL/m01730_a0-optimized.cl index 0ce9b9681..990dc6712 100644 --- a/OpenCL/m01730_a0-optimized.cl +++ b/OpenCL/m01730_a0-optimized.cl @@ -183,7 +183,7 @@ KERNEL_FQ void m01730_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); make_utf16le (w1, w2, w3); make_utf16le (w0, w0, w1); @@ -374,7 +374,7 @@ KERNEL_FQ void m01730_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); make_utf16le (w1, w2, w3); make_utf16le (w0, w0, w1); diff --git a/OpenCL/m01740_a0-optimized.cl b/OpenCL/m01740_a0-optimized.cl index e5e64677d..4e046b948 100644 --- a/OpenCL/m01740_a0-optimized.cl +++ b/OpenCL/m01740_a0-optimized.cl @@ -183,7 +183,7 @@ KERNEL_FQ void m01740_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); make_utf16le (w1, w2, w3); make_utf16le (w0, w0, w1); @@ -354,7 +354,7 @@ KERNEL_FQ void m01740_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); make_utf16le (w1, w2, w3); make_utf16le (w0, w0, w1); diff --git a/OpenCL/m01750_a0-optimized.cl b/OpenCL/m01750_a0-optimized.cl index deab316cc..b8cdee6e8 100644 --- a/OpenCL/m01750_a0-optimized.cl +++ b/OpenCL/m01750_a0-optimized.cl @@ -259,7 +259,7 @@ KERNEL_FQ void m01750_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); w0[0] = hc_swap32 (w0[0]); w0[1] = hc_swap32 (w0[1]); @@ -398,7 +398,7 @@ KERNEL_FQ void m01750_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); w0[0] = hc_swap32 (w0[0]); w0[1] = hc_swap32 (w0[1]); diff --git a/OpenCL/m01760_a0-optimized.cl b/OpenCL/m01760_a0-optimized.cl index 2eb4b9569..435210e64 100644 --- a/OpenCL/m01760_a0-optimized.cl +++ b/OpenCL/m01760_a0-optimized.cl @@ -290,7 +290,7 @@ KERNEL_FQ void m01760_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -444,7 +444,7 @@ KERNEL_FQ void m01760_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m02400_a0-optimized.cl b/OpenCL/m02400_a0-optimized.cl index 662659944..471e7ada1 100644 --- a/OpenCL/m02400_a0-optimized.cl +++ b/OpenCL/m02400_a0-optimized.cl @@ -56,7 +56,7 @@ KERNEL_FQ void m02400_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); if (out_len <= 16) { @@ -237,7 +237,7 @@ KERNEL_FQ void m02400_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); if (out_len <= 16) { diff --git a/OpenCL/m02410_a0-optimized.cl b/OpenCL/m02410_a0-optimized.cl index 18dc15094..e5f277680 100644 --- a/OpenCL/m02410_a0-optimized.cl +++ b/OpenCL/m02410_a0-optimized.cl @@ -84,7 +84,7 @@ KERNEL_FQ void m02410_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * append salt @@ -344,7 +344,7 @@ KERNEL_FQ void m02410_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * append salt diff --git a/OpenCL/m02610_a0-optimized.cl b/OpenCL/m02610_a0-optimized.cl index e99da7a5f..df8899488 100644 --- a/OpenCL/m02610_a0-optimized.cl +++ b/OpenCL/m02610_a0-optimized.cl @@ -113,7 +113,7 @@ KERNEL_FQ void m02610_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -409,7 +409,7 @@ KERNEL_FQ void m02610_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m02710_a0-optimized.cl b/OpenCL/m02710_a0-optimized.cl index 914d1ae9b..cfe83ae2d 100644 --- a/OpenCL/m02710_a0-optimized.cl +++ b/OpenCL/m02710_a0-optimized.cl @@ -113,7 +113,7 @@ KERNEL_FQ void m02710_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -494,7 +494,7 @@ KERNEL_FQ void m02710_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m02810_a0-optimized.cl b/OpenCL/m02810_a0-optimized.cl index 0a224edc5..dfd045591 100644 --- a/OpenCL/m02810_a0-optimized.cl +++ b/OpenCL/m02810_a0-optimized.cl @@ -113,7 +113,7 @@ KERNEL_FQ void m02810_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -495,7 +495,7 @@ KERNEL_FQ void m02810_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m03000_a0-pure.cl b/OpenCL/m03000_a0-pure.cl index 531d294e9..ba86c9893 100644 --- a/OpenCL/m03000_a0-pure.cl +++ b/OpenCL/m03000_a0-pure.cl @@ -34,7 +34,7 @@ a = a ^ tt; \ } -CONSTANT_AS u32a c_SPtrans[8][64] = +CONSTANT_AS CONSTSPEC u32a c_SPtrans[8][64] = { { 0x02080800, 0x00080000, 0x02000002, 0x02080802, @@ -182,7 +182,7 @@ CONSTANT_AS u32a c_SPtrans[8][64] = } }; -CONSTANT_AS u32a c_skb[8][64] = +CONSTANT_AS CONSTSPEC u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m03000_a1-pure.cl b/OpenCL/m03000_a1-pure.cl index 0e00a37ef..149be2b28 100644 --- a/OpenCL/m03000_a1-pure.cl +++ b/OpenCL/m03000_a1-pure.cl @@ -32,7 +32,7 @@ a = a ^ tt; \ } -CONSTANT_AS u32a c_SPtrans[8][64] = +CONSTANT_AS CONSTSPEC u32a c_SPtrans[8][64] = { { 0x02080800, 0x00080000, 0x02000002, 0x02080802, @@ -180,7 +180,7 @@ CONSTANT_AS u32a c_SPtrans[8][64] = } }; -CONSTANT_AS u32a c_skb[8][64] = +CONSTANT_AS CONSTSPEC u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m03000_a3-pure.cl b/OpenCL/m03000_a3-pure.cl index a239bea0b..81d25664a 100644 --- a/OpenCL/m03000_a3-pure.cl +++ b/OpenCL/m03000_a3-pure.cl @@ -1730,7 +1730,7 @@ DECLSPEC void transpose32c (u32 *data) // transpose bitslice mod : attention race conditions, need different buffers for *in and *out // -KERNEL_FQ void m03000_tm (GLOBAL_AS u32 * restrict mod, GLOBAL_AS bs_word_t * restrict words_buf_r) +KERNEL_FQ void m03000_tm (GLOBAL_AS u32 *mod, GLOBAL_AS bs_word_t *words_buf_r) { const u64 gid = get_global_id (0); diff --git a/OpenCL/m03100_a0-optimized.cl b/OpenCL/m03100_a0-optimized.cl index 2acb723a7..426594c63 100644 --- a/OpenCL/m03100_a0-optimized.cl +++ b/OpenCL/m03100_a0-optimized.cl @@ -114,7 +114,7 @@ KERNEL_FQ void m03100_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); const u32x salt_word_len = (salt_len + out_len) * 2; @@ -358,7 +358,7 @@ KERNEL_FQ void m03100_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); const u32x salt_word_len = (salt_len + out_len) * 2; diff --git a/OpenCL/m03200-pure.cl b/OpenCL/m03200-pure.cl index 332cca11c..1a51b987a 100644 --- a/OpenCL/m03200-pure.cl +++ b/OpenCL/m03200-pure.cl @@ -27,7 +27,7 @@ typedef struct bcrypt_tmp // http://www.schneier.com/code/constants.txt -CONSTANT_AS u32a c_sbox0[256] = +CONSTANT_AS CONSTSPEC u32a c_sbox0[256] = { 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, @@ -95,7 +95,7 @@ CONSTANT_AS u32a c_sbox0[256] = 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a }; -CONSTANT_AS u32a c_sbox1[256] = +CONSTANT_AS CONSTSPEC u32a c_sbox1[256] = { 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, @@ -163,7 +163,7 @@ CONSTANT_AS u32a c_sbox1[256] = 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7 }; -CONSTANT_AS u32a c_sbox2[256] = +CONSTANT_AS CONSTSPEC u32a c_sbox2[256] = { 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, @@ -231,7 +231,7 @@ CONSTANT_AS u32a c_sbox2[256] = 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0 }; -CONSTANT_AS u32a c_sbox3[256] = +CONSTANT_AS CONSTSPEC u32a c_sbox3[256] = { 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, diff --git a/OpenCL/m03710_a0-optimized.cl b/OpenCL/m03710_a0-optimized.cl index f1d9ec1c3..13f534ec4 100644 --- a/OpenCL/m03710_a0-optimized.cl +++ b/OpenCL/m03710_a0-optimized.cl @@ -115,7 +115,7 @@ KERNEL_FQ void m03710_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -442,7 +442,7 @@ KERNEL_FQ void m03710_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m03800_a0-optimized.cl b/OpenCL/m03800_a0-optimized.cl index bfc503119..b14fd1569 100644 --- a/OpenCL/m03800_a0-optimized.cl +++ b/OpenCL/m03800_a0-optimized.cl @@ -84,7 +84,7 @@ KERNEL_FQ void m03800_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * prepend salt @@ -335,7 +335,7 @@ KERNEL_FQ void m03800_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * prepend salt diff --git a/OpenCL/m03910_a0-optimized.cl b/OpenCL/m03910_a0-optimized.cl index 30462282a..f8d699026 100644 --- a/OpenCL/m03910_a0-optimized.cl +++ b/OpenCL/m03910_a0-optimized.cl @@ -113,7 +113,7 @@ KERNEL_FQ void m03910_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -495,7 +495,7 @@ KERNEL_FQ void m03910_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m04010_a0-optimized.cl b/OpenCL/m04010_a0-optimized.cl index 9d8c97819..efe2e8074 100644 --- a/OpenCL/m04010_a0-optimized.cl +++ b/OpenCL/m04010_a0-optimized.cl @@ -115,7 +115,7 @@ KERNEL_FQ void m04010_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * prepend salt @@ -468,7 +468,7 @@ KERNEL_FQ void m04010_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * prepend salt diff --git a/OpenCL/m04110_a0-optimized.cl b/OpenCL/m04110_a0-optimized.cl index e23175f52..77d12bc03 100644 --- a/OpenCL/m04110_a0-optimized.cl +++ b/OpenCL/m04110_a0-optimized.cl @@ -140,7 +140,7 @@ KERNEL_FQ void m04110_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * append salt @@ -538,7 +538,7 @@ KERNEL_FQ void m04110_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * append salt diff --git a/OpenCL/m04310_a0-optimized.cl b/OpenCL/m04310_a0-optimized.cl index 79099b09c..dc693f19c 100644 --- a/OpenCL/m04310_a0-optimized.cl +++ b/OpenCL/m04310_a0-optimized.cl @@ -113,7 +113,7 @@ KERNEL_FQ void m04310_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -409,7 +409,7 @@ KERNEL_FQ void m04310_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m04400_a0-optimized.cl b/OpenCL/m04400_a0-optimized.cl index 0f49e93a4..ffad3ae09 100644 --- a/OpenCL/m04400_a0-optimized.cl +++ b/OpenCL/m04400_a0-optimized.cl @@ -86,7 +86,7 @@ KERNEL_FQ void m04400_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -408,7 +408,7 @@ KERNEL_FQ void m04400_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m04500_a0-optimized.cl b/OpenCL/m04500_a0-optimized.cl index 78b12b046..573e50223 100644 --- a/OpenCL/m04500_a0-optimized.cl +++ b/OpenCL/m04500_a0-optimized.cl @@ -85,7 +85,7 @@ KERNEL_FQ void m04500_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -440,7 +440,7 @@ KERNEL_FQ void m04500_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m04520_a0-optimized.cl b/OpenCL/m04520_a0-optimized.cl index fe2035a05..a34bca23c 100644 --- a/OpenCL/m04520_a0-optimized.cl +++ b/OpenCL/m04520_a0-optimized.cl @@ -113,7 +113,7 @@ KERNEL_FQ void m04520_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -693,7 +693,7 @@ KERNEL_FQ void m04520_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m04700_a0-optimized.cl b/OpenCL/m04700_a0-optimized.cl index a1d112073..13a2b98c8 100644 --- a/OpenCL/m04700_a0-optimized.cl +++ b/OpenCL/m04700_a0-optimized.cl @@ -86,7 +86,7 @@ KERNEL_FQ void m04700_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -397,7 +397,7 @@ KERNEL_FQ void m04700_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m04800_a0-optimized.cl b/OpenCL/m04800_a0-optimized.cl index 9f6ce1abc..03418d5d4 100644 --- a/OpenCL/m04800_a0-optimized.cl +++ b/OpenCL/m04800_a0-optimized.cl @@ -69,7 +69,7 @@ KERNEL_FQ void m04800_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); const u32x salt_out_len = salt_len + out_len; @@ -286,7 +286,7 @@ KERNEL_FQ void m04800_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); const u32x salt_out_len = salt_len + out_len; diff --git a/OpenCL/m04900_a0-optimized.cl b/OpenCL/m04900_a0-optimized.cl index bd2590121..601b5b1d9 100644 --- a/OpenCL/m04900_a0-optimized.cl +++ b/OpenCL/m04900_a0-optimized.cl @@ -84,7 +84,7 @@ KERNEL_FQ void m04900_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * prepend salt @@ -382,7 +382,7 @@ KERNEL_FQ void m04900_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * prepend salt diff --git a/OpenCL/m05100_a0-optimized.cl b/OpenCL/m05100_a0-optimized.cl index 170235ae8..90441fc0a 100644 --- a/OpenCL/m05100_a0-optimized.cl +++ b/OpenCL/m05100_a0-optimized.cl @@ -56,7 +56,7 @@ KERNEL_FQ void m05100_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -216,7 +216,7 @@ KERNEL_FQ void m05100_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m05300_a0-optimized.cl b/OpenCL/m05300_a0-optimized.cl index b61a778d3..11a175095 100644 --- a/OpenCL/m05300_a0-optimized.cl +++ b/OpenCL/m05300_a0-optimized.cl @@ -178,7 +178,7 @@ KERNEL_FQ void m05300_m04 (KERN_ATTR_RULES_ESALT (ikepsk_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * pads @@ -365,7 +365,7 @@ KERNEL_FQ void m05300_s04 (KERN_ATTR_RULES_ESALT (ikepsk_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * pads diff --git a/OpenCL/m05400_a0-optimized.cl b/OpenCL/m05400_a0-optimized.cl index 0a1fdbc4a..06cfe4d95 100644 --- a/OpenCL/m05400_a0-optimized.cl +++ b/OpenCL/m05400_a0-optimized.cl @@ -182,7 +182,7 @@ KERNEL_FQ void m05400_m04 (KERN_ATTR_RULES_ESALT (ikepsk_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * pads @@ -378,7 +378,7 @@ KERNEL_FQ void m05400_s04 (KERN_ATTR_RULES_ESALT (ikepsk_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * pads diff --git a/OpenCL/m05500_a0-optimized.cl b/OpenCL/m05500_a0-optimized.cl index 3ef1d7077..799874143 100644 --- a/OpenCL/m05500_a0-optimized.cl +++ b/OpenCL/m05500_a0-optimized.cl @@ -47,7 +47,7 @@ typedef struct netntlm a = a ^ tt; \ } -CONSTANT_AS u32a c_SPtrans[8][64] = +CONSTANT_AS CONSTSPEC u32a c_SPtrans[8][64] = { { 0x02080800, 0x00080000, 0x02000002, 0x02080802, @@ -195,7 +195,7 @@ CONSTANT_AS u32a c_SPtrans[8][64] = } }; -CONSTANT_AS u32a c_skb[8][64] = +CONSTANT_AS CONSTSPEC u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, @@ -585,7 +585,7 @@ KERNEL_FQ void m05500_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -805,7 +805,7 @@ KERNEL_FQ void m05500_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m05500_a0-pure.cl b/OpenCL/m05500_a0-pure.cl index f83be3388..bc9b1519d 100644 --- a/OpenCL/m05500_a0-pure.cl +++ b/OpenCL/m05500_a0-pure.cl @@ -47,7 +47,7 @@ typedef struct netntlm a = a ^ tt; \ } -CONSTANT_AS u32a c_SPtrans[8][64] = +CONSTANT_AS CONSTSPEC u32a c_SPtrans[8][64] = { { 0x02080800, 0x00080000, 0x02000002, 0x02080802, @@ -195,7 +195,7 @@ CONSTANT_AS u32a c_SPtrans[8][64] = } }; -CONSTANT_AS u32a c_skb[8][64] = +CONSTANT_AS CONSTSPEC u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m05500_a1-optimized.cl b/OpenCL/m05500_a1-optimized.cl index 20de5bc7e..b69244b60 100644 --- a/OpenCL/m05500_a1-optimized.cl +++ b/OpenCL/m05500_a1-optimized.cl @@ -45,7 +45,7 @@ typedef struct netntlm a = a ^ tt; \ } -CONSTANT_AS u32a c_SPtrans[8][64] = +CONSTANT_AS CONSTSPEC u32a c_SPtrans[8][64] = { { 0x02080800, 0x00080000, 0x02000002, 0x02080802, @@ -193,7 +193,7 @@ CONSTANT_AS u32a c_SPtrans[8][64] = } }; -CONSTANT_AS u32a c_skb[8][64] = +CONSTANT_AS CONSTSPEC u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m05500_a1-pure.cl b/OpenCL/m05500_a1-pure.cl index 14e152681..836fa8ec1 100644 --- a/OpenCL/m05500_a1-pure.cl +++ b/OpenCL/m05500_a1-pure.cl @@ -45,7 +45,7 @@ typedef struct netntlm a = a ^ tt; \ } -CONSTANT_AS u32a c_SPtrans[8][64] = +CONSTANT_AS CONSTSPEC u32a c_SPtrans[8][64] = { { 0x02080800, 0x00080000, 0x02000002, 0x02080802, @@ -193,7 +193,7 @@ CONSTANT_AS u32a c_SPtrans[8][64] = } }; -CONSTANT_AS u32a c_skb[8][64] = +CONSTANT_AS CONSTSPEC u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m05500_a3-optimized.cl b/OpenCL/m05500_a3-optimized.cl index 5f43cd563..9bb78e177 100644 --- a/OpenCL/m05500_a3-optimized.cl +++ b/OpenCL/m05500_a3-optimized.cl @@ -45,7 +45,7 @@ typedef struct netntlm a = a ^ tt; \ } -CONSTANT_AS u32a c_SPtrans[8][64] = +CONSTANT_AS CONSTSPEC u32a c_SPtrans[8][64] = { { 0x02080800, 0x00080000, 0x02000002, 0x02080802, @@ -193,7 +193,7 @@ CONSTANT_AS u32a c_SPtrans[8][64] = } }; -CONSTANT_AS u32a c_skb[8][64] = +CONSTANT_AS CONSTSPEC u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m05500_a3-pure.cl b/OpenCL/m05500_a3-pure.cl index 41efdfe57..70015d5f1 100644 --- a/OpenCL/m05500_a3-pure.cl +++ b/OpenCL/m05500_a3-pure.cl @@ -45,7 +45,7 @@ typedef struct netntlm a = a ^ tt; \ } -CONSTANT_AS u32a c_SPtrans[8][64] = +CONSTANT_AS CONSTSPEC u32a c_SPtrans[8][64] = { { 0x02080800, 0x00080000, 0x02000002, 0x02080802, @@ -193,7 +193,7 @@ CONSTANT_AS u32a c_SPtrans[8][64] = } }; -CONSTANT_AS u32a c_skb[8][64] = +CONSTANT_AS CONSTSPEC u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m05600_a0-optimized.cl b/OpenCL/m05600_a0-optimized.cl index d77a0c86b..a1cb6f71d 100644 --- a/OpenCL/m05600_a0-optimized.cl +++ b/OpenCL/m05600_a0-optimized.cl @@ -180,7 +180,7 @@ KERNEL_FQ void m05600_m04 (KERN_ATTR_RULES_ESALT (netntlm_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -431,7 +431,7 @@ KERNEL_FQ void m05600_s04 (KERN_ATTR_RULES_ESALT (netntlm_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m05800-optimized.cl b/OpenCL/m05800-optimized.cl index 1d20248cd..461f4b6cd 100644 --- a/OpenCL/m05800-optimized.cl +++ b/OpenCL/m05800-optimized.cl @@ -19,7 +19,7 @@ typedef struct androidpin_tmp } androidpin_tmp_t; -CONSTANT_AS u32a c_pc_dec[1024] = +CONSTANT_AS CONSTSPEC u32a c_pc_dec[1024] = { 0x00000030, 0x00000031, @@ -1047,7 +1047,7 @@ CONSTANT_AS u32a c_pc_dec[1024] = 0x33323031, }; -CONSTANT_AS u32a c_pc_len[1024] = +CONSTANT_AS CONSTSPEC u32a c_pc_len[1024] = { 1, 1, diff --git a/OpenCL/m05800-pure.cl b/OpenCL/m05800-pure.cl index 35e4201bf..112efd2d7 100644 --- a/OpenCL/m05800-pure.cl +++ b/OpenCL/m05800-pure.cl @@ -19,7 +19,7 @@ typedef struct androidpin_tmp } androidpin_tmp_t; -CONSTANT_AS u32a c_pc_dec[1024] = +CONSTANT_AS CONSTSPEC u32a c_pc_dec[1024] = { 0x00000030, 0x00000031, @@ -1047,7 +1047,7 @@ CONSTANT_AS u32a c_pc_dec[1024] = 0x33323031, }; -CONSTANT_AS u32a c_pc_len[1024] = +CONSTANT_AS CONSTSPEC u32a c_pc_len[1024] = { 1, 1, diff --git a/OpenCL/m06000_a0-optimized.cl b/OpenCL/m06000_a0-optimized.cl index 6ceef4f26..e38bfd5a6 100644 --- a/OpenCL/m06000_a0-optimized.cl +++ b/OpenCL/m06000_a0-optimized.cl @@ -61,7 +61,7 @@ KERNEL_FQ void m06000_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -163,7 +163,7 @@ KERNEL_FQ void m06000_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m06100_a0-optimized.cl b/OpenCL/m06100_a0-optimized.cl index 13224c6b4..046d0c4f9 100644 --- a/OpenCL/m06100_a0-optimized.cl +++ b/OpenCL/m06100_a0-optimized.cl @@ -100,7 +100,7 @@ KERNEL_FQ void m06100_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -252,7 +252,7 @@ KERNEL_FQ void m06100_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m06900_a0-optimized.cl b/OpenCL/m06900_a0-optimized.cl index ae468ee70..492d01401 100644 --- a/OpenCL/m06900_a0-optimized.cl +++ b/OpenCL/m06900_a0-optimized.cl @@ -14,7 +14,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u32a c_tables[4][256] = +CONSTANT_AS CONSTSPEC u32a c_tables[4][256] = { { 0x00072000, 0x00075000, 0x00074800, 0x00071000, @@ -754,7 +754,7 @@ KERNEL_FQ void m06900_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); u32x data[8]; @@ -982,7 +982,7 @@ KERNEL_FQ void m06900_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * GOST diff --git a/OpenCL/m06900_a1-optimized.cl b/OpenCL/m06900_a1-optimized.cl index a6ca9bb5d..3d0ba0687 100644 --- a/OpenCL/m06900_a1-optimized.cl +++ b/OpenCL/m06900_a1-optimized.cl @@ -12,7 +12,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u32a c_tables[4][256] = +CONSTANT_AS CONSTSPEC u32a c_tables[4][256] = { { 0x00072000, 0x00075000, 0x00074800, 0x00071000, diff --git a/OpenCL/m06900_a3-optimized.cl b/OpenCL/m06900_a3-optimized.cl index 5d9996777..34dd4ffce 100644 --- a/OpenCL/m06900_a3-optimized.cl +++ b/OpenCL/m06900_a3-optimized.cl @@ -12,7 +12,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u32a c_tables[4][256] = +CONSTANT_AS CONSTSPEC u32a c_tables[4][256] = { { 0x00072000, 0x00075000, 0x00074800, 0x00071000, diff --git a/OpenCL/m07000_a0-optimized.cl b/OpenCL/m07000_a0-optimized.cl index 67d710bcf..f5d00ff09 100644 --- a/OpenCL/m07000_a0-optimized.cl +++ b/OpenCL/m07000_a0-optimized.cl @@ -70,7 +70,7 @@ KERNEL_FQ void m07000_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * combine pw + magic @@ -350,7 +350,7 @@ KERNEL_FQ void m07000_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * combine pw + magic diff --git a/OpenCL/m07300_a0-optimized.cl b/OpenCL/m07300_a0-optimized.cl index b94c93c0d..c1744096c 100644 --- a/OpenCL/m07300_a0-optimized.cl +++ b/OpenCL/m07300_a0-optimized.cl @@ -158,7 +158,7 @@ KERNEL_FQ void m07300_m04 (KERN_ATTR_RULES_ESALT (rakp_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); w0[0] = hc_swap32 (w0[0]); w0[1] = hc_swap32 (w0[1]); @@ -297,7 +297,7 @@ KERNEL_FQ void m07300_s04 (KERN_ATTR_RULES_ESALT (rakp_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); w0[0] = hc_swap32 (w0[0]); w0[1] = hc_swap32 (w0[1]); diff --git a/OpenCL/m07500_a0-optimized.cl b/OpenCL/m07500_a0-optimized.cl index 9640178fd..028cca99b 100644 --- a/OpenCL/m07500_a0-optimized.cl +++ b/OpenCL/m07500_a0-optimized.cl @@ -465,7 +465,7 @@ KERNEL_FQ void m07500_m04 (KERN_ATTR_RULES_ESALT (krb5pa_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * kerberos @@ -571,7 +571,7 @@ KERNEL_FQ void m07500_s04 (KERN_ATTR_RULES_ESALT (krb5pa_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * kerberos diff --git a/OpenCL/m07700_a0-optimized.cl b/OpenCL/m07700_a0-optimized.cl index 063ff6659..c66579e08 100644 --- a/OpenCL/m07700_a0-optimized.cl +++ b/OpenCL/m07700_a0-optimized.cl @@ -28,7 +28,7 @@ (a)[((n)/4)+1] = x >> 32; \ } -CONSTANT_AS u32a sapb_trans_tbl[256] = +CONSTANT_AS CONSTSPEC u32a sapb_trans_tbl[256] = { // first value hack for 0 byte as part of an optimization 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, @@ -49,7 +49,7 @@ CONSTANT_AS u32a sapb_trans_tbl[256] = 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; -CONSTANT_AS u32a bcodeArray[48] = +CONSTANT_AS CONSTSPEC u32a bcodeArray[48] = { 0x14, 0x77, 0xf3, 0xd4, 0xbb, 0x71, 0x23, 0xd0, 0x03, 0xff, 0x47, 0x93, 0x55, 0xaa, 0x66, 0x91, 0xf2, 0x88, 0x6b, 0x99, 0xbf, 0xcb, 0x32, 0x1a, 0x19, 0xd9, 0xa7, 0x82, 0x22, 0x49, 0xa2, 0x51, @@ -205,7 +205,7 @@ KERNEL_FQ void m07700_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); if (out_len > 8) continue; // otherwise it overflows in waldorf function @@ -381,7 +381,7 @@ KERNEL_FQ void m07700_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); if (out_len > 8) continue; // otherwise it overflows in waldorf function diff --git a/OpenCL/m07700_a1-optimized.cl b/OpenCL/m07700_a1-optimized.cl index 86dd31267..a5288ce32 100644 --- a/OpenCL/m07700_a1-optimized.cl +++ b/OpenCL/m07700_a1-optimized.cl @@ -26,7 +26,7 @@ (a)[((n)/4)+1] = x >> 32; \ } -CONSTANT_AS u32a sapb_trans_tbl[256] = +CONSTANT_AS CONSTSPEC u32a sapb_trans_tbl[256] = { // first value hack for 0 byte as part of an optimization 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, @@ -47,7 +47,7 @@ CONSTANT_AS u32a sapb_trans_tbl[256] = 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; -CONSTANT_AS u32a bcodeArray[48] = +CONSTANT_AS CONSTSPEC u32a bcodeArray[48] = { 0x14, 0x77, 0xf3, 0xd4, 0xbb, 0x71, 0x23, 0xd0, 0x03, 0xff, 0x47, 0x93, 0x55, 0xaa, 0x66, 0x91, 0xf2, 0x88, 0x6b, 0x99, 0xbf, 0xcb, 0x32, 0x1a, 0x19, 0xd9, 0xa7, 0x82, 0x22, 0x49, 0xa2, 0x51, diff --git a/OpenCL/m07700_a3-optimized.cl b/OpenCL/m07700_a3-optimized.cl index a3f3d7a62..e35e4b2ad 100644 --- a/OpenCL/m07700_a3-optimized.cl +++ b/OpenCL/m07700_a3-optimized.cl @@ -17,7 +17,7 @@ #define GETCHAR(a,p) (((a)[(p) / 4] >> (((p) & 3) * 8)) & 0xff) #define PUTCHAR(a,p,c) ((a)[(p) / 4] = (((a)[(p) / 4] & ~(0xff << (((p) & 3) * 8))) | ((c) << (((p) & 3) * 8)))) -CONSTANT_AS u32a sapb_trans_tbl[256] = +CONSTANT_AS CONSTSPEC u32a sapb_trans_tbl[256] = { // first value hack for 0 byte as part of an optimization 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, @@ -38,7 +38,7 @@ CONSTANT_AS u32a sapb_trans_tbl[256] = 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; -CONSTANT_AS u32a bcodeArray[48] = +CONSTANT_AS CONSTSPEC u32a bcodeArray[48] = { 0x14, 0x77, 0xf3, 0xd4, 0xbb, 0x71, 0x23, 0xd0, 0x03, 0xff, 0x47, 0x93, 0x55, 0xaa, 0x66, 0x91, 0xf2, 0x88, 0x6b, 0x99, 0xbf, 0xcb, 0x32, 0x1a, 0x19, 0xd9, 0xa7, 0x82, 0x22, 0x49, 0xa2, 0x51, diff --git a/OpenCL/m07701_a0-optimized.cl b/OpenCL/m07701_a0-optimized.cl index 45a13677e..b61372571 100644 --- a/OpenCL/m07701_a0-optimized.cl +++ b/OpenCL/m07701_a0-optimized.cl @@ -28,7 +28,7 @@ (a)[((n)/4)+1] = x >> 32; \ } -CONSTANT_AS u32a sapb_trans_tbl[256] = +CONSTANT_AS CONSTSPEC u32a sapb_trans_tbl[256] = { // first value hack for 0 byte as part of an optimization 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, @@ -49,7 +49,7 @@ CONSTANT_AS u32a sapb_trans_tbl[256] = 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; -CONSTANT_AS u32a bcodeArray[48] = +CONSTANT_AS CONSTSPEC u32a bcodeArray[48] = { 0x14, 0x77, 0xf3, 0xd4, 0xbb, 0x71, 0x23, 0xd0, 0x03, 0xff, 0x47, 0x93, 0x55, 0xaa, 0x66, 0x91, 0xf2, 0x88, 0x6b, 0x99, 0xbf, 0xcb, 0x32, 0x1a, 0x19, 0xd9, 0xa7, 0x82, 0x22, 0x49, 0xa2, 0x51, @@ -205,7 +205,7 @@ KERNEL_FQ void m07701_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); if (out_len > 8) continue; // otherwise it overflows in waldorf function @@ -381,7 +381,7 @@ KERNEL_FQ void m07701_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); if (out_len > 8) continue; // otherwise it overflows in waldorf function diff --git a/OpenCL/m07701_a1-optimized.cl b/OpenCL/m07701_a1-optimized.cl index f73364987..daee5784d 100644 --- a/OpenCL/m07701_a1-optimized.cl +++ b/OpenCL/m07701_a1-optimized.cl @@ -26,7 +26,7 @@ (a)[((n)/4)+1] = x >> 32; \ } -CONSTANT_AS u32a sapb_trans_tbl[256] = +CONSTANT_AS CONSTSPEC u32a sapb_trans_tbl[256] = { // first value hack for 0 byte as part of an optimization 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, @@ -47,7 +47,7 @@ CONSTANT_AS u32a sapb_trans_tbl[256] = 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; -CONSTANT_AS u32a bcodeArray[48] = +CONSTANT_AS CONSTSPEC u32a bcodeArray[48] = { 0x14, 0x77, 0xf3, 0xd4, 0xbb, 0x71, 0x23, 0xd0, 0x03, 0xff, 0x47, 0x93, 0x55, 0xaa, 0x66, 0x91, 0xf2, 0x88, 0x6b, 0x99, 0xbf, 0xcb, 0x32, 0x1a, 0x19, 0xd9, 0xa7, 0x82, 0x22, 0x49, 0xa2, 0x51, diff --git a/OpenCL/m07701_a3-optimized.cl b/OpenCL/m07701_a3-optimized.cl index b32c65f24..6c8859f45 100644 --- a/OpenCL/m07701_a3-optimized.cl +++ b/OpenCL/m07701_a3-optimized.cl @@ -17,7 +17,7 @@ #define GETCHAR(a,p) (((a)[(p) / 4] >> (((p) & 3) * 8)) & 0xff) #define PUTCHAR(a,p,c) ((a)[(p) / 4] = (((a)[(p) / 4] & ~(0xff << (((p) & 3) * 8))) | ((c) << (((p) & 3) * 8)))) -CONSTANT_AS u32a sapb_trans_tbl[256] = +CONSTANT_AS CONSTSPEC u32a sapb_trans_tbl[256] = { // first value hack for 0 byte as part of an optimization 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, @@ -38,7 +38,7 @@ CONSTANT_AS u32a sapb_trans_tbl[256] = 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; -CONSTANT_AS u32a bcodeArray[48] = +CONSTANT_AS CONSTSPEC u32a bcodeArray[48] = { 0x14, 0x77, 0xf3, 0xd4, 0xbb, 0x71, 0x23, 0xd0, 0x03, 0xff, 0x47, 0x93, 0x55, 0xaa, 0x66, 0x91, 0xf2, 0x88, 0x6b, 0x99, 0xbf, 0xcb, 0x32, 0x1a, 0x19, 0xd9, 0xa7, 0x82, 0x22, 0x49, 0xa2, 0x51, diff --git a/OpenCL/m07800_a0-optimized.cl b/OpenCL/m07800_a0-optimized.cl index 38a10514b..16520efea 100644 --- a/OpenCL/m07800_a0-optimized.cl +++ b/OpenCL/m07800_a0-optimized.cl @@ -16,7 +16,7 @@ #include "inc_hash_sha1.cl" #endif -CONSTANT_AS u32a theMagicArray[64] = +CONSTANT_AS CONSTSPEC u32a theMagicArray[64] = { 0x91ac5114, 0x9f675443, 0x24e73be0, 0x28747bc2, 0x863313eb, 0x5a4fcb5c, 0x080a7337, 0x0e5d1c2f, 0x338fe6e5, 0xf89baedd, 0x16f24b8d, 0x2ce1d4dc, 0xb0cbdf9d, 0xd4706d17, 0xf94d423f, 0x9b1b1194, @@ -28,7 +28,7 @@ CONSTANT_AS u32a theMagicArray[64] = 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; -DECLSPEC u32 GETSHIFTEDINT_CONST (CONSTANT_AS u32 *a, const int n) +DECLSPEC u32 GETSHIFTEDINT_CONST (CONSTANT_AS u32a *a, const int n) { const int d = n / 4; const int m = n & 3; @@ -111,7 +111,7 @@ KERNEL_FQ void m07800_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * SAP @@ -371,7 +371,7 @@ KERNEL_FQ void m07800_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * SAP diff --git a/OpenCL/m07800_a1-optimized.cl b/OpenCL/m07800_a1-optimized.cl index 76b51947c..58c97f04a 100644 --- a/OpenCL/m07800_a1-optimized.cl +++ b/OpenCL/m07800_a1-optimized.cl @@ -14,7 +14,7 @@ #include "inc_hash_sha1.cl" #endif -CONSTANT_AS u32a theMagicArray[64] = +CONSTANT_AS CONSTSPEC u32a theMagicArray[64] = { 0x91ac5114, 0x9f675443, 0x24e73be0, 0x28747bc2, 0x863313eb, 0x5a4fcb5c, 0x080a7337, 0x0e5d1c2f, 0x338fe6e5, 0xf89baedd, 0x16f24b8d, 0x2ce1d4dc, 0xb0cbdf9d, 0xd4706d17, 0xf94d423f, 0x9b1b1194, @@ -26,7 +26,7 @@ CONSTANT_AS u32a theMagicArray[64] = 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; -DECLSPEC u32 GETSHIFTEDINT_CONST (CONSTANT_AS u32 *a, const int n) +DECLSPEC u32 GETSHIFTEDINT_CONST (CONSTANT_AS u32a *a, const int n) { const int d = n / 4; const int m = n & 3; diff --git a/OpenCL/m07800_a3-optimized.cl b/OpenCL/m07800_a3-optimized.cl index c191826b5..5cfe24ec2 100644 --- a/OpenCL/m07800_a3-optimized.cl +++ b/OpenCL/m07800_a3-optimized.cl @@ -14,7 +14,7 @@ #include "inc_hash_sha1.cl" #endif -CONSTANT_AS u32a theMagicArray[64] = +CONSTANT_AS CONSTSPEC u32a theMagicArray[64] = { 0x91ac5114, 0x9f675443, 0x24e73be0, 0x28747bc2, 0x863313eb, 0x5a4fcb5c, 0x080a7337, 0x0e5d1c2f, 0x338fe6e5, 0xf89baedd, 0x16f24b8d, 0x2ce1d4dc, 0xb0cbdf9d, 0xd4706d17, 0xf94d423f, 0x9b1b1194, @@ -26,7 +26,7 @@ CONSTANT_AS u32a theMagicArray[64] = 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; -DECLSPEC u32 GETSHIFTEDINT_CONST (CONSTANT_AS u32 *a, const int n) +DECLSPEC u32 GETSHIFTEDINT_CONST (CONSTANT_AS u32a *a, const int n) { const int d = n / 4; const int m = n & 3; diff --git a/OpenCL/m07801_a0-optimized.cl b/OpenCL/m07801_a0-optimized.cl index aefd8f701..1acc7f444 100644 --- a/OpenCL/m07801_a0-optimized.cl +++ b/OpenCL/m07801_a0-optimized.cl @@ -16,7 +16,7 @@ #include "inc_hash_sha1.cl" #endif -CONSTANT_AS u32a theMagicArray[64] = +CONSTANT_AS CONSTSPEC u32a theMagicArray[64] = { 0x91ac5114, 0x9f675443, 0x24e73be0, 0x28747bc2, 0x863313eb, 0x5a4fcb5c, 0x080a7337, 0x0e5d1c2f, 0x338fe6e5, 0xf89baedd, 0x16f24b8d, 0x2ce1d4dc, 0xb0cbdf9d, 0xd4706d17, 0xf94d423f, 0x9b1b1194, @@ -28,7 +28,7 @@ CONSTANT_AS u32a theMagicArray[64] = 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; -DECLSPEC u32 GETSHIFTEDINT_CONST (CONSTANT_AS u32 *a, const int n) +DECLSPEC u32 GETSHIFTEDINT_CONST (CONSTANT_AS u32a *a, const int n) { const int d = n / 4; const int m = n & 3; @@ -111,7 +111,7 @@ KERNEL_FQ void m07801_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * SAP @@ -371,7 +371,7 @@ KERNEL_FQ void m07801_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * SAP diff --git a/OpenCL/m07801_a1-optimized.cl b/OpenCL/m07801_a1-optimized.cl index a859b95e8..205633290 100644 --- a/OpenCL/m07801_a1-optimized.cl +++ b/OpenCL/m07801_a1-optimized.cl @@ -14,7 +14,7 @@ #include "inc_hash_sha1.cl" #endif -CONSTANT_AS u32a theMagicArray[64] = +CONSTANT_AS CONSTSPEC u32a theMagicArray[64] = { 0x91ac5114, 0x9f675443, 0x24e73be0, 0x28747bc2, 0x863313eb, 0x5a4fcb5c, 0x080a7337, 0x0e5d1c2f, 0x338fe6e5, 0xf89baedd, 0x16f24b8d, 0x2ce1d4dc, 0xb0cbdf9d, 0xd4706d17, 0xf94d423f, 0x9b1b1194, @@ -26,7 +26,7 @@ CONSTANT_AS u32a theMagicArray[64] = 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; -DECLSPEC u32 GETSHIFTEDINT_CONST (CONSTANT_AS u32 *a, const int n) +DECLSPEC u32 GETSHIFTEDINT_CONST (CONSTANT_AS u32a *a, const int n) { const int d = n / 4; const int m = n & 3; diff --git a/OpenCL/m07801_a3-optimized.cl b/OpenCL/m07801_a3-optimized.cl index 6af35917d..ccd266569 100644 --- a/OpenCL/m07801_a3-optimized.cl +++ b/OpenCL/m07801_a3-optimized.cl @@ -14,7 +14,7 @@ #include "inc_hash_sha1.cl" #endif -CONSTANT_AS u32a theMagicArray[64] = +CONSTANT_AS CONSTSPEC u32a theMagicArray[64] = { 0x91ac5114, 0x9f675443, 0x24e73be0, 0x28747bc2, 0x863313eb, 0x5a4fcb5c, 0x080a7337, 0x0e5d1c2f, 0x338fe6e5, 0xf89baedd, 0x16f24b8d, 0x2ce1d4dc, 0xb0cbdf9d, 0xd4706d17, 0xf94d423f, 0x9b1b1194, @@ -26,7 +26,7 @@ CONSTANT_AS u32a theMagicArray[64] = 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; -DECLSPEC u32 GETSHIFTEDINT_CONST (CONSTANT_AS u32 *a, const int n) +DECLSPEC u32 GETSHIFTEDINT_CONST (CONSTANT_AS u32a *a, const int n) { const int d = n / 4; const int m = n & 3; diff --git a/OpenCL/m08000_a0-optimized.cl b/OpenCL/m08000_a0-optimized.cl index fd0737b34..c3f3e6edf 100644 --- a/OpenCL/m08000_a0-optimized.cl +++ b/OpenCL/m08000_a0-optimized.cl @@ -297,7 +297,7 @@ KERNEL_FQ void m08000_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); u32x w0_t[4]; u32x w1_t[4]; @@ -480,7 +480,7 @@ KERNEL_FQ void m08000_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); u32x w0_t[4]; u32x w1_t[4]; diff --git a/OpenCL/m08100_a0-optimized.cl b/OpenCL/m08100_a0-optimized.cl index 00732d210..5a3f1fb5b 100644 --- a/OpenCL/m08100_a0-optimized.cl +++ b/OpenCL/m08100_a0-optimized.cl @@ -67,7 +67,7 @@ KERNEL_FQ void m08100_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_4x4_VV (w0, w1, w2, w3, out_len + 1); @@ -297,7 +297,7 @@ KERNEL_FQ void m08100_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_4x4_VV (w0, w1, w2, w3, out_len + 1); diff --git a/OpenCL/m08300_a0-optimized.cl b/OpenCL/m08300_a0-optimized.cl index d85509973..4591d7a24 100644 --- a/OpenCL/m08300_a0-optimized.cl +++ b/OpenCL/m08300_a0-optimized.cl @@ -90,7 +90,7 @@ KERNEL_FQ void m08300_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * salt @@ -359,7 +359,7 @@ KERNEL_FQ void m08300_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * salt diff --git a/OpenCL/m08400_a0-optimized.cl b/OpenCL/m08400_a0-optimized.cl index 29ebba3d3..21a973218 100644 --- a/OpenCL/m08400_a0-optimized.cl +++ b/OpenCL/m08400_a0-optimized.cl @@ -108,7 +108,7 @@ KERNEL_FQ void m08400_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -374,7 +374,7 @@ KERNEL_FQ void m08400_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m08500_a0-pure.cl b/OpenCL/m08500_a0-pure.cl index 04cefa798..77cd83221 100644 --- a/OpenCL/m08500_a0-pure.cl +++ b/OpenCL/m08500_a0-pure.cl @@ -52,7 +52,7 @@ PERM_OP (l, r, tt, 4, 0x0f0f0f0f); \ } -CONSTANT_AS u32a c_ascii_to_ebcdic_pc[256] = +CONSTANT_AS CONSTSPEC u32a c_ascii_to_ebcdic_pc[256] = { // little hack, can't crack 0-bytes in password, but who cares // 0xab, 0xa8, 0xae, 0xad, 0xc4, 0xf1, 0xf7, 0xf4, 0x86, 0xa1, 0xe0, 0xbc, 0xb3, 0xb0, 0xb6, 0xb5, @@ -74,7 +74,7 @@ CONSTANT_AS u32a c_ascii_to_ebcdic_pc[256] = 0x13, 0x10, 0x16, 0x15, 0x7f, 0x7c, 0x73, 0x70, 0x76, 0x75, 0x5e, 0x5d, 0x52, 0x51, 0x57, 0x54, }; -CONSTANT_AS u32a c_SPtrans[8][64] = +CONSTANT_AS CONSTSPEC u32a c_SPtrans[8][64] = { { 0x02080800, 0x00080000, 0x02000002, 0x02080802, @@ -222,7 +222,7 @@ CONSTANT_AS u32a c_SPtrans[8][64] = } }; -CONSTANT_AS u32a c_skb[8][64] = +CONSTANT_AS CONSTSPEC u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m08500_a1-pure.cl b/OpenCL/m08500_a1-pure.cl index d7b02244b..74b1c77a5 100644 --- a/OpenCL/m08500_a1-pure.cl +++ b/OpenCL/m08500_a1-pure.cl @@ -50,7 +50,7 @@ PERM_OP (l, r, tt, 4, 0x0f0f0f0f); \ } -CONSTANT_AS u32a c_ascii_to_ebcdic_pc[256] = +CONSTANT_AS CONSTSPEC u32a c_ascii_to_ebcdic_pc[256] = { // little hack, can't crack 0-bytes in password, but who cares // 0xab, 0xa8, 0xae, 0xad, 0xc4, 0xf1, 0xf7, 0xf4, 0x86, 0xa1, 0xe0, 0xbc, 0xb3, 0xb0, 0xb6, 0xb5, @@ -72,7 +72,7 @@ CONSTANT_AS u32a c_ascii_to_ebcdic_pc[256] = 0x13, 0x10, 0x16, 0x15, 0x7f, 0x7c, 0x73, 0x70, 0x76, 0x75, 0x5e, 0x5d, 0x52, 0x51, 0x57, 0x54, }; -CONSTANT_AS u32a c_SPtrans[8][64] = +CONSTANT_AS CONSTSPEC u32a c_SPtrans[8][64] = { { 0x02080800, 0x00080000, 0x02000002, 0x02080802, @@ -220,7 +220,7 @@ CONSTANT_AS u32a c_SPtrans[8][64] = } }; -CONSTANT_AS u32a c_skb[8][64] = +CONSTANT_AS CONSTSPEC u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m08500_a3-pure.cl b/OpenCL/m08500_a3-pure.cl index 8ae9721c5..f75356739 100644 --- a/OpenCL/m08500_a3-pure.cl +++ b/OpenCL/m08500_a3-pure.cl @@ -50,7 +50,7 @@ PERM_OP (l, r, tt, 4, 0x0f0f0f0f); \ } -CONSTANT_AS u32a c_ascii_to_ebcdic_pc[256] = +CONSTANT_AS CONSTSPEC u32a c_ascii_to_ebcdic_pc[256] = { // little hack, can't crack 0-bytes in password, but who cares // 0xab, 0xa8, 0xae, 0xad, 0xc4, 0xf1, 0xf7, 0xf4, 0x86, 0xa1, 0xe0, 0xbc, 0xb3, 0xb0, 0xb6, 0xb5, @@ -72,7 +72,7 @@ CONSTANT_AS u32a c_ascii_to_ebcdic_pc[256] = 0x13, 0x10, 0x16, 0x15, 0x7f, 0x7c, 0x73, 0x70, 0x76, 0x75, 0x5e, 0x5d, 0x52, 0x51, 0x57, 0x54, }; -CONSTANT_AS u32a c_SPtrans[8][64] = +CONSTANT_AS CONSTSPEC u32a c_SPtrans[8][64] = { { 0x02080800, 0x00080000, 0x02000002, 0x02080802, @@ -220,7 +220,7 @@ CONSTANT_AS u32a c_SPtrans[8][64] = } }; -CONSTANT_AS u32a c_skb[8][64] = +CONSTANT_AS CONSTSPEC u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m08600_a0-pure.cl b/OpenCL/m08600_a0-pure.cl index c88b30787..424914c7a 100644 --- a/OpenCL/m08600_a0-pure.cl +++ b/OpenCL/m08600_a0-pure.cl @@ -15,7 +15,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u32a lotus_magic_table[256] = +CONSTANT_AS CONSTSPEC u32a lotus_magic_table[256] = { 0xbd, 0x56, 0xea, 0xf2, 0xa2, 0xf1, 0xac, 0x2a, 0xb0, 0x93, 0xd1, 0x9c, 0x1b, 0x33, 0xfd, 0xd0, diff --git a/OpenCL/m08600_a1-pure.cl b/OpenCL/m08600_a1-pure.cl index 5253d21dd..068103ba4 100644 --- a/OpenCL/m08600_a1-pure.cl +++ b/OpenCL/m08600_a1-pure.cl @@ -13,7 +13,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u32a lotus_magic_table[256] = +CONSTANT_AS CONSTSPEC u32a lotus_magic_table[256] = { 0xbd, 0x56, 0xea, 0xf2, 0xa2, 0xf1, 0xac, 0x2a, 0xb0, 0x93, 0xd1, 0x9c, 0x1b, 0x33, 0xfd, 0xd0, diff --git a/OpenCL/m08600_a3-pure.cl b/OpenCL/m08600_a3-pure.cl index cd596b5c0..8b535786f 100644 --- a/OpenCL/m08600_a3-pure.cl +++ b/OpenCL/m08600_a3-pure.cl @@ -12,7 +12,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u32a lotus_magic_table[256] = +CONSTANT_AS CONSTSPEC u32a lotus_magic_table[256] = { 0xbd, 0x56, 0xea, 0xf2, 0xa2, 0xf1, 0xac, 0x2a, 0xb0, 0x93, 0xd1, 0x9c, 0x1b, 0x33, 0xfd, 0xd0, diff --git a/OpenCL/m08700_a0-optimized.cl b/OpenCL/m08700_a0-optimized.cl index a27ea84fe..6220f6d0e 100644 --- a/OpenCL/m08700_a0-optimized.cl +++ b/OpenCL/m08700_a0-optimized.cl @@ -15,7 +15,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u32a lotus_magic_table[256] = +CONSTANT_AS CONSTSPEC u32a lotus_magic_table[256] = { 0xbd, 0x56, 0xea, 0xf2, 0xa2, 0xf1, 0xac, 0x2a, 0xb0, 0x93, 0xd1, 0x9c, 0x1b, 0x33, 0xfd, 0xd0, @@ -338,7 +338,7 @@ KERNEL_FQ void m08700_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * domino @@ -537,7 +537,7 @@ KERNEL_FQ void m08700_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * domino diff --git a/OpenCL/m08700_a1-optimized.cl b/OpenCL/m08700_a1-optimized.cl index 2041e3f5d..baa84c1e7 100644 --- a/OpenCL/m08700_a1-optimized.cl +++ b/OpenCL/m08700_a1-optimized.cl @@ -13,7 +13,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u32a lotus_magic_table[256] = +CONSTANT_AS CONSTSPEC u32a lotus_magic_table[256] = { 0xbd, 0x56, 0xea, 0xf2, 0xa2, 0xf1, 0xac, 0x2a, 0xb0, 0x93, 0xd1, 0x9c, 0x1b, 0x33, 0xfd, 0xd0, diff --git a/OpenCL/m08700_a3-optimized.cl b/OpenCL/m08700_a3-optimized.cl index 897bc16c5..0007d366b 100644 --- a/OpenCL/m08700_a3-optimized.cl +++ b/OpenCL/m08700_a3-optimized.cl @@ -12,7 +12,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u32a lotus_magic_table[256] = +CONSTANT_AS CONSTSPEC u32a lotus_magic_table[256] = { 0xbd, 0x56, 0xea, 0xf2, 0xa2, 0xf1, 0xac, 0x2a, 0xb0, 0x93, 0xd1, 0x9c, 0x1b, 0x33, 0xfd, 0xd0, diff --git a/OpenCL/m08900-pure.cl b/OpenCL/m08900-pure.cl index 5031cf8bc..dfec8b535 100644 --- a/OpenCL/m08900-pure.cl +++ b/OpenCL/m08900-pure.cl @@ -135,7 +135,7 @@ DECLSPEC void salsa_r (uint4 *TI) } } -DECLSPEC void scrypt_smix (uint4 *X, uint4 *T, GLOBAL_AS uint4 * restrict V0, GLOBAL_AS uint4 * restrict V1, GLOBAL_AS uint4 * restrict V2, GLOBAL_AS uint4 * restrict V3) +DECLSPEC void scrypt_smix (uint4 *X, uint4 *T, GLOBAL_AS uint4 *V0, GLOBAL_AS uint4 *V1, GLOBAL_AS uint4 *V2, GLOBAL_AS uint4 *V3) { #define Coord(xd4,y,z) (((xd4) * ySIZE * zSIZE) + ((y) * zSIZE) + (z)) #define CO Coord(xd4,y,z) @@ -148,7 +148,7 @@ DECLSPEC void scrypt_smix (uint4 *X, uint4 *T, GLOBAL_AS uint4 * restrict V0, GL const u32 xd4 = x / 4; const u32 xm4 = x & 3; - GLOBAL_AS uint4 * restrict V; + GLOBAL_AS uint4 *V; switch (xm4) { @@ -286,10 +286,10 @@ KERNEL_FQ void m08900_loop (KERN_ATTR_TMPS (scrypt_tmp_t)) if (gid >= gid_max) return; - GLOBAL_AS uint4 * restrict d_scrypt0_buf = d_extra0_buf; - GLOBAL_AS uint4 * restrict d_scrypt1_buf = d_extra1_buf; - GLOBAL_AS uint4 * restrict d_scrypt2_buf = d_extra2_buf; - GLOBAL_AS uint4 * restrict d_scrypt3_buf = d_extra3_buf; + GLOBAL_AS uint4 *d_scrypt0_buf = d_extra0_buf; + GLOBAL_AS uint4 *d_scrypt1_buf = d_extra1_buf; + GLOBAL_AS uint4 *d_scrypt2_buf = d_extra2_buf; + GLOBAL_AS uint4 *d_scrypt3_buf = d_extra3_buf; uint4 X[STATE_CNT4]; uint4 T[STATE_CNT4]; diff --git a/OpenCL/m09000-pure.cl b/OpenCL/m09000-pure.cl index e9bce68b7..8d3f2d6de 100644 --- a/OpenCL/m09000-pure.cl +++ b/OpenCL/m09000-pure.cl @@ -28,7 +28,7 @@ typedef struct pwsafe2_tmp // http://www.schneier.com/code/constants.txt -CONSTANT_AS u32a c_sbox0[256] = +CONSTANT_AS CONSTSPEC u32a c_sbox0[256] = { 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, @@ -96,7 +96,7 @@ CONSTANT_AS u32a c_sbox0[256] = 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a }; -CONSTANT_AS u32a c_sbox1[256] = +CONSTANT_AS CONSTSPEC u32a c_sbox1[256] = { 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, @@ -164,7 +164,7 @@ CONSTANT_AS u32a c_sbox1[256] = 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7 }; -CONSTANT_AS u32a c_sbox2[256] = +CONSTANT_AS CONSTSPEC u32a c_sbox2[256] = { 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, @@ -232,7 +232,7 @@ CONSTANT_AS u32a c_sbox2[256] = 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0 }; -CONSTANT_AS u32a c_sbox3[256] = +CONSTANT_AS CONSTSPEC u32a c_sbox3[256] = { 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, @@ -300,7 +300,7 @@ CONSTANT_AS u32a c_sbox3[256] = 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6 }; -CONSTANT_AS u32a c_pbox[18] = +CONSTANT_AS CONSTSPEC u32a c_pbox[18] = { 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, diff --git a/OpenCL/m09100-pure.cl b/OpenCL/m09100-pure.cl index 6c10b90ff..574dd5fe9 100644 --- a/OpenCL/m09100-pure.cl +++ b/OpenCL/m09100-pure.cl @@ -26,7 +26,7 @@ typedef struct lotus8_tmp } lotus8_tmp_t; -CONSTANT_AS u32 lotus64_table[64] = +CONSTANT_AS CONSTSPEC u32a lotus64_table[64] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', @@ -38,7 +38,7 @@ CONSTANT_AS u32 lotus64_table[64] = 'u', 'v', 'w', 'x', 'y', 'z', '+', '/', }; -CONSTANT_AS u32 lotus_magic_table[256] = +CONSTANT_AS CONSTSPEC u32a lotus_magic_table[256] = { 0xbd, 0x56, 0xea, 0xf2, 0xa2, 0xf1, 0xac, 0x2a, 0xb0, 0x93, 0xd1, 0x9c, 0x1b, 0x33, 0xfd, 0xd0, @@ -78,7 +78,7 @@ CONSTANT_AS u32 lotus_magic_table[256] = #define BOX1(S,i) (S)[(i)] -DECLSPEC void lotus_mix (u32 *in, const LOCAL_AS u32 *s_lotus_magic_table) +DECLSPEC void lotus_mix (u32 *in, LOCAL_AS const u32 *s_lotus_magic_table) { u8 p = 0; @@ -101,7 +101,7 @@ DECLSPEC void lotus_mix (u32 *in, const LOCAL_AS u32 *s_lotus_magic_table) } } -DECLSPEC void lotus_transform_password (const u32 *in, u32 *out, const LOCAL_AS u32 *s_lotus_magic_table) +DECLSPEC void lotus_transform_password (const u32 *in, u32 *out, LOCAL_AS const u32 *s_lotus_magic_table) { u8 t = (u8) (out[3] >> 24); @@ -198,7 +198,7 @@ DECLSPEC void pad (u32 *w, const u32 len) } } -DECLSPEC void mdtransform_norecalc (u32 *state, const u32 *block, const LOCAL_AS u32 *s_lotus_magic_table) +DECLSPEC void mdtransform_norecalc (u32 *state, const u32 *block, LOCAL_AS const u32 *s_lotus_magic_table) { u32 x[12]; @@ -223,14 +223,14 @@ DECLSPEC void mdtransform_norecalc (u32 *state, const u32 *block, const LOCAL_AS state[3] = x[3]; } -DECLSPEC void mdtransform (u32 *state, u32 *checksum, const u32 *block, const LOCAL_AS u32 *s_lotus_magic_table) +DECLSPEC void mdtransform (u32 *state, u32 *checksum, const u32 *block, LOCAL_AS const u32 *s_lotus_magic_table) { mdtransform_norecalc (state, block, s_lotus_magic_table); lotus_transform_password (block, checksum, s_lotus_magic_table); } -DECLSPEC void domino_big_md (const u32 *saved_key, const u32 size, u32 *state, const LOCAL_AS u32 *s_lotus_magic_table) +DECLSPEC void domino_big_md (const u32 *saved_key, const u32 size, u32 *state, LOCAL_AS const u32 *s_lotus_magic_table) { u32 checksum[4]; diff --git a/OpenCL/m09700_a0-optimized.cl b/OpenCL/m09700_a0-optimized.cl index b759df41e..10aca4c5b 100644 --- a/OpenCL/m09700_a0-optimized.cl +++ b/OpenCL/m09700_a0-optimized.cl @@ -565,7 +565,7 @@ KERNEL_FQ void m09700_m04 (KERN_ATTR_RULES_ESALT (oldoffice01_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -766,7 +766,7 @@ KERNEL_FQ void m09700_s04 (KERN_ATTR_RULES_ESALT (oldoffice01_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m09710_a0-optimized.cl b/OpenCL/m09710_a0-optimized.cl index bf826d3fc..5b92458e2 100644 --- a/OpenCL/m09710_a0-optimized.cl +++ b/OpenCL/m09710_a0-optimized.cl @@ -210,7 +210,7 @@ KERNEL_FQ void m09710_m04 (KERN_ATTR_RULES_ESALT (oldoffice01_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * md5 @@ -362,7 +362,7 @@ KERNEL_FQ void m09710_s04 (KERN_ATTR_RULES_ESALT (oldoffice01_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * md5 diff --git a/OpenCL/m09720_a0-optimized.cl b/OpenCL/m09720_a0-optimized.cl index dfd3f6b3f..f304a0dfb 100644 --- a/OpenCL/m09720_a0-optimized.cl +++ b/OpenCL/m09720_a0-optimized.cl @@ -420,7 +420,7 @@ KERNEL_FQ void m09720_m04 (KERN_ATTR_RULES_ESALT (oldoffice01_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -538,7 +538,7 @@ KERNEL_FQ void m09720_s04 (KERN_ATTR_RULES_ESALT (oldoffice01_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m09800_a0-optimized.cl b/OpenCL/m09800_a0-optimized.cl index fc6c2b247..0ab96faab 100644 --- a/OpenCL/m09800_a0-optimized.cl +++ b/OpenCL/m09800_a0-optimized.cl @@ -221,7 +221,7 @@ KERNEL_FQ void m09800_m04 (KERN_ATTR_RULES_ESALT (oldoffice34_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -433,7 +433,7 @@ KERNEL_FQ void m09800_s04 (KERN_ATTR_RULES_ESALT (oldoffice34_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m09810_a0-optimized.cl b/OpenCL/m09810_a0-optimized.cl index 902063c4a..e2b5e9510 100644 --- a/OpenCL/m09810_a0-optimized.cl +++ b/OpenCL/m09810_a0-optimized.cl @@ -210,7 +210,7 @@ KERNEL_FQ void m09810_m04 (KERN_ATTR_RULES_ESALT (oldoffice34_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * RC4 + SHA1 @@ -349,7 +349,7 @@ KERNEL_FQ void m09810_s04 (KERN_ATTR_RULES_ESALT (oldoffice34_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * RC4 + SHA1 diff --git a/OpenCL/m09820_a0-optimized.cl b/OpenCL/m09820_a0-optimized.cl index 0b0180102..cfb6bdf6c 100644 --- a/OpenCL/m09820_a0-optimized.cl +++ b/OpenCL/m09820_a0-optimized.cl @@ -76,7 +76,7 @@ KERNEL_FQ void m09820_m04 (KERN_ATTR_RULES_ESALT (oldoffice34_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -222,7 +222,7 @@ KERNEL_FQ void m09820_s04 (KERN_ATTR_RULES_ESALT (oldoffice34_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m09900_a0-optimized.cl b/OpenCL/m09900_a0-optimized.cl index a8a8a1d6a..31db1fa4b 100644 --- a/OpenCL/m09900_a0-optimized.cl +++ b/OpenCL/m09900_a0-optimized.cl @@ -56,7 +56,7 @@ KERNEL_FQ void m09900_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * md5 @@ -302,7 +302,7 @@ KERNEL_FQ void m09900_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * md5 diff --git a/OpenCL/m10100_a0-optimized.cl b/OpenCL/m10100_a0-optimized.cl index ca3371471..c9307dfd5 100644 --- a/OpenCL/m10100_a0-optimized.cl +++ b/OpenCL/m10100_a0-optimized.cl @@ -86,7 +86,7 @@ KERNEL_FQ void m10100_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * siphash @@ -225,7 +225,7 @@ KERNEL_FQ void m10100_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * siphash diff --git a/OpenCL/m10400_a0-optimized.cl b/OpenCL/m10400_a0-optimized.cl index 04b911c2c..d6e35786c 100644 --- a/OpenCL/m10400_a0-optimized.cl +++ b/OpenCL/m10400_a0-optimized.cl @@ -16,7 +16,7 @@ #include "inc_hash_md5.cl" #endif -CONSTANT_AS u32a padding[8] = +CONSTANT_AS CONSTSPEC u32a padding[8] = { 0x5e4ebf28, 0x418a754e, @@ -104,7 +104,7 @@ DECLSPEC void rc4_init_16 (LOCAL_AS RC4_KEY *rc4_key, const u32 *data) j += rc4_key->S[255] + d0; swap (rc4_key, 255, j); } -DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, CONSTANT_AS u32 *in, u32 *out) +DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, CONSTANT_AS u32a *in, u32 *out) { #ifdef _unroll #pragma unroll @@ -230,7 +230,7 @@ KERNEL_FQ void m10400_m04 (KERN_ATTR_RULES_ESALT (pdf_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * pdf @@ -418,7 +418,7 @@ KERNEL_FQ void m10400_s04 (KERN_ATTR_RULES_ESALT (pdf_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * pdf diff --git a/OpenCL/m10400_a1-optimized.cl b/OpenCL/m10400_a1-optimized.cl index b1a1f2dfa..1900f3f17 100644 --- a/OpenCL/m10400_a1-optimized.cl +++ b/OpenCL/m10400_a1-optimized.cl @@ -14,7 +14,7 @@ #include "inc_hash_md5.cl" #endif -CONSTANT_AS u32a padding[8] = +CONSTANT_AS CONSTSPEC u32a padding[8] = { 0x5e4ebf28, 0x418a754e, @@ -102,7 +102,7 @@ DECLSPEC void rc4_init_16 (LOCAL_AS RC4_KEY *rc4_key, const u32 *data) j += rc4_key->S[255] + d0; swap (rc4_key, 255, j); } -DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, CONSTANT_AS u32 *in, u32 *out) +DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, CONSTANT_AS u32a *in, u32 *out) { #ifdef _unroll #pragma unroll diff --git a/OpenCL/m10400_a3-optimized.cl b/OpenCL/m10400_a3-optimized.cl index 8d07529a0..70e56f1f2 100644 --- a/OpenCL/m10400_a3-optimized.cl +++ b/OpenCL/m10400_a3-optimized.cl @@ -14,7 +14,7 @@ #include "inc_hash_md5.cl" #endif -CONSTANT_AS u32a padding[8] = +CONSTANT_AS CONSTSPEC u32a padding[8] = { 0x5e4ebf28, 0x418a754e, @@ -102,7 +102,7 @@ DECLSPEC void rc4_init_16 (LOCAL_AS RC4_KEY *rc4_key, const u32 *data) j += rc4_key->S[255] + d0; swap (rc4_key, 255, j); } -DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, CONSTANT_AS u32 *in, u32 *out) +DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, CONSTANT_AS u32a *in, u32 *out) { #ifdef _unroll #pragma unroll diff --git a/OpenCL/m10410_a0-optimized.cl b/OpenCL/m10410_a0-optimized.cl index c75fb1193..94de39f18 100644 --- a/OpenCL/m10410_a0-optimized.cl +++ b/OpenCL/m10410_a0-optimized.cl @@ -16,7 +16,7 @@ #include "inc_hash_md5.cl" #endif -CONSTANT_AS u32a padding[8] = +CONSTANT_AS CONSTSPEC u32a padding[8] = { 0x5e4ebf28, 0x418a754e, @@ -104,7 +104,7 @@ DECLSPEC void rc4_init_16 (LOCAL_AS RC4_KEY *rc4_key, const u32 *data) j += rc4_key->S[255] + d0; swap (rc4_key, 255, j); } -DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, CONSTANT_AS u32 *in, u32 *out) +DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, CONSTANT_AS u32a *in, u32 *out) { #ifdef _unroll #pragma unroll @@ -205,7 +205,7 @@ KERNEL_FQ void m10410_m04 (KERN_ATTR_RULES_ESALT (pdf_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * pdf @@ -289,7 +289,7 @@ KERNEL_FQ void m10410_s04 (KERN_ATTR_RULES_ESALT (pdf_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * pdf diff --git a/OpenCL/m10410_a1-optimized.cl b/OpenCL/m10410_a1-optimized.cl index 4cd413f14..f5622b1c2 100644 --- a/OpenCL/m10410_a1-optimized.cl +++ b/OpenCL/m10410_a1-optimized.cl @@ -14,7 +14,7 @@ #include "inc_hash_md5.cl" #endif -CONSTANT_AS u32a padding[8] = +CONSTANT_AS CONSTSPEC u32a padding[8] = { 0x5e4ebf28, 0x418a754e, @@ -102,7 +102,7 @@ DECLSPEC void rc4_init_16 (LOCAL_AS RC4_KEY *rc4_key, const u32 *data) j += rc4_key->S[255] + d0; swap (rc4_key, 255, j); } -DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, CONSTANT_AS u32 *in, u32 *out) +DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, CONSTANT_AS u32a *in, u32 *out) { #ifdef _unroll #pragma unroll diff --git a/OpenCL/m10410_a3-optimized.cl b/OpenCL/m10410_a3-optimized.cl index c8897bbed..1f699248a 100644 --- a/OpenCL/m10410_a3-optimized.cl +++ b/OpenCL/m10410_a3-optimized.cl @@ -14,7 +14,7 @@ #include "inc_hash_md5.cl" #endif -CONSTANT_AS u32a padding[8] = +CONSTANT_AS CONSTSPEC u32a padding[8] = { 0x5e4ebf28, 0x418a754e, @@ -102,7 +102,7 @@ DECLSPEC void rc4_init_16 (LOCAL_AS RC4_KEY *rc4_key, const u32 *data) j += rc4_key->S[255] + d0; swap (rc4_key, 255, j); } -DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, CONSTANT_AS u32 *in, u32 *out) +DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, CONSTANT_AS u32a *in, u32 *out) { #ifdef _unroll #pragma unroll diff --git a/OpenCL/m10420_a0-optimized.cl b/OpenCL/m10420_a0-optimized.cl index b1f8a6ef4..a4585c2bf 100644 --- a/OpenCL/m10420_a0-optimized.cl +++ b/OpenCL/m10420_a0-optimized.cl @@ -15,7 +15,7 @@ #include "inc_hash_md5.cl" #endif -CONSTANT_AS u32a padding[8] = +CONSTANT_AS CONSTSPEC u32a padding[8] = { 0x5e4ebf28, 0x418a754e, @@ -113,7 +113,7 @@ KERNEL_FQ void m10420_m04 (KERN_ATTR_RULES_ESALT (pdf_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * pdf @@ -286,7 +286,7 @@ KERNEL_FQ void m10420_s04 (KERN_ATTR_RULES_ESALT (pdf_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * pdf diff --git a/OpenCL/m10420_a1-optimized.cl b/OpenCL/m10420_a1-optimized.cl index cbde1f143..aff8ec254 100644 --- a/OpenCL/m10420_a1-optimized.cl +++ b/OpenCL/m10420_a1-optimized.cl @@ -13,7 +13,7 @@ #include "inc_hash_md5.cl" #endif -CONSTANT_AS u32a padding[8] = +CONSTANT_AS CONSTSPEC u32a padding[8] = { 0x5e4ebf28, 0x418a754e, diff --git a/OpenCL/m10420_a3-optimized.cl b/OpenCL/m10420_a3-optimized.cl index 815e59a15..81f38f3d8 100644 --- a/OpenCL/m10420_a3-optimized.cl +++ b/OpenCL/m10420_a3-optimized.cl @@ -13,7 +13,7 @@ #include "inc_hash_md5.cl" #endif -CONSTANT_AS u32a padding[8] = +CONSTANT_AS CONSTSPEC u32a padding[8] = { 0x5e4ebf28, 0x418a754e, diff --git a/OpenCL/m10500-pure.cl b/OpenCL/m10500-pure.cl index 3ba4e85a4..3c240f8c5 100644 --- a/OpenCL/m10500-pure.cl +++ b/OpenCL/m10500-pure.cl @@ -13,7 +13,7 @@ #define COMPARE_S "inc_comp_single.cl" #define COMPARE_M "inc_comp_multi.cl" -CONSTANT_AS u32a padding[8] = +CONSTANT_AS CONSTSPEC u32a padding[8] = { 0x5e4ebf28, 0x418a754e, diff --git a/OpenCL/m10800_a0-optimized.cl b/OpenCL/m10800_a0-optimized.cl index 0ab27917e..aaf1a8bd1 100644 --- a/OpenCL/m10800_a0-optimized.cl +++ b/OpenCL/m10800_a0-optimized.cl @@ -155,7 +155,7 @@ KERNEL_FQ void m10800_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -268,7 +268,7 @@ KERNEL_FQ void m10800_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m11000_a0-optimized.cl b/OpenCL/m11000_a0-optimized.cl index 017a09b0e..ba14d4fd0 100644 --- a/OpenCL/m11000_a0-optimized.cl +++ b/OpenCL/m11000_a0-optimized.cl @@ -84,7 +84,7 @@ KERNEL_FQ void m11000_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -393,7 +393,7 @@ KERNEL_FQ void m11000_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m11100_a0-optimized.cl b/OpenCL/m11100_a0-optimized.cl index 7316a8865..7b2319f41 100644 --- a/OpenCL/m11100_a0-optimized.cl +++ b/OpenCL/m11100_a0-optimized.cl @@ -111,7 +111,7 @@ KERNEL_FQ void m11100_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * append the salt @@ -457,7 +457,7 @@ KERNEL_FQ void m11100_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * append the salt diff --git a/OpenCL/m11200_a0-optimized.cl b/OpenCL/m11200_a0-optimized.cl index ab5922ecd..2081da572 100644 --- a/OpenCL/m11200_a0-optimized.cl +++ b/OpenCL/m11200_a0-optimized.cl @@ -68,7 +68,7 @@ KERNEL_FQ void m11200_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -542,7 +542,7 @@ KERNEL_FQ void m11200_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m11500_a0-optimized.cl b/OpenCL/m11500_a0-optimized.cl index ca35a931c..4fb310f12 100644 --- a/OpenCL/m11500_a0-optimized.cl +++ b/OpenCL/m11500_a0-optimized.cl @@ -15,7 +15,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u32a crc32tab[0x100] = +CONSTANT_AS CONSTSPEC u32a crc32tab[0x100] = { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, @@ -173,7 +173,7 @@ KERNEL_FQ void m11500_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * crc32 @@ -273,7 +273,7 @@ KERNEL_FQ void m11500_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * crc32 diff --git a/OpenCL/m11500_a1-optimized.cl b/OpenCL/m11500_a1-optimized.cl index bede0d4f1..9ee7a3597 100644 --- a/OpenCL/m11500_a1-optimized.cl +++ b/OpenCL/m11500_a1-optimized.cl @@ -13,7 +13,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u32a crc32tab[0x100] = +CONSTANT_AS CONSTSPEC u32a crc32tab[0x100] = { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, diff --git a/OpenCL/m11500_a3-optimized.cl b/OpenCL/m11500_a3-optimized.cl index 70af7777a..8a3e08d88 100644 --- a/OpenCL/m11500_a3-optimized.cl +++ b/OpenCL/m11500_a3-optimized.cl @@ -13,7 +13,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u32a crc32tab[0x100] = +CONSTANT_AS CONSTSPEC u32a crc32tab[0x100] = { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, diff --git a/OpenCL/m11700_a0-optimized.cl b/OpenCL/m11700_a0-optimized.cl index 7422f6197..879c5dfeb 100644 --- a/OpenCL/m11700_a0-optimized.cl +++ b/OpenCL/m11700_a0-optimized.cl @@ -147,7 +147,7 @@ KERNEL_FQ void m11700_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x01_2x4_VV (w0, w1, out_len); @@ -317,7 +317,7 @@ KERNEL_FQ void m11700_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x01_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m11800_a0-optimized.cl b/OpenCL/m11800_a0-optimized.cl index 09b437d17..0a3ffd6bc 100644 --- a/OpenCL/m11800_a0-optimized.cl +++ b/OpenCL/m11800_a0-optimized.cl @@ -147,7 +147,7 @@ KERNEL_FQ void m11800_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x01_2x4_VV (w0, w1, out_len); @@ -317,7 +317,7 @@ KERNEL_FQ void m11800_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x01_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m12400-pure.cl b/OpenCL/m12400-pure.cl index c83d006ef..aa944c43b 100644 --- a/OpenCL/m12400-pure.cl +++ b/OpenCL/m12400-pure.cl @@ -59,7 +59,7 @@ typedef struct bsdicrypt_tmp PERM_OP (l, r, tt, 4, 0x0f0f0f0f); \ } -CONSTANT_AS u32a c_SPtrans[8][64] = +CONSTANT_AS CONSTSPEC u32a c_SPtrans[8][64] = { { 0x00820200, 0x00020000, 0x80800000, 0x80820200, @@ -207,7 +207,7 @@ CONSTANT_AS u32a c_SPtrans[8][64] = }, }; -CONSTANT_AS u32a c_skb[8][64] = +CONSTANT_AS CONSTSPEC u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m12600_a0-optimized.cl b/OpenCL/m12600_a0-optimized.cl index d098a74da..6106316ec 100644 --- a/OpenCL/m12600_a0-optimized.cl +++ b/OpenCL/m12600_a0-optimized.cl @@ -101,7 +101,7 @@ KERNEL_FQ void m12600_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -453,7 +453,7 @@ KERNEL_FQ void m12600_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m13100_a0-optimized.cl b/OpenCL/m13100_a0-optimized.cl index 43c313317..a42ff481e 100644 --- a/OpenCL/m13100_a0-optimized.cl +++ b/OpenCL/m13100_a0-optimized.cl @@ -96,7 +96,7 @@ DECLSPEC void rc4_init_16 (LOCAL_AS RC4_KEY *rc4_key, const u32 *data) } } -DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, const GLOBAL_AS u32 *in, u32 *out) +DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, GLOBAL_AS const u32 *in, u32 *out) { #ifdef _unroll #pragma unroll @@ -635,7 +635,7 @@ KERNEL_FQ void m13100_m04 (KERN_ATTR_RULES_ESALT (krb5tgs_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * kerberos @@ -733,7 +733,7 @@ KERNEL_FQ void m13100_s04 (KERN_ATTR_RULES_ESALT (krb5tgs_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * kerberos diff --git a/OpenCL/m13100_a0-pure.cl b/OpenCL/m13100_a0-pure.cl index d33a7b3e6..77e57e970 100644 --- a/OpenCL/m13100_a0-pure.cl +++ b/OpenCL/m13100_a0-pure.cl @@ -95,7 +95,7 @@ DECLSPEC void rc4_init_16 (LOCAL_AS RC4_KEY *rc4_key, const u32 *data) } } -DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, const GLOBAL_AS u32 *in, u32 *out) +DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, GLOBAL_AS const u32 *in, u32 *out) { #ifdef _unroll #pragma unroll diff --git a/OpenCL/m13100_a1-optimized.cl b/OpenCL/m13100_a1-optimized.cl index 0b384800f..c153b1033 100644 --- a/OpenCL/m13100_a1-optimized.cl +++ b/OpenCL/m13100_a1-optimized.cl @@ -94,7 +94,7 @@ DECLSPEC void rc4_init_16 (LOCAL_AS RC4_KEY *rc4_key, const u32 *data) } } -DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, const GLOBAL_AS u32 *in, u32 *out) +DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, GLOBAL_AS const u32 *in, u32 *out) { #ifdef _unroll #pragma unroll diff --git a/OpenCL/m13100_a1-pure.cl b/OpenCL/m13100_a1-pure.cl index e6ec0315a..c84fab54e 100644 --- a/OpenCL/m13100_a1-pure.cl +++ b/OpenCL/m13100_a1-pure.cl @@ -93,7 +93,7 @@ DECLSPEC void rc4_init_16 (LOCAL_AS RC4_KEY *rc4_key, const u32 *data) } } -DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, const GLOBAL_AS u32 *in, u32 *out) +DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, GLOBAL_AS const u32 *in, u32 *out) { #ifdef _unroll #pragma unroll diff --git a/OpenCL/m13100_a3-optimized.cl b/OpenCL/m13100_a3-optimized.cl index 7526a7459..81b94bf9b 100644 --- a/OpenCL/m13100_a3-optimized.cl +++ b/OpenCL/m13100_a3-optimized.cl @@ -94,7 +94,7 @@ DECLSPEC void rc4_init_16 (LOCAL_AS RC4_KEY *rc4_key, const u32 *data) } } -DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, const GLOBAL_AS u32 *in, u32 *out) +DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, GLOBAL_AS const u32 *in, u32 *out) { #ifdef _unroll #pragma unroll diff --git a/OpenCL/m13100_a3-pure.cl b/OpenCL/m13100_a3-pure.cl index f12b3d244..147474467 100644 --- a/OpenCL/m13100_a3-pure.cl +++ b/OpenCL/m13100_a3-pure.cl @@ -93,7 +93,7 @@ DECLSPEC void rc4_init_16 (LOCAL_AS RC4_KEY *rc4_key, const u32 *data) } } -DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, const GLOBAL_AS u32 *in, u32 *out) +DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, GLOBAL_AS const u32 *in, u32 *out) { #ifdef _unroll #pragma unroll diff --git a/OpenCL/m13300_a0-optimized.cl b/OpenCL/m13300_a0-optimized.cl index 1cf01db29..42cca5d27 100644 --- a/OpenCL/m13300_a0-optimized.cl +++ b/OpenCL/m13300_a0-optimized.cl @@ -56,7 +56,7 @@ KERNEL_FQ void m13300_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -255,7 +255,7 @@ KERNEL_FQ void m13300_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m13500_a0-optimized.cl b/OpenCL/m13500_a0-optimized.cl index e7adb69d7..bd3268abf 100644 --- a/OpenCL/m13500_a0-optimized.cl +++ b/OpenCL/m13500_a0-optimized.cl @@ -107,7 +107,7 @@ KERNEL_FQ void m13500_m04 (KERN_ATTR_RULES_ESALT (pstoken_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -544,7 +544,7 @@ KERNEL_FQ void m13500_s04 (KERN_ATTR_RULES_ESALT (pstoken_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m13800_a0-optimized.cl b/OpenCL/m13800_a0-optimized.cl index 31f729e27..c12745182 100644 --- a/OpenCL/m13800_a0-optimized.cl +++ b/OpenCL/m13800_a0-optimized.cl @@ -456,7 +456,7 @@ KERNEL_FQ void m13800_m04 (KERN_ATTR_RULES_ESALT (win8phone_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); const u32x out_len2 = out_len * 2; @@ -664,7 +664,7 @@ KERNEL_FQ void m13800_s04 (KERN_ATTR_RULES_ESALT (win8phone_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); const u32x out_len2 = out_len * 2; diff --git a/OpenCL/m13900_a0-optimized.cl b/OpenCL/m13900_a0-optimized.cl index d9d369b75..4dce764dc 100644 --- a/OpenCL/m13900_a0-optimized.cl +++ b/OpenCL/m13900_a0-optimized.cl @@ -97,7 +97,7 @@ KERNEL_FQ void m13900_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -336,7 +336,7 @@ KERNEL_FQ void m13900_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m14000_a0-pure.cl b/OpenCL/m14000_a0-pure.cl index 2b8281246..0602d60dc 100644 --- a/OpenCL/m14000_a0-pure.cl +++ b/OpenCL/m14000_a0-pure.cl @@ -52,7 +52,7 @@ PERM_OP (l, r, tt, 4, 0x0f0f0f0f); \ } -CONSTANT_AS u32a c_SPtrans[8][64] = +CONSTANT_AS CONSTSPEC u32a c_SPtrans[8][64] = { { /* nibble 0 */ @@ -208,7 +208,7 @@ CONSTANT_AS u32a c_SPtrans[8][64] = }, }; -CONSTANT_AS u32a c_skb[8][64] = +CONSTANT_AS CONSTSPEC u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, @@ -576,7 +576,7 @@ KERNEL_FQ void m14000_mxx (KERN_ATTR_RULES ()) u32 w2[4] = { 0 }; u32 w3[4] = { 0 }; - apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); const u32 c = w0[0]; const u32 d = w0[1]; @@ -693,7 +693,7 @@ KERNEL_FQ void m14000_sxx (KERN_ATTR_RULES ()) u32 w2[4] = { 0 }; u32 w3[4] = { 0 }; - apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); const u32 c = w0[0]; const u32 d = w0[1]; diff --git a/OpenCL/m14000_a1-pure.cl b/OpenCL/m14000_a1-pure.cl index 38367ff6a..cebfcdfdc 100644 --- a/OpenCL/m14000_a1-pure.cl +++ b/OpenCL/m14000_a1-pure.cl @@ -50,7 +50,7 @@ PERM_OP (l, r, tt, 4, 0x0f0f0f0f); \ } -CONSTANT_AS u32a c_SPtrans[8][64] = +CONSTANT_AS CONSTSPEC u32a c_SPtrans[8][64] = { { 0x02080800, 0x00080000, 0x02000002, 0x02080802, @@ -198,7 +198,7 @@ CONSTANT_AS u32a c_SPtrans[8][64] = } }; -CONSTANT_AS u32a c_skb[8][64] = +CONSTANT_AS CONSTSPEC u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m14000_a3-pure.cl b/OpenCL/m14000_a3-pure.cl index dd7ce2b51..1e9b51d26 100644 --- a/OpenCL/m14000_a3-pure.cl +++ b/OpenCL/m14000_a3-pure.cl @@ -1730,7 +1730,7 @@ DECLSPEC void transpose32c (u32 *data) // transpose bitslice mod : attention race conditions, need different buffers for *in and *out // -KERNEL_FQ void m14000_tm (GLOBAL_AS u32 * restrict mod, GLOBAL_AS bs_word_t * restrict words_buf_r) +KERNEL_FQ void m14000_tm (GLOBAL_AS u32 *mod, GLOBAL_AS bs_word_t *words_buf_r) { const u64 gid = get_global_id (0); diff --git a/OpenCL/m14100_a0-pure.cl b/OpenCL/m14100_a0-pure.cl index 76caab18d..200f8ab23 100644 --- a/OpenCL/m14100_a0-pure.cl +++ b/OpenCL/m14100_a0-pure.cl @@ -52,7 +52,7 @@ PERM_OP (l, r, tt, 4, 0x0f0f0f0f); \ } -CONSTANT_AS u32a c_SPtrans[8][64] = +CONSTANT_AS CONSTSPEC u32a c_SPtrans[8][64] = { { /* nibble 0 */ @@ -208,7 +208,7 @@ CONSTANT_AS u32a c_SPtrans[8][64] = }, }; -CONSTANT_AS u32a c_skb[8][64] = +CONSTANT_AS CONSTSPEC u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, @@ -620,7 +620,7 @@ KERNEL_FQ void m14100_mxx (KERN_ATTR_RULES ()) u32 w2[4] = { 0 }; u32 w3[4] = { 0 }; - apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /* First Pass */ @@ -767,7 +767,7 @@ KERNEL_FQ void m14100_sxx (KERN_ATTR_RULES ()) u32 w2[4] = { 0 }; u32 w3[4] = { 0 }; - apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /* First Pass */ diff --git a/OpenCL/m14100_a1-pure.cl b/OpenCL/m14100_a1-pure.cl index aa861b19f..98f76dc1c 100644 --- a/OpenCL/m14100_a1-pure.cl +++ b/OpenCL/m14100_a1-pure.cl @@ -50,7 +50,7 @@ PERM_OP (l, r, tt, 4, 0x0f0f0f0f); \ } -CONSTANT_AS u32a c_SPtrans[8][64] = +CONSTANT_AS CONSTSPEC u32a c_SPtrans[8][64] = { { 0x02080800, 0x00080000, 0x02000002, 0x02080802, @@ -198,7 +198,7 @@ CONSTANT_AS u32a c_SPtrans[8][64] = } }; -CONSTANT_AS u32a c_skb[8][64] = +CONSTANT_AS CONSTSPEC u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m14100_a3-pure.cl b/OpenCL/m14100_a3-pure.cl index 1943413a8..47a83d0db 100644 --- a/OpenCL/m14100_a3-pure.cl +++ b/OpenCL/m14100_a3-pure.cl @@ -50,7 +50,7 @@ PERM_OP (l, r, tt, 4, 0x0f0f0f0f); \ } -CONSTANT_AS u32a c_SPtrans[8][64] = +CONSTANT_AS CONSTSPEC u32a c_SPtrans[8][64] = { { 0x02080800, 0x00080000, 0x02000002, 0x02080802, @@ -198,7 +198,7 @@ CONSTANT_AS u32a c_SPtrans[8][64] = } }; -CONSTANT_AS u32a c_skb[8][64] = +CONSTANT_AS CONSTSPEC u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, diff --git a/OpenCL/m14400_a0-optimized.cl b/OpenCL/m14400_a0-optimized.cl index 3ff7e0ba4..f6934b1d0 100644 --- a/OpenCL/m14400_a0-optimized.cl +++ b/OpenCL/m14400_a0-optimized.cl @@ -229,7 +229,7 @@ KERNEL_FQ void m14400_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len_orig = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len_orig = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_4 (out_len_orig, w0, w1, w2, w3, dashes); @@ -512,7 +512,7 @@ KERNEL_FQ void m14400_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len_orig = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len_orig = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_4 (out_len_orig, w0, w1, w2, w3, dashes); diff --git a/OpenCL/m14900_a0-optimized.cl b/OpenCL/m14900_a0-optimized.cl index 03c5c27a9..11b3a9e88 100644 --- a/OpenCL/m14900_a0-optimized.cl +++ b/OpenCL/m14900_a0-optimized.cl @@ -15,7 +15,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u8a c_ftable[256] = +CONSTANT_AS CONSTSPEC u8a c_ftable[256] = { 0xa3, 0xd7, 0x09, 0x83, 0xf8, 0x48, 0xf6, 0xf4, 0xb3, 0x21, 0x15, 0x78, 0x99, 0xb1, 0xaf, 0xf9, @@ -164,7 +164,7 @@ KERNEL_FQ void m14900_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); u32 key[10]; @@ -267,7 +267,7 @@ KERNEL_FQ void m14900_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); u32 key[10]; diff --git a/OpenCL/m14900_a1-optimized.cl b/OpenCL/m14900_a1-optimized.cl index 42c7dd6c9..abeba4e44 100644 --- a/OpenCL/m14900_a1-optimized.cl +++ b/OpenCL/m14900_a1-optimized.cl @@ -13,7 +13,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u8a c_ftable[256] = +CONSTANT_AS CONSTSPEC u8a c_ftable[256] = { 0xa3, 0xd7, 0x09, 0x83, 0xf8, 0x48, 0xf6, 0xf4, 0xb3, 0x21, 0x15, 0x78, 0x99, 0xb1, 0xaf, 0xf9, diff --git a/OpenCL/m14900_a3-optimized.cl b/OpenCL/m14900_a3-optimized.cl index b8a7ce4b1..5de151fc7 100644 --- a/OpenCL/m14900_a3-optimized.cl +++ b/OpenCL/m14900_a3-optimized.cl @@ -13,7 +13,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u8a c_ftable[256] = +CONSTANT_AS CONSTSPEC u8a c_ftable[256] = { 0xa3, 0xd7, 0x09, 0x83, 0xf8, 0x48, 0xf6, 0xf4, 0xb3, 0x21, 0x15, 0x78, 0x99, 0xb1, 0xaf, 0xf9, diff --git a/OpenCL/m15000_a0-optimized.cl b/OpenCL/m15000_a0-optimized.cl index 4d776ce66..428997e98 100644 --- a/OpenCL/m15000_a0-optimized.cl +++ b/OpenCL/m15000_a0-optimized.cl @@ -183,7 +183,7 @@ KERNEL_FQ void m15000_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * append salt @@ -400,7 +400,7 @@ KERNEL_FQ void m15000_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * append salt diff --git a/OpenCL/m15500_a0-optimized.cl b/OpenCL/m15500_a0-optimized.cl index 3d550cb93..6644adc51 100644 --- a/OpenCL/m15500_a0-optimized.cl +++ b/OpenCL/m15500_a0-optimized.cl @@ -70,7 +70,7 @@ KERNEL_FQ void m15500_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); make_utf16be (w1, w2, w3); make_utf16be (w0, w0, w1); @@ -338,7 +338,7 @@ KERNEL_FQ void m15500_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); make_utf16be (w1, w2, w3); make_utf16be (w0, w0, w1); diff --git a/OpenCL/m15600-pure.cl b/OpenCL/m15600-pure.cl index d6aa6fa50..8c3a4cd7c 100644 --- a/OpenCL/m15600-pure.cl +++ b/OpenCL/m15600-pure.cl @@ -33,7 +33,7 @@ typedef struct ethereum_pbkdf2 #define COMPARE_S "inc_comp_single.cl" #define COMPARE_M "inc_comp_multi.cl" -CONSTANT_AS u64a keccakf_rndc[24] = +CONSTANT_AS CONSTSPEC u64a keccakf_rndc[24] = { 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b, 0x0000000080000001, diff --git a/OpenCL/m15700-pure.cl b/OpenCL/m15700-pure.cl index 9bba535fc..73240c363 100644 --- a/OpenCL/m15700-pure.cl +++ b/OpenCL/m15700-pure.cl @@ -142,7 +142,7 @@ DECLSPEC void salsa_r (uint4 *TI) } } -DECLSPEC void scrypt_smix (uint4 *X, uint4 *T, GLOBAL_AS uint4 * restrict V0, GLOBAL_AS uint4 * restrict V1, GLOBAL_AS uint4 * restrict V2, GLOBAL_AS uint4 * restrict V3) +DECLSPEC void scrypt_smix (uint4 *X, uint4 *T, GLOBAL_AS uint4 *V0, GLOBAL_AS uint4 *V1, GLOBAL_AS uint4 *V2, GLOBAL_AS uint4 *V3) { #define Coord(xd4,y,z) (((xd4) * ySIZE * zSIZE) + ((y) * zSIZE) + (z)) #define CO Coord(xd4,y,z) @@ -155,7 +155,7 @@ DECLSPEC void scrypt_smix (uint4 *X, uint4 *T, GLOBAL_AS uint4 * restrict V0, GL const u32 xd4 = x / 4; const u32 xm4 = x & 3; - GLOBAL_AS uint4 * restrict V; + GLOBAL_AS uint4 *V; switch (xm4) { @@ -260,7 +260,7 @@ DECLSPEC void scrypt_smix (uint4 *X, uint4 *T, GLOBAL_AS uint4 * restrict V0, GL st[4 + s] ^= ~bc0 & bc1; \ } -CONSTANT_AS u64a keccakf_rndc[24] = +CONSTANT_AS CONSTSPEC u64a keccakf_rndc[24] = { 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b, 0x0000000080000001, @@ -424,10 +424,10 @@ KERNEL_FQ void m15700_loop (KERN_ATTR_TMPS_ESALT (scrypt_tmp_t, ethereum_scrypt_ if (gid >= gid_max) return; - GLOBAL_AS uint4 * restrict d_scrypt0_buf = d_extra0_buf; - GLOBAL_AS uint4 * restrict d_scrypt1_buf = d_extra1_buf; - GLOBAL_AS uint4 * restrict d_scrypt2_buf = d_extra2_buf; - GLOBAL_AS uint4 * restrict d_scrypt3_buf = d_extra3_buf; + GLOBAL_AS uint4 *d_scrypt0_buf = d_extra0_buf; + GLOBAL_AS uint4 *d_scrypt1_buf = d_extra1_buf; + GLOBAL_AS uint4 *d_scrypt2_buf = d_extra2_buf; + GLOBAL_AS uint4 *d_scrypt3_buf = d_extra3_buf; uint4 X[STATE_CNT4]; uint4 T[STATE_CNT4]; diff --git a/OpenCL/m16000_a0-pure.cl b/OpenCL/m16000_a0-pure.cl index ffbc3a6e2..5a291dbaa 100644 --- a/OpenCL/m16000_a0-pure.cl +++ b/OpenCL/m16000_a0-pure.cl @@ -34,7 +34,7 @@ a = a ^ tt; \ } -CONSTANT_AS u32a c_SPtrans[8][64] = +CONSTANT_AS CONSTSPEC u32a c_SPtrans[8][64] = { { 0x00820200, 0x00020000, 0x80800000, 0x80820200, @@ -182,7 +182,7 @@ CONSTANT_AS u32a c_SPtrans[8][64] = }, }; -CONSTANT_AS u32a c_skb[8][64] = +CONSTANT_AS CONSTSPEC u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, @@ -330,7 +330,7 @@ CONSTANT_AS u32a c_skb[8][64] = }, }; -CONSTANT_AS u32a c_tripcode_salt[128] = +CONSTANT_AS CONSTSPEC u32a c_tripcode_salt[128] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, diff --git a/OpenCL/m16000_a1-pure.cl b/OpenCL/m16000_a1-pure.cl index c5af56fce..af74e1787 100644 --- a/OpenCL/m16000_a1-pure.cl +++ b/OpenCL/m16000_a1-pure.cl @@ -32,7 +32,7 @@ a = a ^ tt; \ } -CONSTANT_AS u32a c_SPtrans[8][64] = +CONSTANT_AS CONSTSPEC u32a c_SPtrans[8][64] = { { 0x00820200, 0x00020000, 0x80800000, 0x80820200, @@ -180,7 +180,7 @@ CONSTANT_AS u32a c_SPtrans[8][64] = }, }; -CONSTANT_AS u32a c_skb[8][64] = +CONSTANT_AS CONSTSPEC u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, @@ -328,7 +328,7 @@ CONSTANT_AS u32a c_skb[8][64] = }, }; -CONSTANT_AS u32a c_tripcode_salt[128] = +CONSTANT_AS CONSTSPEC u32a c_tripcode_salt[128] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, diff --git a/OpenCL/m16000_a3-pure.cl b/OpenCL/m16000_a3-pure.cl index c7cb2311f..85a56bb8c 100644 --- a/OpenCL/m16000_a3-pure.cl +++ b/OpenCL/m16000_a3-pure.cl @@ -32,7 +32,7 @@ a = a ^ tt; \ } -CONSTANT_AS u32a c_SPtrans[8][64] = +CONSTANT_AS CONSTSPEC u32a c_SPtrans[8][64] = { { 0x00820200, 0x00020000, 0x80800000, 0x80820200, @@ -180,7 +180,7 @@ CONSTANT_AS u32a c_SPtrans[8][64] = }, }; -CONSTANT_AS u32a c_skb[8][64] = +CONSTANT_AS CONSTSPEC u32a c_skb[8][64] = { { 0x00000000, 0x00000010, 0x20000000, 0x20000010, @@ -328,7 +328,7 @@ CONSTANT_AS u32a c_skb[8][64] = }, }; -CONSTANT_AS u32a c_tripcode_salt[128] = +CONSTANT_AS CONSTSPEC u32a c_tripcode_salt[128] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, diff --git a/OpenCL/m16100_a0-optimized.cl b/OpenCL/m16100_a0-optimized.cl index 0bcbfcbfe..45b050973 100644 --- a/OpenCL/m16100_a0-optimized.cl +++ b/OpenCL/m16100_a0-optimized.cl @@ -85,7 +85,7 @@ KERNEL_FQ void m16100_m04 (KERN_ATTR_RULES_ESALT (tacacs_plus_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * append salt @@ -370,7 +370,7 @@ KERNEL_FQ void m16100_s04 (KERN_ATTR_RULES_ESALT (tacacs_plus_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * append salt diff --git a/OpenCL/m16300-pure.cl b/OpenCL/m16300-pure.cl index 48f85dfd6..2397b4476 100644 --- a/OpenCL/m16300-pure.cl +++ b/OpenCL/m16300-pure.cl @@ -35,7 +35,7 @@ typedef struct pbkdf2_sha256_tmp } pbkdf2_sha256_tmp_t; -CONSTANT_AS u64a keccakf_rndc[24] = +CONSTANT_AS CONSTSPEC u64a keccakf_rndc[24] = { 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b, 0x0000000080000001, diff --git a/OpenCL/m16400_a0-optimized.cl b/OpenCL/m16400_a0-optimized.cl index 669ed52b4..520d2b861 100644 --- a/OpenCL/m16400_a0-optimized.cl +++ b/OpenCL/m16400_a0-optimized.cl @@ -56,7 +56,7 @@ KERNEL_FQ void m16400_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); w0[0] = w0[0] ^ 0x5c5c5c5c; w0[1] = w0[1] ^ 0x5c5c5c5c; @@ -215,7 +215,7 @@ KERNEL_FQ void m16400_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); w0[0] = w0[0] ^ 0x5c5c5c5c; w0[1] = w0[1] ^ 0x5c5c5c5c; diff --git a/OpenCL/m16400_a1-pure.cl b/OpenCL/m16400_a1-pure.cl index 16c67fcdd..ba2d9ee56 100644 --- a/OpenCL/m16400_a1-pure.cl +++ b/OpenCL/m16400_a1-pure.cl @@ -143,7 +143,7 @@ DECLSPEC void cram_md5_update_64 (md5_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 ctx->w3[3] |= w3[3]; } -DECLSPEC void cram_md5_update_global (md5_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len) +DECLSPEC void cram_md5_update_global (md5_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { u32 w0[4]; u32 w1[4]; diff --git a/OpenCL/m16600_a0-optimized.cl b/OpenCL/m16600_a0-optimized.cl index f026e15dc..cef6e2df9 100644 --- a/OpenCL/m16600_a0-optimized.cl +++ b/OpenCL/m16600_a0-optimized.cl @@ -116,7 +116,7 @@ KERNEL_FQ void m16600_m04 (KERN_ATTR_RULES_ESALT (electrum_wallet_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); @@ -501,7 +501,7 @@ KERNEL_FQ void m16600_s04 (KERN_ATTR_RULES_ESALT (electrum_wallet_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x80_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m17300_a0-optimized.cl b/OpenCL/m17300_a0-optimized.cl index e0e02190a..0b83ee0f6 100644 --- a/OpenCL/m17300_a0-optimized.cl +++ b/OpenCL/m17300_a0-optimized.cl @@ -14,7 +14,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u64a keccakf_rndc[24] = +CONSTANT_AS CONSTSPEC u64a keccakf_rndc[24] = { 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b, 0x0000000080000001, @@ -71,7 +71,7 @@ KERNEL_FQ void m17300_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x06_2x4_VV (w0, w1, out_len); @@ -301,7 +301,7 @@ KERNEL_FQ void m17300_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x06_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m17300_a1-optimized.cl b/OpenCL/m17300_a1-optimized.cl index 3e0e5970d..1ea917e4c 100644 --- a/OpenCL/m17300_a1-optimized.cl +++ b/OpenCL/m17300_a1-optimized.cl @@ -12,7 +12,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u64a keccakf_rndc[24] = +CONSTANT_AS CONSTSPEC u64a keccakf_rndc[24] = { 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b, 0x0000000080000001, diff --git a/OpenCL/m17300_a3-optimized.cl b/OpenCL/m17300_a3-optimized.cl index 2948331db..eb11e4fc2 100644 --- a/OpenCL/m17300_a3-optimized.cl +++ b/OpenCL/m17300_a3-optimized.cl @@ -12,7 +12,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u64a keccakf_rndc[24] = +CONSTANT_AS CONSTSPEC u64a keccakf_rndc[24] = { 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b, 0x0000000080000001, diff --git a/OpenCL/m17400_a0-optimized.cl b/OpenCL/m17400_a0-optimized.cl index 15f60dad4..877430775 100644 --- a/OpenCL/m17400_a0-optimized.cl +++ b/OpenCL/m17400_a0-optimized.cl @@ -14,7 +14,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u64a keccakf_rndc[24] = +CONSTANT_AS CONSTSPEC u64a keccakf_rndc[24] = { 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b, 0x0000000080000001, @@ -71,7 +71,7 @@ KERNEL_FQ void m17400_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x06_2x4_VV (w0, w1, out_len); @@ -301,7 +301,7 @@ KERNEL_FQ void m17400_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x06_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m17400_a1-optimized.cl b/OpenCL/m17400_a1-optimized.cl index 6b3c9c14b..d4739a78f 100644 --- a/OpenCL/m17400_a1-optimized.cl +++ b/OpenCL/m17400_a1-optimized.cl @@ -12,7 +12,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u64a keccakf_rndc[24] = +CONSTANT_AS CONSTSPEC u64a keccakf_rndc[24] = { 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b, 0x0000000080000001, diff --git a/OpenCL/m17400_a3-optimized.cl b/OpenCL/m17400_a3-optimized.cl index 19051f0a2..242f13546 100644 --- a/OpenCL/m17400_a3-optimized.cl +++ b/OpenCL/m17400_a3-optimized.cl @@ -12,7 +12,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u64a keccakf_rndc[24] = +CONSTANT_AS CONSTSPEC u64a keccakf_rndc[24] = { 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b, 0x0000000080000001, diff --git a/OpenCL/m17500_a0-optimized.cl b/OpenCL/m17500_a0-optimized.cl index 7680fa6a9..668bfdcfd 100644 --- a/OpenCL/m17500_a0-optimized.cl +++ b/OpenCL/m17500_a0-optimized.cl @@ -14,7 +14,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u64a keccakf_rndc[24] = +CONSTANT_AS CONSTSPEC u64a keccakf_rndc[24] = { 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b, 0x0000000080000001, @@ -71,7 +71,7 @@ KERNEL_FQ void m17500_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x06_2x4_VV (w0, w1, out_len); @@ -301,7 +301,7 @@ KERNEL_FQ void m17500_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x06_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m17500_a1-optimized.cl b/OpenCL/m17500_a1-optimized.cl index a402b7afa..804be15d5 100644 --- a/OpenCL/m17500_a1-optimized.cl +++ b/OpenCL/m17500_a1-optimized.cl @@ -12,7 +12,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u64a keccakf_rndc[24] = +CONSTANT_AS CONSTSPEC u64a keccakf_rndc[24] = { 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b, 0x0000000080000001, diff --git a/OpenCL/m17500_a3-optimized.cl b/OpenCL/m17500_a3-optimized.cl index fe6863dbd..93851ef04 100644 --- a/OpenCL/m17500_a3-optimized.cl +++ b/OpenCL/m17500_a3-optimized.cl @@ -12,7 +12,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u64a keccakf_rndc[24] = +CONSTANT_AS CONSTSPEC u64a keccakf_rndc[24] = { 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b, 0x0000000080000001, diff --git a/OpenCL/m17600_a0-optimized.cl b/OpenCL/m17600_a0-optimized.cl index 574bb3421..390ed02dc 100644 --- a/OpenCL/m17600_a0-optimized.cl +++ b/OpenCL/m17600_a0-optimized.cl @@ -14,7 +14,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u64a keccakf_rndc[24] = +CONSTANT_AS CONSTSPEC u64a keccakf_rndc[24] = { 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b, 0x0000000080000001, @@ -71,7 +71,7 @@ KERNEL_FQ void m17600_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x06_2x4_VV (w0, w1, out_len); @@ -301,7 +301,7 @@ KERNEL_FQ void m17600_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x06_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m17600_a1-optimized.cl b/OpenCL/m17600_a1-optimized.cl index dac85837d..7b0e3b3d0 100644 --- a/OpenCL/m17600_a1-optimized.cl +++ b/OpenCL/m17600_a1-optimized.cl @@ -12,7 +12,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u64a keccakf_rndc[24] = +CONSTANT_AS CONSTSPEC u64a keccakf_rndc[24] = { 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b, 0x0000000080000001, diff --git a/OpenCL/m17600_a3-optimized.cl b/OpenCL/m17600_a3-optimized.cl index 37fef9a7b..6fb9b12ad 100644 --- a/OpenCL/m17600_a3-optimized.cl +++ b/OpenCL/m17600_a3-optimized.cl @@ -12,7 +12,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u64a keccakf_rndc[24] = +CONSTANT_AS CONSTSPEC u64a keccakf_rndc[24] = { 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b, 0x0000000080000001, diff --git a/OpenCL/m17700_a0-optimized.cl b/OpenCL/m17700_a0-optimized.cl index 51d53eec2..3dbd27409 100644 --- a/OpenCL/m17700_a0-optimized.cl +++ b/OpenCL/m17700_a0-optimized.cl @@ -14,7 +14,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u64a keccakf_rndc[24] = +CONSTANT_AS CONSTSPEC u64a keccakf_rndc[24] = { 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b, 0x0000000080000001, @@ -71,7 +71,7 @@ KERNEL_FQ void m17700_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x01_2x4_VV (w0, w1, out_len); @@ -301,7 +301,7 @@ KERNEL_FQ void m17700_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x01_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m17700_a1-optimized.cl b/OpenCL/m17700_a1-optimized.cl index d3b6d6a14..474d5144c 100644 --- a/OpenCL/m17700_a1-optimized.cl +++ b/OpenCL/m17700_a1-optimized.cl @@ -12,7 +12,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u64a keccakf_rndc[24] = +CONSTANT_AS CONSTSPEC u64a keccakf_rndc[24] = { 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b, 0x0000000080000001, diff --git a/OpenCL/m17700_a3-optimized.cl b/OpenCL/m17700_a3-optimized.cl index 7cdd1b22f..9775ab778 100644 --- a/OpenCL/m17700_a3-optimized.cl +++ b/OpenCL/m17700_a3-optimized.cl @@ -12,7 +12,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u64a keccakf_rndc[24] = +CONSTANT_AS CONSTSPEC u64a keccakf_rndc[24] = { 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b, 0x0000000080000001, diff --git a/OpenCL/m17800_a0-optimized.cl b/OpenCL/m17800_a0-optimized.cl index 98c611094..d8b420337 100644 --- a/OpenCL/m17800_a0-optimized.cl +++ b/OpenCL/m17800_a0-optimized.cl @@ -14,7 +14,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u64a keccakf_rndc[24] = +CONSTANT_AS CONSTSPEC u64a keccakf_rndc[24] = { 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b, 0x0000000080000001, @@ -71,7 +71,7 @@ KERNEL_FQ void m17800_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x01_2x4_VV (w0, w1, out_len); @@ -301,7 +301,7 @@ KERNEL_FQ void m17800_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x01_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m17800_a1-optimized.cl b/OpenCL/m17800_a1-optimized.cl index 8e7054235..1fe3d7be1 100644 --- a/OpenCL/m17800_a1-optimized.cl +++ b/OpenCL/m17800_a1-optimized.cl @@ -12,7 +12,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u64a keccakf_rndc[24] = +CONSTANT_AS CONSTSPEC u64a keccakf_rndc[24] = { 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b, 0x0000000080000001, diff --git a/OpenCL/m17800_a3-optimized.cl b/OpenCL/m17800_a3-optimized.cl index f62ab2a0e..0dccb4134 100644 --- a/OpenCL/m17800_a3-optimized.cl +++ b/OpenCL/m17800_a3-optimized.cl @@ -12,7 +12,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u64a keccakf_rndc[24] = +CONSTANT_AS CONSTSPEC u64a keccakf_rndc[24] = { 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b, 0x0000000080000001, diff --git a/OpenCL/m17900_a0-optimized.cl b/OpenCL/m17900_a0-optimized.cl index 32ace6be8..68cffdb33 100644 --- a/OpenCL/m17900_a0-optimized.cl +++ b/OpenCL/m17900_a0-optimized.cl @@ -14,7 +14,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u64a keccakf_rndc[24] = +CONSTANT_AS CONSTSPEC u64a keccakf_rndc[24] = { 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b, 0x0000000080000001, @@ -71,7 +71,7 @@ KERNEL_FQ void m17900_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x01_2x4_VV (w0, w1, out_len); @@ -301,7 +301,7 @@ KERNEL_FQ void m17900_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x01_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m17900_a1-optimized.cl b/OpenCL/m17900_a1-optimized.cl index a182385f4..0488336fc 100644 --- a/OpenCL/m17900_a1-optimized.cl +++ b/OpenCL/m17900_a1-optimized.cl @@ -12,7 +12,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u64a keccakf_rndc[24] = +CONSTANT_AS CONSTSPEC u64a keccakf_rndc[24] = { 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b, 0x0000000080000001, diff --git a/OpenCL/m17900_a3-optimized.cl b/OpenCL/m17900_a3-optimized.cl index afeb00627..6da90f4bf 100644 --- a/OpenCL/m17900_a3-optimized.cl +++ b/OpenCL/m17900_a3-optimized.cl @@ -12,7 +12,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u64a keccakf_rndc[24] = +CONSTANT_AS CONSTSPEC u64a keccakf_rndc[24] = { 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b, 0x0000000080000001, diff --git a/OpenCL/m18000_a0-optimized.cl b/OpenCL/m18000_a0-optimized.cl index e9a63d0cb..6d971f9d1 100644 --- a/OpenCL/m18000_a0-optimized.cl +++ b/OpenCL/m18000_a0-optimized.cl @@ -14,7 +14,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u64a keccakf_rndc[24] = +CONSTANT_AS CONSTSPEC u64a keccakf_rndc[24] = { 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b, 0x0000000080000001, @@ -71,7 +71,7 @@ KERNEL_FQ void m18000_m04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x01_2x4_VV (w0, w1, out_len); @@ -301,7 +301,7 @@ KERNEL_FQ void m18000_s04 (KERN_ATTR_RULES ()) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); append_0x01_2x4_VV (w0, w1, out_len); diff --git a/OpenCL/m18000_a1-optimized.cl b/OpenCL/m18000_a1-optimized.cl index 30164893d..45a467bf9 100644 --- a/OpenCL/m18000_a1-optimized.cl +++ b/OpenCL/m18000_a1-optimized.cl @@ -12,7 +12,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u64a keccakf_rndc[24] = +CONSTANT_AS CONSTSPEC u64a keccakf_rndc[24] = { 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b, 0x0000000080000001, diff --git a/OpenCL/m18000_a3-optimized.cl b/OpenCL/m18000_a3-optimized.cl index b6f7a33f8..a3399616c 100644 --- a/OpenCL/m18000_a3-optimized.cl +++ b/OpenCL/m18000_a3-optimized.cl @@ -12,7 +12,7 @@ #include "inc_simd.cl" #endif -CONSTANT_AS u64a keccakf_rndc[24] = +CONSTANT_AS CONSTSPEC u64a keccakf_rndc[24] = { 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b, 0x0000000080000001, diff --git a/OpenCL/m18200_a0-optimized.cl b/OpenCL/m18200_a0-optimized.cl index 3cb61066d..a520da74d 100644 --- a/OpenCL/m18200_a0-optimized.cl +++ b/OpenCL/m18200_a0-optimized.cl @@ -96,7 +96,7 @@ DECLSPEC void rc4_init_16 (LOCAL_AS RC4_KEY *rc4_key, const u32 *data) } } -DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, const GLOBAL_AS u32 *in, u32 *out) +DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, GLOBAL_AS const u32 *in, u32 *out) { #ifdef _unroll #pragma unroll @@ -633,7 +633,7 @@ KERNEL_FQ void m18200_m04 (KERN_ATTR_RULES_ESALT (krb5asrep_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * kerberos @@ -731,7 +731,7 @@ KERNEL_FQ void m18200_s04 (KERN_ATTR_RULES_ESALT (krb5asrep_t)) u32x w2[4] = { 0 }; u32x w3[4] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1); /** * kerberos diff --git a/OpenCL/m18200_a0-pure.cl b/OpenCL/m18200_a0-pure.cl index 61a10749c..497ac3a3c 100644 --- a/OpenCL/m18200_a0-pure.cl +++ b/OpenCL/m18200_a0-pure.cl @@ -95,7 +95,7 @@ DECLSPEC void rc4_init_16 (LOCAL_AS RC4_KEY *rc4_key, const u32 *data) } } -DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, const GLOBAL_AS u32 *in, u32 *out) +DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, GLOBAL_AS const u32 *in, u32 *out) { #ifdef _unroll #pragma unroll diff --git a/OpenCL/m18200_a1-optimized.cl b/OpenCL/m18200_a1-optimized.cl index 77c6c0264..0d9efe343 100644 --- a/OpenCL/m18200_a1-optimized.cl +++ b/OpenCL/m18200_a1-optimized.cl @@ -94,7 +94,7 @@ DECLSPEC void rc4_init_16 (LOCAL_AS RC4_KEY *rc4_key, const u32 *data) } } -DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, const GLOBAL_AS u32 *in, u32 *out) +DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, GLOBAL_AS const u32 *in, u32 *out) { #ifdef _unroll #pragma unroll diff --git a/OpenCL/m18200_a1-pure.cl b/OpenCL/m18200_a1-pure.cl index 658da9ddd..519c8498d 100644 --- a/OpenCL/m18200_a1-pure.cl +++ b/OpenCL/m18200_a1-pure.cl @@ -93,7 +93,7 @@ DECLSPEC void rc4_init_16 (LOCAL_AS RC4_KEY *rc4_key, const u32 *data) } } -DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, const GLOBAL_AS u32 *in, u32 *out) +DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, GLOBAL_AS const u32 *in, u32 *out) { #ifdef _unroll #pragma unroll diff --git a/OpenCL/m18200_a3-optimized.cl b/OpenCL/m18200_a3-optimized.cl index 725e79507..404c56521 100644 --- a/OpenCL/m18200_a3-optimized.cl +++ b/OpenCL/m18200_a3-optimized.cl @@ -94,7 +94,7 @@ DECLSPEC void rc4_init_16 (LOCAL_AS RC4_KEY *rc4_key, const u32 *data) } } -DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, const GLOBAL_AS u32 *in, u32 *out) +DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, GLOBAL_AS const u32 *in, u32 *out) { #ifdef _unroll #pragma unroll diff --git a/OpenCL/m18200_a3-pure.cl b/OpenCL/m18200_a3-pure.cl index b9d47e170..0725ff7ed 100644 --- a/OpenCL/m18200_a3-pure.cl +++ b/OpenCL/m18200_a3-pure.cl @@ -93,7 +93,7 @@ DECLSPEC void rc4_init_16 (LOCAL_AS RC4_KEY *rc4_key, const u32 *data) } } -DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, const GLOBAL_AS u32 *in, u32 *out) +DECLSPEC u8 rc4_next_16 (LOCAL_AS RC4_KEY *rc4_key, u8 i, u8 j, GLOBAL_AS const u32 *in, u32 *out) { #ifdef _unroll #pragma unroll diff --git a/OpenCL/m18600-pure.cl b/OpenCL/m18600-pure.cl index b939a4381..bd0bf8ad6 100644 --- a/OpenCL/m18600-pure.cl +++ b/OpenCL/m18600-pure.cl @@ -37,7 +37,7 @@ typedef struct odf11 // http://www.schneier.com/code/constants.txt -CONSTANT_AS u32a c_sbox0[256] = +CONSTANT_AS CONSTSPEC u32a c_sbox0[256] = { 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, @@ -105,7 +105,7 @@ CONSTANT_AS u32a c_sbox0[256] = 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a }; -CONSTANT_AS u32a c_sbox1[256] = +CONSTANT_AS CONSTSPEC u32a c_sbox1[256] = { 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, @@ -173,7 +173,7 @@ CONSTANT_AS u32a c_sbox1[256] = 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7 }; -CONSTANT_AS u32a c_sbox2[256] = +CONSTANT_AS CONSTSPEC u32a c_sbox2[256] = { 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, @@ -241,7 +241,7 @@ CONSTANT_AS u32a c_sbox2[256] = 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0 }; -CONSTANT_AS u32a c_sbox3[256] = +CONSTANT_AS CONSTSPEC u32a c_sbox3[256] = { 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, @@ -309,7 +309,7 @@ CONSTANT_AS u32a c_sbox3[256] = 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6 }; -CONSTANT_AS u32a c_pbox[18] = +CONSTANT_AS CONSTSPEC u32a c_pbox[18] = { 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, diff --git a/OpenCL/m18700_a0-optimized.cl b/OpenCL/m18700_a0-optimized.cl index d64a971ac..de8eabbe9 100644 --- a/OpenCL/m18700_a0-optimized.cl +++ b/OpenCL/m18700_a0-optimized.cl @@ -90,7 +90,7 @@ KERNEL_FQ void m18700_m04 (KERN_ATTR_RULES ()) { u32x w[16] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w + 0, w + 4); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w + 0, w + 4); u32x hash = hashCode (0, w, out_len); @@ -161,7 +161,7 @@ KERNEL_FQ void m18700_s04 (KERN_ATTR_RULES ()) { u32x w[16] = { 0 }; - const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w + 0, w + 4); + const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w + 0, w + 4); u32x hash = hashCode (0, w, out_len); diff --git a/OpenCL/m18700_a1-optimized.cl b/OpenCL/m18700_a1-optimized.cl index 41919bd83..215b0bcfc 100644 --- a/OpenCL/m18700_a1-optimized.cl +++ b/OpenCL/m18700_a1-optimized.cl @@ -14,7 +14,7 @@ #include "inc_hash_md5.cl" #endif -DECLSPEC u32 hashCode_g (const u32 init, GLOBAL_AS u32 * restrict w, const u32 pw_len) +DECLSPEC u32 hashCode_g (const u32 init, GLOBAL_AS u32 *w, const u32 pw_len) { u32 hash = init; diff --git a/OpenCL/m18700_a1-pure.cl b/OpenCL/m18700_a1-pure.cl index 923363ab0..c80a904b7 100644 --- a/OpenCL/m18700_a1-pure.cl +++ b/OpenCL/m18700_a1-pure.cl @@ -13,7 +13,7 @@ #include "inc_hash_md5.cl" #endif -DECLSPEC u32 hashCode_g (const u32 init, GLOBAL_AS u32 * restrict w, const u32 pw_len) +DECLSPEC u32 hashCode_g (const u32 init, GLOBAL_AS u32 *w, const u32 pw_len) { u32 hash = init; diff --git a/OpenCL/m19200-pure.cl b/OpenCL/m19200-pure.cl index 0f5fb5571..e0c7c9b5e 100644 --- a/OpenCL/m19200-pure.cl +++ b/OpenCL/m19200-pure.cl @@ -154,7 +154,7 @@ DECLSPEC u32 sha512_update_128_qnxbug (sha512_ctx_t *ctx, u32 *w0, u32 *w1, u32 return sav; } -DECLSPEC u32 sha512_update_global_swap_qnxbug (sha512_ctx_t *ctx, const GLOBAL_AS u32 *w, const int len, u32 sav) +DECLSPEC u32 sha512_update_global_swap_qnxbug (sha512_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len, u32 sav) { u32 w0[4]; u32 w1[4]; diff --git a/OpenCL/markov_be.cl b/OpenCL/markov_be.cl index a40478a2c..cdf716ab9 100644 --- a/OpenCL/markov_be.cl +++ b/OpenCL/markov_be.cl @@ -45,7 +45,7 @@ DECLSPEC void generate_pw (u32 *pw_buf, GLOBAL_AS const cs_t *root_css_buf, GLOB if (bits15) pw_buf[15] = (pw_l_len + pw_r_len) * 8; } -KERNEL_FQ void l_markov (GLOBAL_AS pw_t * restrict pws_buf_l, GLOBAL_AS const cs_t * restrict root_css_buf, GLOBAL_AS const cs_t * restrict markov_css_buf, const u64 off, const u32 pw_l_len, const u32 pw_r_len, const u32 mask80, const u32 bits14, const u32 bits15, const u64 gid_max) +KERNEL_FQ void l_markov (GLOBAL_AS pw_t *pws_buf_l, GLOBAL_AS const cs_t *root_css_buf, GLOBAL_AS const cs_t *markov_css_buf, const u64 off, const u32 pw_l_len, const u32 pw_r_len, const u32 mask80, const u32 bits14, const u32 bits15, const u64 gid_max) { const u64 gid = get_global_id (0); @@ -64,7 +64,7 @@ KERNEL_FQ void l_markov (GLOBAL_AS pw_t * restrict pws_buf_l, GLOBAL_AS const cs pws_buf_l[gid].pw_len = pw_l_len + pw_r_len; } -KERNEL_FQ void r_markov (GLOBAL_AS bf_t * restrict pws_buf_r, GLOBAL_AS const cs_t * restrict root_css_buf, GLOBAL_AS const cs_t * restrict markov_css_buf, const u64 off, const u32 pw_r_len, const u32 mask80, const u32 bits14, const u32 bits15, const u64 gid_max) +KERNEL_FQ void r_markov (GLOBAL_AS bf_t *pws_buf_r, GLOBAL_AS const cs_t *root_css_buf, GLOBAL_AS const cs_t *markov_css_buf, const u64 off, const u32 pw_r_len, const u32 mask80, const u32 bits14, const u32 bits15, const u64 gid_max) { const u64 gid = get_global_id (0); @@ -77,7 +77,7 @@ KERNEL_FQ void r_markov (GLOBAL_AS bf_t * restrict pws_buf_r, GLOBAL_AS const cs pws_buf_r[gid].i = pw_buf[0]; } -KERNEL_FQ void C_markov (GLOBAL_AS pw_t * restrict pws_buf, GLOBAL_AS const cs_t * restrict root_css_buf, GLOBAL_AS const cs_t * restrict markov_css_buf, const u64 off, const u32 pw_len, const u32 mask80, const u32 bits14, const u32 bits15, const u64 gid_max) +KERNEL_FQ void C_markov (GLOBAL_AS pw_t *pws_buf, GLOBAL_AS const cs_t *root_css_buf, GLOBAL_AS const cs_t *markov_css_buf, const u64 off, const u32 pw_len, const u32 mask80, const u32 bits14, const u32 bits15, const u64 gid_max) { const u64 gid = get_global_id (0); diff --git a/OpenCL/markov_le.cl b/OpenCL/markov_le.cl index 21ad5de9d..cb5a91321 100644 --- a/OpenCL/markov_le.cl +++ b/OpenCL/markov_le.cl @@ -45,7 +45,7 @@ DECLSPEC void generate_pw (u32 *pw_buf, GLOBAL_AS const cs_t *root_css_buf, GLOB if (bits15) pw_buf[15] = (pw_l_len + pw_r_len) * 8; } -KERNEL_FQ void l_markov (GLOBAL_AS pw_t * restrict pws_buf_l, GLOBAL_AS const cs_t * restrict root_css_buf, GLOBAL_AS const cs_t * restrict markov_css_buf, const u64 off, const u32 pw_l_len, const u32 pw_r_len, const u32 mask80, const u32 bits14, const u32 bits15, const u64 gid_max) +KERNEL_FQ void l_markov (GLOBAL_AS pw_t *pws_buf_l, GLOBAL_AS const cs_t *root_css_buf, GLOBAL_AS const cs_t *markov_css_buf, const u64 off, const u32 pw_l_len, const u32 pw_r_len, const u32 mask80, const u32 bits14, const u32 bits15, const u64 gid_max) { const u64 gid = get_global_id (0); @@ -64,7 +64,7 @@ KERNEL_FQ void l_markov (GLOBAL_AS pw_t * restrict pws_buf_l, GLOBAL_AS const cs pws_buf_l[gid].pw_len = pw_l_len + pw_r_len; } -KERNEL_FQ void r_markov (GLOBAL_AS bf_t * restrict pws_buf_r, GLOBAL_AS const cs_t * restrict root_css_buf, GLOBAL_AS const cs_t * restrict markov_css_buf, const u64 off, const u32 pw_r_len, const u32 mask80, const u32 bits14, const u32 bits15, const u64 gid_max) +KERNEL_FQ void r_markov (GLOBAL_AS bf_t *pws_buf_r, GLOBAL_AS const cs_t *root_css_buf, GLOBAL_AS const cs_t *markov_css_buf, const u64 off, const u32 pw_r_len, const u32 mask80, const u32 bits14, const u32 bits15, const u64 gid_max) { const u64 gid = get_global_id (0); @@ -77,7 +77,7 @@ KERNEL_FQ void r_markov (GLOBAL_AS bf_t * restrict pws_buf_r, GLOBAL_AS const cs pws_buf_r[gid].i = pw_buf[0]; } -KERNEL_FQ void C_markov (GLOBAL_AS pw_t * restrict pws_buf, GLOBAL_AS const cs_t * restrict root_css_buf, GLOBAL_AS const cs_t * restrict markov_css_buf, const u64 off, const u32 pw_len, const u32 mask80, const u32 bits14, const u32 bits15, const u64 gid_max) +KERNEL_FQ void C_markov (GLOBAL_AS pw_t *pws_buf, GLOBAL_AS const cs_t *root_css_buf, GLOBAL_AS const cs_t *markov_css_buf, const u64 off, const u32 pw_len, const u32 mask80, const u32 bits14, const u32 bits15, const u64 gid_max) { const u64 gid = get_global_id (0); diff --git a/include/cpu_md4.h b/include/cpu_md4.h deleted file mode 100644 index 6a61071d0..000000000 --- a/include/cpu_md4.h +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Author......: See docs/credits.txt - * License.....: MIT - */ - -#ifndef _CPU_MD4_H -#define _CPU_MD4_H - -#include - -void md4_64 (const u32 block[16], u32 digest[4]); - -#endif // _CPU_MD4_H diff --git a/include/emu_general.h b/include/emu_general.h new file mode 100644 index 000000000..feb1ab15d --- /dev/null +++ b/include/emu_general.h @@ -0,0 +1,49 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#ifndef _CPU_OPENCL_EMU_H +#define _CPU_OPENCL_EMU_H + +#include +#include +#include + +#define DEVICE_TYPE -1 +#define VENDOR_ID -1 +#define LOCAL_MEM_TYPE 2 +#define CUDA_ARCH 0 +#define HAS_VPERM 0 +#define HAS_VADD3 0 +#define HAS_VBFE 0 +#define VECT_SIZE 1 + +typedef uint8_t uchar; +typedef uint16_t ushort; +typedef uint32_t uint; +typedef uint64_t ulong; + +typedef uchar u8; +typedef ushort u16; +typedef uint u32; +typedef ulong u64; + +// there's no such thing in plain C, therefore all vector operation cannot work in this emu +// which is why VECT_SIZE is set to 1 + +typedef u8 u8x; +typedef u16 u16x; +typedef u32 u32x; +typedef u64 u64x; + +typedef uint uint4; + +uint atomic_dec (uint *p); +uint atomic_inc (uint *p); + +size_t get_global_id (uint dimindx __attribute__((unused))); +size_t get_local_id (uint dimindx __attribute__((unused))); +size_t get_local_size (uint dimindx __attribute__((unused))); + +#endif // _CPU_OPENCL_EMU_H diff --git a/include/emu_inc_hash_md4.h b/include/emu_inc_hash_md4.h new file mode 100644 index 000000000..78a14277c --- /dev/null +++ b/include/emu_inc_hash_md4.h @@ -0,0 +1,22 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#include "emu_general.h" + +#define DGST_ELEM 4 +#define DGST_R0 0 +#define DGST_R1 1 +#define DGST_R2 2 +#define DGST_R3 3 + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunknown-pragmas" + +#include "inc_vendor.h" +#include "inc_hash_md4.h" + +#pragma GCC diagnostic pop diff --git a/include/emu_inc_rp.h b/include/emu_inc_rp.h new file mode 100644 index 000000000..7f4fe179d --- /dev/null +++ b/include/emu_inc_rp.h @@ -0,0 +1,24 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#include "emu_general.h" + +#define DGST_ELEM 4 +#define DGST_R0 0 +#define DGST_R1 1 +#define DGST_R2 2 +#define DGST_R3 3 + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunknown-pragmas" + +#include "inc_vendor.h" +//#include "inc_types.h" +//#include "inc_common.h" +#include "inc_rp.h" + +#pragma GCC diagnostic pop diff --git a/include/emu_inc_rp_optimized.h b/include/emu_inc_rp_optimized.h new file mode 100644 index 000000000..9f8230e34 --- /dev/null +++ b/include/emu_inc_rp_optimized.h @@ -0,0 +1,24 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#include "emu_general.h" + +#define DGST_ELEM 4 +#define DGST_R0 0 +#define DGST_R1 1 +#define DGST_R2 2 +#define DGST_R3 3 + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunknown-pragmas" + +#include "inc_vendor.h" +//#include "inc_types.h" +//#include "inc_common.h" +#include "inc_rp_optimized.h" + +#pragma GCC diagnostic pop diff --git a/include/emu_m02501_pure.h b/include/emu_m02501_pure.h new file mode 100644 index 000000000..c962eaa87 --- /dev/null +++ b/include/emu_m02501_pure.h @@ -0,0 +1,45 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#ifndef _EMU_M02501_PURE_H +#define _EMU_M02501_PURE_H + +typedef struct wpa_pmk_tmp +{ + u32 out[8]; + +} wpa_pmk_tmp_t; + +typedef struct wpa_eapol +{ + u32 pke[32]; + u32 eapol[64 + 16]; + u16 eapol_len; + u8 message_pair; + int message_pair_chgd; + u8 keyver; + u8 orig_mac_ap[6]; + u8 orig_mac_sta[6]; + u8 orig_nonce_ap[32]; + u8 orig_nonce_sta[32]; + u8 essid_len; + u8 essid[32]; + u32 keymic[4]; + u32 hash[4]; + int nonce_compare; + int nonce_error_corrections; + int detected_le; + int detected_be; + +} wpa_eapol_t; + +KERNEL_FQ void m02501_init (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_eapol_t)); +KERNEL_FQ void m02501_loop (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_eapol_t)); +KERNEL_FQ void m02501_comp (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_eapol_t)); +KERNEL_FQ void m02501_aux1 (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_eapol_t)); +KERNEL_FQ void m02501_aux2 (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_eapol_t)); +KERNEL_FQ void m02501_aux3 (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_eapol_t)); + +#endif // _EMU_M02501_PURE_H diff --git a/include/rp_kernel_on_cpu.h b/include/rp_kernel_on_cpu.h deleted file mode 100644 index d4e2b1133..000000000 --- a/include/rp_kernel_on_cpu.h +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Author......: See docs/credits.txt - * License.....: MIT - */ - -#ifndef _RP_KERNEL_ON_CPU_H -#define _RP_KERNEL_ON_CPU_H - -int apply_rules (const u32 *cmds, u32 *buf, const int in_len); - -#endif // _RP_KERNEL_ON_CPU_H diff --git a/include/rp_kernel_on_cpu_optimized.h b/include/rp_kernel_on_cpu_optimized.h deleted file mode 100644 index f8b81bed4..000000000 --- a/include/rp_kernel_on_cpu_optimized.h +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Author......: See docs/credits.txt - * License.....: MIT - */ - -#ifndef _RP_KERNEL_ON_CPU_OPTIMIZED_H -#define _RP_KERNEL_ON_CPU_OPTIMIZED_H - -u32 apply_rule_optimized (const u32 name, const u32 p0, const u32 p1, u32 buf0[4], u32 buf1[4], const u32 in_len); - -u32 apply_rules_optimized (const u32 *cmds, u32 buf0[4], u32 buf1[4], const u32 len); - -#endif // _RP_KERNEL_ON_CPU_OPTIMIZED_H diff --git a/src/Makefile b/src/Makefile index 0a420e742..0e6226226 100644 --- a/src/Makefile +++ b/src/Makefile @@ -277,7 +277,18 @@ endif # MSYS2 ## Objects ## -OBJS_ALL := affinity autotune benchmark bitmap bitops combinator common convert cpt cpu_aes cpu_crc32 cpu_des cpu_md4 cpu_md5 cpu_sha1 cpu_sha256 debugfile dictstat dispatch dynloader event ext_ADL ext_nvapi ext_nvml ext_OpenCL ext_sysfs ext_lzma filehandling folder hashcat hashes hlfmt hwmon induct interface keyboard_layout locking logfile loopback memory monitor mpsp opencl outfile_check outfile pidfile potfile restore rp rp_cpu rp_kernel_on_cpu rp_kernel_on_cpu_optimized selftest slow_candidates shared status stdout straight terminal thread timer tuningdb usage user_options wordlist +#missing: +#-rw-r--r-- 1 root root 440 Mar 23 22:08 src/emu_inc_truecrypt_crc32.c +#-rw-r--r-- 1 root root 442 Mar 23 22:09 src/emu_inc_truecrypt_keyfile.c +#-rw-r--r-- 1 root root 438 Mar 23 22:10 src/emu_inc_truecrypt_xts.c +#-rw-r--r-- 1 root root 432 Mar 22 23:07 src/emu_m02501_pure.c + +EMU_OBJS_ALL := emu_general emu_inc_common emu_inc_scalar emu_inc_simd +EMU_OBJS_ALL += emu_inc_rp emu_inc_rp_optimized +EMU_OBJS_ALL += emu_inc_hash_md4 emu_inc_hash_md5 emu_inc_hash_ripemd160 emu_inc_hash_sha1 emu_inc_hash_sha256 emu_inc_hash_sha384 emu_inc_hash_sha512 emu_inc_hash_streebog256 emu_inc_hash_streebog512 +EMU_OBJS_ALL += emu_inc_cipher_aes emu_inc_cipher_camellia emu_inc_cipher_des emu_inc_cipher_kuznyechik emu_inc_cipher_serpent emu_inc_cipher_twofish + +OBJS_ALL := affinity autotune benchmark bitmap bitops combinator common convert cpt cpu_aes cpu_crc32 cpu_des cpu_md5 cpu_sha1 cpu_sha256 debugfile dictstat dispatch dynloader event ext_ADL ext_nvapi ext_nvml ext_OpenCL ext_sysfs ext_lzma filehandling folder hashcat hashes hlfmt hwmon induct interface keyboard_layout locking logfile loopback memory monitor mpsp opencl outfile_check outfile pidfile potfile restore rp rp_cpu selftest slow_candidates shared status stdout straight terminal thread timer tuningdb usage user_options wordlist $(EMU_OBJS_ALL) ifeq ($(ENABLE_BRAIN),1) OBJS_ALL += brain @@ -311,7 +322,9 @@ WIN_OBJS += $(foreach OBJ,$(OBJS_XXHASH),obj/$(OBJ).WIN.o) endif endif -MODULE_OBJS_ALL := bitops convert cpu_aes cpu_crc32 cpu_des cpu_md4 cpu_md5 cpu_sha1 cpu_sha256 ext_lzma filehandling keyboard_layout memory shared +EMU_MODULE_OBJS_ALL := emu_general emu_inc_common emu_inc_hash_md4 + +MODULE_OBJS_ALL := bitops convert cpu_aes cpu_crc32 cpu_des cpu_md5 cpu_sha1 cpu_sha256 ext_lzma filehandling keyboard_layout memory shared $(EMU_MODULE_OBJS_ALL) ifeq ($(USE_SYSTEM_LZMA),0) MODULE_OBJS_ALL += Alloc Lzma2Dec LzmaDec diff --git a/src/cpu_md4.c b/src/cpu_md4.c deleted file mode 100644 index e65bff80a..000000000 --- a/src/cpu_md4.c +++ /dev/null @@ -1,120 +0,0 @@ -/** - * Author......: See docs/credits.txt - * License.....: MIT - */ - -#include "common.h" -#include "types.h" -#include "bitops.h" - -#define MD4_F(x,y,z) (((x) & (y)) | ((~(x)) & (z))) -#define MD4_G(x,y,z) (((x) & (y)) | ((x) & (z)) | ((y) & (z))) -#define MD4_H(x,y,z) ((x) ^ (y) ^ (z)) -#define MD4_Fo(x,y,z) (MD4_F((x), (y), (z))) -#define MD4_Go(x,y,z) (MD4_G((x), (y), (z))) - -#define MD4_STEP_S(f,a,b,c,d,x,K,s) \ -{ \ - a += K; \ - a = add3_S (a, x, f (b, c, d)); \ - a = rotl32_S (a, s); \ -} - -#define MD4_STEP(f,a,b,c,d,x,K,s) \ -{ \ - a += K; \ - a = add3 (a, x, f (b, c, d)); \ - a = rotl32 (a, s); \ -} - -#define MD4_STEP0(f,a,b,c,d,K,s) \ -{ \ - a = add3 (a, K, f (b, c, d)); \ - a = rotl32 (a, s); \ -} - -void md4_64 (const u32 block[16], u32 digest[4]) -{ - u32 w0[4]; - u32 w1[4]; - u32 w2[4]; - u32 w3[4]; - - w0[0] = block[ 0]; - w0[1] = block[ 1]; - w0[2] = block[ 2]; - w0[3] = block[ 3]; - w1[0] = block[ 4]; - w1[1] = block[ 5]; - w1[2] = block[ 6]; - w1[3] = block[ 7]; - w2[0] = block[ 8]; - w2[1] = block[ 9]; - w2[2] = block[10]; - w2[3] = block[11]; - w3[0] = block[12]; - w3[1] = block[13]; - w3[2] = block[14]; - w3[3] = block[15]; - - u32 a = digest[0]; - u32 b = digest[1]; - u32 c = digest[2]; - u32 d = digest[3]; - - MD4_STEP (MD4_Fo, a, b, c, d, w0[0], MD4C00, MD4S00); - MD4_STEP (MD4_Fo, d, a, b, c, w0[1], MD4C00, MD4S01); - MD4_STEP (MD4_Fo, c, d, a, b, w0[2], MD4C00, MD4S02); - MD4_STEP (MD4_Fo, b, c, d, a, w0[3], MD4C00, MD4S03); - MD4_STEP (MD4_Fo, a, b, c, d, w1[0], MD4C00, MD4S00); - MD4_STEP (MD4_Fo, d, a, b, c, w1[1], MD4C00, MD4S01); - MD4_STEP (MD4_Fo, c, d, a, b, w1[2], MD4C00, MD4S02); - MD4_STEP (MD4_Fo, b, c, d, a, w1[3], MD4C00, MD4S03); - MD4_STEP (MD4_Fo, a, b, c, d, w2[0], MD4C00, MD4S00); - MD4_STEP (MD4_Fo, d, a, b, c, w2[1], MD4C00, MD4S01); - MD4_STEP (MD4_Fo, c, d, a, b, w2[2], MD4C00, MD4S02); - MD4_STEP (MD4_Fo, b, c, d, a, w2[3], MD4C00, MD4S03); - MD4_STEP (MD4_Fo, a, b, c, d, w3[0], MD4C00, MD4S00); - MD4_STEP (MD4_Fo, d, a, b, c, w3[1], MD4C00, MD4S01); - MD4_STEP (MD4_Fo, c, d, a, b, w3[2], MD4C00, MD4S02); - MD4_STEP (MD4_Fo, b, c, d, a, w3[3], MD4C00, MD4S03); - - MD4_STEP (MD4_Go, a, b, c, d, w0[0], MD4C01, MD4S10); - MD4_STEP (MD4_Go, d, a, b, c, w1[0], MD4C01, MD4S11); - MD4_STEP (MD4_Go, c, d, a, b, w2[0], MD4C01, MD4S12); - MD4_STEP (MD4_Go, b, c, d, a, w3[0], MD4C01, MD4S13); - MD4_STEP (MD4_Go, a, b, c, d, w0[1], MD4C01, MD4S10); - MD4_STEP (MD4_Go, d, a, b, c, w1[1], MD4C01, MD4S11); - MD4_STEP (MD4_Go, c, d, a, b, w2[1], MD4C01, MD4S12); - MD4_STEP (MD4_Go, b, c, d, a, w3[1], MD4C01, MD4S13); - MD4_STEP (MD4_Go, a, b, c, d, w0[2], MD4C01, MD4S10); - MD4_STEP (MD4_Go, d, a, b, c, w1[2], MD4C01, MD4S11); - MD4_STEP (MD4_Go, c, d, a, b, w2[2], MD4C01, MD4S12); - MD4_STEP (MD4_Go, b, c, d, a, w3[2], MD4C01, MD4S13); - MD4_STEP (MD4_Go, a, b, c, d, w0[3], MD4C01, MD4S10); - MD4_STEP (MD4_Go, d, a, b, c, w1[3], MD4C01, MD4S11); - MD4_STEP (MD4_Go, c, d, a, b, w2[3], MD4C01, MD4S12); - MD4_STEP (MD4_Go, b, c, d, a, w3[3], MD4C01, MD4S13); - - MD4_STEP (MD4_H , a, b, c, d, w0[0], MD4C02, MD4S20); - MD4_STEP (MD4_H , d, a, b, c, w2[0], MD4C02, MD4S21); - MD4_STEP (MD4_H , c, d, a, b, w1[0], MD4C02, MD4S22); - MD4_STEP (MD4_H , b, c, d, a, w3[0], MD4C02, MD4S23); - MD4_STEP (MD4_H , a, b, c, d, w0[2], MD4C02, MD4S20); - MD4_STEP (MD4_H , d, a, b, c, w2[2], MD4C02, MD4S21); - MD4_STEP (MD4_H , c, d, a, b, w1[2], MD4C02, MD4S22); - MD4_STEP (MD4_H , b, c, d, a, w3[2], MD4C02, MD4S23); - MD4_STEP (MD4_H , a, b, c, d, w0[1], MD4C02, MD4S20); - MD4_STEP (MD4_H , d, a, b, c, w2[1], MD4C02, MD4S21); - MD4_STEP (MD4_H , c, d, a, b, w1[1], MD4C02, MD4S22); - MD4_STEP (MD4_H , b, c, d, a, w3[1], MD4C02, MD4S23); - MD4_STEP (MD4_H , a, b, c, d, w0[3], MD4C02, MD4S20); - MD4_STEP (MD4_H , d, a, b, c, w2[3], MD4C02, MD4S21); - MD4_STEP (MD4_H , c, d, a, b, w1[3], MD4C02, MD4S22); - MD4_STEP (MD4_H , b, c, d, a, w3[3], MD4C02, MD4S23); - - digest[0] += a; - digest[1] += b; - digest[2] += c; - digest[3] += d; -} diff --git a/src/emu_general.c b/src/emu_general.c new file mode 100644 index 000000000..e020fa2f2 --- /dev/null +++ b/src/emu_general.c @@ -0,0 +1,31 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#include "emu_general.h" + +u32 atomic_dec (u32 *p) +{ + return *p--; +} + +u32 atomic_inc (u32 *p) +{ + return *p++; +} + +size_t get_global_id (uint dimindx __attribute__((unused))) +{ + return 0; +} + +size_t get_local_id (uint dimindx __attribute__((unused))) +{ + return 0; +} + +size_t get_local_size (uint dimindx __attribute__((unused))) +{ + return 0; +} diff --git a/src/emu_inc_cipher_aes.c b/src/emu_inc_cipher_aes.c new file mode 100644 index 000000000..0823cdcb3 --- /dev/null +++ b/src/emu_inc_cipher_aes.c @@ -0,0 +1,21 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#include "emu_general.h" + +#define DGST_ELEM 4 +#define DGST_R0 0 +#define DGST_R1 1 +#define DGST_R2 2 +#define DGST_R3 3 + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunknown-pragmas" + +#include "inc_cipher_aes.cl" + +#pragma GCC diagnostic pop diff --git a/src/emu_inc_cipher_camellia.c b/src/emu_inc_cipher_camellia.c new file mode 100644 index 000000000..8dcbc50a9 --- /dev/null +++ b/src/emu_inc_cipher_camellia.c @@ -0,0 +1,21 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#include "emu_general.h" + +#define DGST_ELEM 4 +#define DGST_R0 0 +#define DGST_R1 1 +#define DGST_R2 2 +#define DGST_R3 3 + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunknown-pragmas" + +#include "inc_cipher_camellia.cl" + +#pragma GCC diagnostic pop diff --git a/src/emu_inc_cipher_des.c b/src/emu_inc_cipher_des.c new file mode 100644 index 000000000..be011a561 --- /dev/null +++ b/src/emu_inc_cipher_des.c @@ -0,0 +1,21 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#include "emu_general.h" + +#define DGST_ELEM 4 +#define DGST_R0 0 +#define DGST_R1 1 +#define DGST_R2 2 +#define DGST_R3 3 + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunknown-pragmas" + +#include "inc_cipher_des.cl" + +#pragma GCC diagnostic pop diff --git a/src/emu_inc_cipher_kuznyechik.c b/src/emu_inc_cipher_kuznyechik.c new file mode 100644 index 000000000..91c1bae44 --- /dev/null +++ b/src/emu_inc_cipher_kuznyechik.c @@ -0,0 +1,21 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#include "emu_general.h" + +#define DGST_ELEM 4 +#define DGST_R0 0 +#define DGST_R1 1 +#define DGST_R2 2 +#define DGST_R3 3 + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunknown-pragmas" + +#include "inc_cipher_kuznyechik.cl" + +#pragma GCC diagnostic pop diff --git a/src/emu_inc_cipher_serpent.c b/src/emu_inc_cipher_serpent.c new file mode 100644 index 000000000..0d35c148c --- /dev/null +++ b/src/emu_inc_cipher_serpent.c @@ -0,0 +1,21 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#include "emu_general.h" + +#define DGST_ELEM 4 +#define DGST_R0 0 +#define DGST_R1 1 +#define DGST_R2 2 +#define DGST_R3 3 + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunknown-pragmas" + +#include "inc_cipher_serpent.cl" + +#pragma GCC diagnostic pop diff --git a/src/emu_inc_cipher_twofish.c b/src/emu_inc_cipher_twofish.c new file mode 100644 index 000000000..a408624c9 --- /dev/null +++ b/src/emu_inc_cipher_twofish.c @@ -0,0 +1,21 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#include "emu_general.h" + +#define DGST_ELEM 4 +#define DGST_R0 0 +#define DGST_R1 1 +#define DGST_R2 2 +#define DGST_R3 3 + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunknown-pragmas" + +#include "inc_cipher_twofish.cl" + +#pragma GCC diagnostic pop diff --git a/src/emu_inc_common.c b/src/emu_inc_common.c new file mode 100644 index 000000000..972d656dd --- /dev/null +++ b/src/emu_inc_common.c @@ -0,0 +1,22 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#include "emu_general.h" +#include "bitops.h" + +#define DGST_ELEM 4 +#define DGST_R0 0 +#define DGST_R1 1 +#define DGST_R2 2 +#define DGST_R3 3 + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunknown-pragmas" + +#include "inc_common.cl" + +#pragma GCC diagnostic pop diff --git a/src/emu_inc_hash_md4.c b/src/emu_inc_hash_md4.c new file mode 100644 index 000000000..32c52af87 --- /dev/null +++ b/src/emu_inc_hash_md4.c @@ -0,0 +1,21 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#include "emu_general.h" + +#define DGST_ELEM 4 +#define DGST_R0 0 +#define DGST_R1 1 +#define DGST_R2 2 +#define DGST_R3 3 + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunknown-pragmas" + +#include "inc_hash_md4.cl" + +#pragma GCC diagnostic pop diff --git a/src/emu_inc_hash_md5.c b/src/emu_inc_hash_md5.c new file mode 100644 index 000000000..c8104104e --- /dev/null +++ b/src/emu_inc_hash_md5.c @@ -0,0 +1,21 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#include "emu_general.h" + +#define DGST_ELEM 4 +#define DGST_R0 0 +#define DGST_R1 1 +#define DGST_R2 2 +#define DGST_R3 3 + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunknown-pragmas" + +#include "inc_hash_md5.cl" + +#pragma GCC diagnostic pop diff --git a/src/emu_inc_hash_ripemd160.c b/src/emu_inc_hash_ripemd160.c new file mode 100644 index 000000000..b81d97e18 --- /dev/null +++ b/src/emu_inc_hash_ripemd160.c @@ -0,0 +1,21 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#include "emu_general.h" + +#define DGST_ELEM 4 +#define DGST_R0 0 +#define DGST_R1 1 +#define DGST_R2 2 +#define DGST_R3 3 + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunknown-pragmas" + +#include "inc_hash_ripemd160.cl" + +#pragma GCC diagnostic pop diff --git a/src/emu_inc_hash_sha1.c b/src/emu_inc_hash_sha1.c new file mode 100644 index 000000000..b60519de3 --- /dev/null +++ b/src/emu_inc_hash_sha1.c @@ -0,0 +1,21 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#include "emu_general.h" + +#define DGST_ELEM 4 +#define DGST_R0 0 +#define DGST_R1 1 +#define DGST_R2 2 +#define DGST_R3 3 + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunknown-pragmas" + +#include "inc_hash_sha1.cl" + +#pragma GCC diagnostic pop diff --git a/src/emu_inc_hash_sha224.c b/src/emu_inc_hash_sha224.c new file mode 100644 index 000000000..34f2d4b73 --- /dev/null +++ b/src/emu_inc_hash_sha224.c @@ -0,0 +1,21 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#include "emu_general.h" + +#define DGST_ELEM 4 +#define DGST_R0 0 +#define DGST_R1 1 +#define DGST_R2 2 +#define DGST_R3 3 + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunknown-pragmas" + +#include "inc_hash_sha224.cl" + +#pragma GCC diagnostic pop diff --git a/src/emu_inc_hash_sha256.c b/src/emu_inc_hash_sha256.c new file mode 100644 index 000000000..ac0517eb2 --- /dev/null +++ b/src/emu_inc_hash_sha256.c @@ -0,0 +1,21 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#include "emu_general.h" + +#define DGST_ELEM 4 +#define DGST_R0 0 +#define DGST_R1 1 +#define DGST_R2 2 +#define DGST_R3 3 + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunknown-pragmas" + +#include "inc_hash_sha256.cl" + +#pragma GCC diagnostic pop diff --git a/src/emu_inc_hash_sha384.c b/src/emu_inc_hash_sha384.c new file mode 100644 index 000000000..d7033c50c --- /dev/null +++ b/src/emu_inc_hash_sha384.c @@ -0,0 +1,21 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#include "emu_general.h" + +#define DGST_ELEM 4 +#define DGST_R0 0 +#define DGST_R1 1 +#define DGST_R2 2 +#define DGST_R3 3 + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunknown-pragmas" + +#include "inc_hash_sha384.cl" + +#pragma GCC diagnostic pop diff --git a/src/emu_inc_hash_sha512.c b/src/emu_inc_hash_sha512.c new file mode 100644 index 000000000..82058f6d1 --- /dev/null +++ b/src/emu_inc_hash_sha512.c @@ -0,0 +1,21 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#include "emu_general.h" + +#define DGST_ELEM 4 +#define DGST_R0 0 +#define DGST_R1 1 +#define DGST_R2 2 +#define DGST_R3 3 + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunknown-pragmas" + +#include "inc_hash_sha512.cl" + +#pragma GCC diagnostic pop diff --git a/src/emu_inc_hash_streebog256.c b/src/emu_inc_hash_streebog256.c new file mode 100644 index 000000000..d85b6dedd --- /dev/null +++ b/src/emu_inc_hash_streebog256.c @@ -0,0 +1,21 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#include "emu_general.h" + +#define DGST_ELEM 4 +#define DGST_R0 0 +#define DGST_R1 1 +#define DGST_R2 2 +#define DGST_R3 3 + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunknown-pragmas" + +#include "inc_hash_streebog256.cl" + +#pragma GCC diagnostic pop diff --git a/src/emu_inc_hash_streebog512.c b/src/emu_inc_hash_streebog512.c new file mode 100644 index 000000000..b343d2a92 --- /dev/null +++ b/src/emu_inc_hash_streebog512.c @@ -0,0 +1,21 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#include "emu_general.h" + +#define DGST_ELEM 4 +#define DGST_R0 0 +#define DGST_R1 1 +#define DGST_R2 2 +#define DGST_R3 3 + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunknown-pragmas" + +#include "inc_hash_streebog512.cl" + +#pragma GCC diagnostic pop diff --git a/src/emu_inc_hash_whirlpool.c b/src/emu_inc_hash_whirlpool.c new file mode 100644 index 000000000..f68200de6 --- /dev/null +++ b/src/emu_inc_hash_whirlpool.c @@ -0,0 +1,21 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#include "emu_general.h" + +#define DGST_ELEM 4 +#define DGST_R0 0 +#define DGST_R1 1 +#define DGST_R2 2 +#define DGST_R3 3 + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunknown-pragmas" + +#include "inc_hash_whirlpool.cl" + +#pragma GCC diagnostic pop diff --git a/src/emu_inc_rp.c b/src/emu_inc_rp.c new file mode 100644 index 000000000..d89aaec09 --- /dev/null +++ b/src/emu_inc_rp.c @@ -0,0 +1,21 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#include "emu_general.h" + +#define DGST_ELEM 4 +#define DGST_R0 0 +#define DGST_R1 1 +#define DGST_R2 2 +#define DGST_R3 3 + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunknown-pragmas" + +#include "inc_rp.cl" + +#pragma GCC diagnostic pop diff --git a/src/emu_inc_rp_optimized.c b/src/emu_inc_rp_optimized.c new file mode 100644 index 000000000..f24e6e982 --- /dev/null +++ b/src/emu_inc_rp_optimized.c @@ -0,0 +1,21 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#include "emu_general.h" + +#define DGST_ELEM 4 +#define DGST_R0 0 +#define DGST_R1 1 +#define DGST_R2 2 +#define DGST_R3 3 + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunknown-pragmas" + +#include "inc_rp_optimized.cl" + +#pragma GCC diagnostic pop diff --git a/src/emu_inc_scalar.c b/src/emu_inc_scalar.c new file mode 100644 index 000000000..253980a38 --- /dev/null +++ b/src/emu_inc_scalar.c @@ -0,0 +1,21 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#include "emu_general.h" + +#define DGST_ELEM 4 +#define DGST_R0 0 +#define DGST_R1 1 +#define DGST_R2 2 +#define DGST_R3 3 + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunknown-pragmas" + +#include "inc_scalar.cl" + +#pragma GCC diagnostic pop diff --git a/src/emu_inc_simd.c b/src/emu_inc_simd.c new file mode 100644 index 000000000..cf23f0c7c --- /dev/null +++ b/src/emu_inc_simd.c @@ -0,0 +1,21 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#include "emu_general.h" + +#define DGST_ELEM 4 +#define DGST_R0 0 +#define DGST_R1 1 +#define DGST_R2 2 +#define DGST_R3 3 + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunknown-pragmas" + +#include "inc_simd.cl" + +#pragma GCC diagnostic pop diff --git a/src/emu_inc_truecrypt_crc32.c b/src/emu_inc_truecrypt_crc32.c new file mode 100644 index 000000000..f62a268a0 --- /dev/null +++ b/src/emu_inc_truecrypt_crc32.c @@ -0,0 +1,21 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#include "emu_general.h" + +#define DGST_ELEM 4 +#define DGST_R0 0 +#define DGST_R1 1 +#define DGST_R2 2 +#define DGST_R3 3 + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunknown-pragmas" + +#include "inc_truecrypt_crc32.cl" + +#pragma GCC diagnostic pop diff --git a/src/emu_inc_truecrypt_keyfile.c b/src/emu_inc_truecrypt_keyfile.c new file mode 100644 index 000000000..1c524b71b --- /dev/null +++ b/src/emu_inc_truecrypt_keyfile.c @@ -0,0 +1,21 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#include "emu_general.h" + +#define DGST_ELEM 4 +#define DGST_R0 0 +#define DGST_R1 1 +#define DGST_R2 2 +#define DGST_R3 3 + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunknown-pragmas" + +#include "inc_truecrypt_keyfile.cl" + +#pragma GCC diagnostic pop diff --git a/src/emu_inc_truecrypt_xts.c b/src/emu_inc_truecrypt_xts.c new file mode 100644 index 000000000..3fa49e014 --- /dev/null +++ b/src/emu_inc_truecrypt_xts.c @@ -0,0 +1,21 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#include "emu_general.h" + +#define DGST_ELEM 4 +#define DGST_R0 0 +#define DGST_R1 1 +#define DGST_R2 2 +#define DGST_R3 3 + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunknown-pragmas" + +#include "inc_truecrypt_xts.cl" + +#pragma GCC diagnostic pop diff --git a/src/emu_m02501_pure.c b/src/emu_m02501_pure.c new file mode 100644 index 000000000..6d43aacf4 --- /dev/null +++ b/src/emu_m02501_pure.c @@ -0,0 +1,21 @@ +/** + * Author......: See docs/credits.txt + * License.....: MIT + */ + +#include "emu_general.h" + +#define DGST_ELEM 4 +#define DGST_R0 0 +#define DGST_R1 1 +#define DGST_R2 2 +#define DGST_R3 3 + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunknown-pragmas" + +#include "m02501-pure.cl" + +#pragma GCC diagnostic pop diff --git a/src/modules/module_99999.c b/src/modules/module_99999.c index afdcf69b8..a78c74150 100644 --- a/src/modules/module_99999.c +++ b/src/modules/module_99999.c @@ -10,7 +10,7 @@ #include "bitops.h" #include "convert.h" #include "shared.h" -#include "cpu_md4.h" +#include "emu_inc_hash_md4.h" static const u32 ATTACK_EXEC = ATTACK_EXEC_INSIDE_KERNEL; static const u32 DGST_POS0 = 0; @@ -81,25 +81,18 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE memcpy (w, pw_buf, pw_len); - u8 *w_ptr = (u8 *) w; + md4_ctx_t ctx; - w_ptr[line_len] = 0x80; - - w[14] = line_len * 8; + md4_init (&ctx); + md4_update (&ctx, w, pw_len); + md4_final (&ctx); u32 dgst[4]; - dgst[0] = MD4M_A; - dgst[1] = MD4M_B; - dgst[2] = MD4M_C; - dgst[3] = MD4M_D; - - md4_64 (w, dgst); - - digest[0] = dgst[0]; - digest[1] = dgst[1]; - digest[2] = dgst[2]; - digest[3] = dgst[3]; + digest[0] = ctx.h[0]; + digest[1] = ctx.h[1]; + digest[2] = ctx.h[2]; + digest[3] = ctx.h[3]; if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL) { diff --git a/src/outfile.c b/src/outfile.c index 8a4da5365..d0ec8c06b 100644 --- a/src/outfile.c +++ b/src/outfile.c @@ -12,8 +12,8 @@ #include "hashes.h" #include "mpsp.h" #include "rp.h" -#include "rp_kernel_on_cpu.h" -#include "rp_kernel_on_cpu_optimized.h" +#include "emu_inc_rp.h" +#include "emu_inc_rp_optimized.h" #include "opencl.h" #include "shared.h" #include "outfile.h" diff --git a/src/rp_kernel_on_cpu.c b/src/rp_kernel_on_cpu.c deleted file mode 100644 index e25bd2592..000000000 --- a/src/rp_kernel_on_cpu.c +++ /dev/null @@ -1,774 +0,0 @@ -/** - * Author......: See docs/credits.txt - * License.....: MIT - */ - -#include "common.h" -#include "types.h" -#include "bitops.h" -#include "rp.h" -#include "rp_kernel_on_cpu.h" - -static u64 hl32_to_64 (const u32 a, const u32 b) -{ - return (((u64) a) << 32) | b; -} - -static u32 l32_from_64_S (u64 a) -{ - const u32 r = (u32) (a); - - return r; -} - -static u32 h32_from_64_S (u64 a) -{ - a >>= 32; - - const u32 r = (u32) (a); - - return r; -} - -static u32 generate_cmask (const u32 value) -{ - const u32 rmask = ((value & 0x40404040u) >> 1u) - & ~((value & 0x80808080u) >> 2u); - - const u32 hmask = (value & 0x1f1f1f1fu) + 0x05050505u; - const u32 lmask = (value & 0x1f1f1f1fu) + 0x1f1f1f1fu; - - return rmask & ~hmask & lmask; -} - -static 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; - const int sm = off_src & 3; - const int sm8 = sm * 8; - - const int dd = off_dst / 4; - const int dm = off_dst & 3; - const int dm8 = dm * 8; - - u64 t64 = hl32_to_64 (buf_src[sd + 1], buf_src[sd + 0]); - - t64 >>= sm8; - t64 <<= dm8; - - const u32 t0 = l32_from_64_S (t64); - const u32 t1 = h32_from_64_S (t64); - - buf_dst[dd + 0] |= t0; - buf_dst[dd + 1] |= t1; -} - -static 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; - const int sm = off_src & 3; - const int sm8 = sm * 8; - - const int dd = off_dst / 4; - const int dm = off_dst & 3; - const int dm8 = dm * 8; - - u64 t64 = hl32_to_64 (buf_src[sd + 1], buf_src[sd + 0]); - - t64 >>= sm8; - t64 &= 0x00ffffff; - t64 <<= dm8; - - const u32 t0 = l32_from_64_S (t64); - const u32 t1 = h32_from_64_S (t64); - - buf_dst[dd + 0] |= t0; - buf_dst[dd + 1] |= t1; -} - -static 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; - const int sm = off_src & 3; - const int sm8 = sm * 8; - - const int dd = off_dst / 4; - const int dm = off_dst & 3; - const int dm8 = dm * 8; - - u64 t64 = hl32_to_64 (buf_src[sd + 1], buf_src[sd + 0]); - - t64 >>= sm8; - t64 &= 0x0000ffff; - t64 <<= dm8; - - const u32 t0 = l32_from_64_S (t64); - const u32 t1 = h32_from_64_S (t64); - - buf_dst[dd + 0] |= t0; - buf_dst[dd + 1] |= t1; -} - -static 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; - const int sm = off_src & 3; - const int sm8 = sm * 8; - - const int dd = off_dst / 4; - const int dm = off_dst & 3; - const int dm8 = dm * 8; - - u32 t = buf_src[sd]; - - t >>= sm8; - t &= 0xff; - t <<= dm8; - - buf_dst[dd] |= t; -} - -static void append_block (const u32 *buf_src, const int off_src, u32 *buf_dst, const int off_dst, const int len) -{ - int i; - - for (i = 0; i < len - 4; i += 4) - { - append_four_byte (buf_src, off_src + i, buf_dst, off_dst + i); - } - - const int left = len - i; - - switch (left) - { - case 4: append_four_byte (buf_src, off_src + i, buf_dst, off_dst + i); break; - case 3: append_three_byte (buf_src, off_src + i, buf_dst, off_dst + i); break; - case 2: append_two_byte (buf_src, off_src + i, buf_dst, off_dst + i); break; - case 1: append_one_byte (buf_src, off_src + i, buf_dst, off_dst + i); break; - } -} - -static void exchange_byte (u32 *buf, const int off_src, const int off_dst) -{ - u8 *ptr = (u8 *) buf; - - const u8 tmp = ptr[off_src]; - - ptr[off_src] = ptr[off_dst]; - ptr[off_dst] = tmp; - - /* - something tells me we do this faster - - const int sd = off_src / 4; - const int sm = off_src & 3; - const int sm8 = sm * 8; - - const int dd = off_dst / 4; - const int dm = off_dst & 3; - const int dm8 = dm * 8; - - u32 ts = buf[sd]; - u32 td = buf[dd]; - - ts >>= sm8; - td >>= dm8; - - ts &= 0xff; - td &= 0xff; - - const u32 x = ts ^ td; - - const u32 xs = x << sm8; - const u32 xd = x << dm8; - - buf[sd] ^= xs; - buf[dd] ^= xd; - */ -} - -static 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) - { - const u32 t = buf[idx]; - - buf[idx] = t | generate_cmask (t); - } - - return (len); -} - -static 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) - { - const u32 t = buf[idx]; - - buf[idx] = t | generate_cmask (t); - } - - const u32 t = buf[0]; - - buf[0] = t & ~(0x00000020 & generate_cmask (t)); - - return (len); -} - -static 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) - { - const u32 t = buf[idx]; - - buf[idx] = t & ~(generate_cmask (t)); - } - - return (len); -} - -static 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) - { - const u32 t = buf[idx]; - - buf[idx] = t & ~(generate_cmask (t)); - } - - const u32 t = buf[0]; - - buf[0] = t | (0x00000020 & generate_cmask (t)); - - return (len); -} - -static 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) - { - const u32 t = buf[idx]; - - buf[idx] = t ^ generate_cmask (t); - } - - return (len); -} - -static int mangle_toggle_at (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len) -{ - if (p0 >= len) return (len); - - const u8 p0d = p0 / 4; - const u8 p0m = p0 & 3; - - const u32 tmp = 0x20u << (p0m * 8); - - const u32 t = buf[p0d]; - - buf[p0d] = t ^ (generate_cmask (t) & tmp); - - return (len); -} - -static 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++) - { - const int r = len - 1 - l; - - exchange_byte (buf, l, r); - } - - return (len); -} - -static int mangle_dupeword (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len) -{ - const int out_len = len * 2; - - if (out_len >= RP_PASSWORD_SIZE) return (len); - - append_block (buf, 0, buf, len, len); - - return (out_len); -} - -static 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; - - if (out_len >= RP_PASSWORD_SIZE) return (len); - - u8 *out = buf + len; - - for (int t = 0; t < p0; t++) for (int i = 0; i < len; i++) *out++ = *buf++; - - return (out_len); -} - -static int mangle_reflect (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len) -{ - const int out_len = len * 2; - - if (out_len >= RP_PASSWORD_SIZE) return (len); - - append_block (buf, 0, buf, len, len); - - for (int l = 0; l < len / 2; l++) - { - const int r = len - 1 - l; - - exchange_byte (buf, len + l, len + r); - } - - return out_len; -} - -static int mangle_append (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len) -{ - const int out_len = len + 1; - - if (out_len >= RP_PASSWORD_SIZE) return (len); - - buf[len] = p0; - - return (out_len); -} - -static int mangle_prepend (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len) -{ - const int out_len = len + 1; - - if (out_len >= RP_PASSWORD_SIZE) return (len); - - for (int pos = len - 1; pos >= 0; pos--) - { - buf[pos + 1] = buf[pos]; - } - - buf[0] = p0; - - return (out_len); -} - -static 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--) - { - exchange_byte (buf, l, r); - } - - return (len); -} - -static 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++) - { - exchange_byte (buf, l, r); - } - - return (len); -} - -static int mangle_delete_at (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len) -{ - if (p0 >= len) return (len); - - for (int pos = p0; pos < len - 1; pos++) - { - buf[pos] = buf[pos + 1]; - } - - buf[len - 1] = 0; - - return (len - 1); -} - -static 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); -} - -static int mangle_delete_last (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len) -{ - if (len == 0) return 0; - - return mangle_delete_at ((u8) len - 1, p1, buf, len); -} - -static int mangle_extract (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len) -{ - if (p0 >= len) return (len); - - if ((p0 + p1) > len) return (len); - - for (int pos = 0; pos < p1; pos++) - { - buf[pos] = buf[p0 + pos]; - } - - for (int pos = p1; pos < len; pos++) - { - buf[pos] = 0; - } - - return (p1); -} - -static int mangle_omit (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len) -{ - if (p0 >= len) return (len); - - if ((p0 + p1) > len) return (len); - - for (int pos = p0; pos < len - p1; pos++) - { - buf[pos] = buf[pos + p1]; - } - - for (int pos = len - p1; pos < len; pos++) - { - buf[pos] = 0; - } - - return (len - p1); -} - -static int mangle_insert (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len) -{ - if (p0 >= len + 1) return (len); - - const int out_len = len + 1; - - if (out_len >= RP_PASSWORD_SIZE) return (len); - - for (int pos = len - 1; pos > p0 - 1; pos--) - { - buf[pos + 1] = buf[pos]; - } - - buf[p0] = p1; - - return (out_len); -} - -static int mangle_overstrike (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len) -{ - if (p0 >= len) return (len); - - buf[p0] = p1; - - return (len); -} - -static int mangle_truncate_at (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len) -{ - if (p0 >= len) return (len); - - for (int pos = p0; pos < len; pos++) - { - buf[pos] = 0; - } - - return (p0); -} - -static 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++) - { - if (buf[pos] != p0) continue; - - buf[pos] = p1; - } - - return (len); -} - -static int mangle_purgechar (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len) -{ - int out_len = 0; - - for (int pos = 0; pos < len; pos++) - { - if (buf[pos] == p0) continue; - - buf[out_len] = buf[pos]; - - out_len++; - } - - for (int pos = out_len; pos < len; pos++) - { - buf[pos] = 0; - } - - return (out_len); -} - -static 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; - - if (out_len >= RP_PASSWORD_SIZE) return (len); - - const u8 c = buf[0]; - - for (int i = 0; i < p0; i++) - { - mangle_prepend (c, 0, buf, len + i); - } - - return (out_len); -} - -static 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; - - if (len == 0) return (len); - if (out_len >= RP_PASSWORD_SIZE) return (len); - - const u8 c = buf[len - 1]; - - for (int i = 0; i < p0; i++) - { - mangle_append (c, 0, buf, len + i); - } - - return (out_len); -} - -static 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; - - if (out_len >= RP_PASSWORD_SIZE) return (len); - - for (int pos = len - 1; pos >= 0; pos--) - { - int new_pos = pos * 2; - - buf[new_pos] = buf[pos]; - - buf[new_pos + 1] = buf[pos]; - } - - return (out_len); -} - -static int mangle_switch_first (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len) -{ - if (len < 2) return (len); - - exchange_byte (buf, 0, 1); - - return (len); -} - -static int mangle_switch_last (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len) -{ - if (len < 2) return (len); - - exchange_byte (buf, len - 2, len - 1); - - return (len); -} - -static int mangle_switch_at (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u32 *buf, const int len) -{ - if (p0 >= len) return (len); - if (p1 >= len) return (len); - - exchange_byte (buf, p0, p1); - - return (len); -} - -static int mangle_chr_shiftl (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len) -{ - if (p0 >= len) return (len); - - buf[p0] <<= 1; - - return (len); -} - -static int mangle_chr_shiftr (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len) -{ - if (p0 >= len) return (len); - - buf[p0] >>= 1; - - return (len); -} - -static int mangle_chr_incr (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len) -{ - if (p0 >= len) return (len); - - buf[p0]++; - - return (len); -} - -static int mangle_chr_decr (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len) -{ - if (p0 >= len) return (len); - - buf[p0]--; - - return (len); -} - -static 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); - - buf[p0] = buf[p0 + 1]; - - return (len); -} - -static int mangle_replace_nm1 (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len) -{ - if (p0 == 0) return (len); - - if (p0 >= len) return (len); - - buf[p0] = buf[p0 - 1]; - - return (len); -} - -static int mangle_dupeblock_first (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len) -{ - if (p0 >= len) return (len); - - const int out_len = len + p0; - - if (out_len >= RP_PASSWORD_SIZE) return (len); - - for (u8 i = 0; i < p0; i++) - { - const u8 c = buf[i * 2]; - - mangle_insert (i, c, buf, len + i); - } - - return (out_len); -} - -static int mangle_dupeblock_last (MAYBE_UNUSED const u8 p0, MAYBE_UNUSED const u8 p1, u8 *buf, const int len) -{ - if (p0 >= len) return (len); - - const int out_len = len + p0; - - if (out_len >= RP_PASSWORD_SIZE) return (len); - - for (int i = 0; i < p0; i++) - { - const u8 c = buf[len - p0 + i]; - - mangle_append (c, 0, buf, len + i); - } - - return (out_len); -} - -static 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 - - mangle_lrest_ufirst (0, 0, buf, len); - - for (int i = 0, idx = 0; i < len; i += 4, idx += 1) - { - const u32 v = buf[idx]; - - u32 out0 = 0; - u32 out1 = 0; - - if (((v >> 0) & 0xff) == p0) out0 |= 0x0000ff00; - if (((v >> 8) & 0xff) == p0) out0 |= 0x00ff0000; - if (((v >> 16) & 0xff) == p0) out0 |= 0xff000000; - if (((v >> 24) & 0xff) == p0) out1 |= 0x000000ff; - - buf[idx + 0] &= ~(generate_cmask (buf[idx + 0]) & out0); - buf[idx + 1] &= ~(generate_cmask (buf[idx + 1]) & out1); - } - - return (len); -} - -static 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; - - switch (name) - { - case RULE_OP_MANGLE_LREST: out_len = mangle_lrest (p0, p1, buf, out_len); break; - case RULE_OP_MANGLE_LREST_UFIRST: out_len = mangle_lrest_ufirst (p0, p1, buf, out_len); break; - case RULE_OP_MANGLE_UREST: out_len = mangle_urest (p0, p1, buf, out_len); break; - case RULE_OP_MANGLE_UREST_LFIRST: out_len = mangle_urest_lfirst (p0, p1, buf, out_len); break; - case RULE_OP_MANGLE_TREST: out_len = mangle_trest (p0, p1, buf, out_len); break; - case RULE_OP_MANGLE_TOGGLE_AT: out_len = mangle_toggle_at (p0, p1, buf, out_len); break; - case RULE_OP_MANGLE_REVERSE: out_len = mangle_reverse (p0, p1, buf, out_len); break; - case RULE_OP_MANGLE_DUPEWORD: out_len = mangle_dupeword (p0, p1, buf, out_len); break; - case RULE_OP_MANGLE_DUPEWORD_TIMES: out_len = mangle_dupeword_times (p0, p1, (u8 *) buf, out_len); break; - case RULE_OP_MANGLE_REFLECT: out_len = mangle_reflect (p0, p1, buf, out_len); break; - case RULE_OP_MANGLE_APPEND: out_len = mangle_append (p0, p1, (u8 *) buf, out_len); break; - case RULE_OP_MANGLE_PREPEND: out_len = mangle_prepend (p0, p1, (u8 *) buf, out_len); break; - case RULE_OP_MANGLE_ROTATE_LEFT: out_len = mangle_rotate_left (p0, p1, buf, out_len); break; - case RULE_OP_MANGLE_ROTATE_RIGHT: out_len = mangle_rotate_right (p0, p1, buf, out_len); break; - case RULE_OP_MANGLE_DELETE_FIRST: out_len = mangle_delete_first (p0, p1, (u8 *) buf, out_len); break; - case RULE_OP_MANGLE_DELETE_LAST: out_len = mangle_delete_last (p0, p1, (u8 *) buf, out_len); break; - case RULE_OP_MANGLE_DELETE_AT: out_len = mangle_delete_at (p0, p1, (u8 *) buf, out_len); break; - case RULE_OP_MANGLE_EXTRACT: out_len = mangle_extract (p0, p1, (u8 *) buf, out_len); break; - case RULE_OP_MANGLE_OMIT: out_len = mangle_omit (p0, p1, (u8 *) buf, out_len); break; - case RULE_OP_MANGLE_INSERT: out_len = mangle_insert (p0, p1, (u8 *) buf, out_len); break; - case RULE_OP_MANGLE_OVERSTRIKE: out_len = mangle_overstrike (p0, p1, (u8 *) buf, out_len); break; - case RULE_OP_MANGLE_TRUNCATE_AT: out_len = mangle_truncate_at (p0, p1, (u8 *) buf, out_len); break; - case RULE_OP_MANGLE_REPLACE: out_len = mangle_replace (p0, p1, (u8 *) buf, out_len); break; - case RULE_OP_MANGLE_PURGECHAR: out_len = mangle_purgechar (p0, p1, (u8 *) buf, out_len); break; - case RULE_OP_MANGLE_DUPECHAR_FIRST: out_len = mangle_dupechar_first (p0, p1, (u8 *) buf, out_len); break; - case RULE_OP_MANGLE_DUPECHAR_LAST: out_len = mangle_dupechar_last (p0, p1, (u8 *) buf, out_len); break; - case RULE_OP_MANGLE_DUPECHAR_ALL: out_len = mangle_dupechar_all (p0, p1, (u8 *) buf, out_len); break; - case RULE_OP_MANGLE_SWITCH_FIRST: out_len = mangle_switch_first (p0, p1, buf, out_len); break; - case RULE_OP_MANGLE_SWITCH_LAST: out_len = mangle_switch_last (p0, p1, buf, out_len); break; - case RULE_OP_MANGLE_SWITCH_AT: out_len = mangle_switch_at (p0, p1, buf, out_len); break; - case RULE_OP_MANGLE_CHR_SHIFTL: out_len = mangle_chr_shiftl (p0, p1, (u8 *) buf, out_len); break; - case RULE_OP_MANGLE_CHR_SHIFTR: out_len = mangle_chr_shiftr (p0, p1, (u8 *) buf, out_len); break; - case RULE_OP_MANGLE_CHR_INCR: out_len = mangle_chr_incr (p0, p1, (u8 *) buf, out_len); break; - case RULE_OP_MANGLE_CHR_DECR: out_len = mangle_chr_decr (p0, p1, (u8 *) buf, out_len); break; - case RULE_OP_MANGLE_REPLACE_NP1: out_len = mangle_replace_np1 (p0, p1, (u8 *) buf, out_len); break; - case RULE_OP_MANGLE_REPLACE_NM1: out_len = mangle_replace_nm1 (p0, p1, (u8 *) buf, out_len); break; - case RULE_OP_MANGLE_DUPEBLOCK_FIRST: out_len = mangle_dupeblock_first (p0, p1, (u8 *) buf, out_len); break; - case RULE_OP_MANGLE_DUPEBLOCK_LAST: out_len = mangle_dupeblock_last (p0, p1, (u8 *) buf, out_len); break; - case RULE_OP_MANGLE_TITLE_SEP: out_len = mangle_title_sep (p0, p1, buf, out_len); break; - case RULE_OP_MANGLE_TITLE: out_len = mangle_title_sep (' ', p1, buf, out_len); break; - } - - return out_len; -} - -int apply_rules (const u32 *cmds, u32 *buf, const int in_len) -{ - int out_len = in_len; - - for (u32 i = 0; cmds[i] != 0; i++) - { - const u32 cmd = cmds[i]; - - const u8 name = (cmd >> 0) & 0xff; - const u8 p0 = (cmd >> 8) & 0xff; - const u8 p1 = (cmd >> 16) & 0xff; - - out_len = apply_rule (name, p0, p1, buf, out_len); - } - - return out_len; -} diff --git a/src/rp_kernel_on_cpu_optimized.c b/src/rp_kernel_on_cpu_optimized.c deleted file mode 100644 index 3567dca1f..000000000 --- a/src/rp_kernel_on_cpu_optimized.c +++ /dev/null @@ -1,2558 +0,0 @@ -/** - * Author......: See docs/credits.txt - * License.....: MIT - */ - -#include "common.h" -#include "types.h" -#include "bitops.h" -#include "rp.h" -#include "rp_kernel_on_cpu_optimized.h" - -static u32 amd_bytealign_S (const u32 a, const u32 b, const u32 c) -{ - const u64 tmp = ((((u64) (a)) << 32) | ((u64) (b))) >> ((c & 3) * 8); - - return (u32) tmp; -} - -static u32 swap32_S (const u32 value) -{ - return byte_swap_32 (value); -} - -static u32 generate_cmask (const u32 value) -{ - const u32 rmask = ((value & 0x40404040u) >> 1u) - & ~((value & 0x80808080u) >> 2u); - - const u32 hmask = (value & 0x1f1f1f1fu) + 0x05050505u; - const u32 lmask = (value & 0x1f1f1f1fu) + 0x1f1f1f1fu; - - return rmask & ~hmask & lmask; -} - -static void truncate_right (u32 buf0[4], u32 buf1[4], const u32 offset) -{ - const u32 tmp = (1u << ((offset & 3u) * 8u)) - 1u; - - switch (offset / 4) - { - case 0: buf0[0] &= tmp; - buf0[1] = 0; - buf0[2] = 0; - buf0[3] = 0; - buf1[0] = 0; - buf1[1] = 0; - buf1[2] = 0; - buf1[3] = 0; - break; - case 1: buf0[1] &= tmp; - buf0[2] = 0; - buf0[3] = 0; - buf1[0] = 0; - buf1[1] = 0; - buf1[2] = 0; - buf1[3] = 0; - break; - case 2: buf0[2] &= tmp; - buf0[3] = 0; - buf1[0] = 0; - buf1[1] = 0; - buf1[2] = 0; - buf1[3] = 0; - break; - case 3: buf0[3] &= tmp; - buf1[0] = 0; - buf1[1] = 0; - buf1[2] = 0; - buf1[3] = 0; - break; - case 4: buf1[0] &= tmp; - buf1[1] = 0; - buf1[2] = 0; - buf1[3] = 0; - break; - case 5: buf1[1] &= tmp; - buf1[2] = 0; - buf1[3] = 0; - break; - case 6: buf1[2] &= tmp; - buf1[3] = 0; - break; - case 7: buf1[3] &= tmp; - break; - } -} - -static void truncate_left (u32 buf0[4], u32 buf1[4], const u32 offset) -{ - const u32 tmp = ~((1u << ((offset & 3u) * 8u)) - 1u); - - switch (offset / 4) - { - case 0: buf0[0] &= tmp; - break; - case 1: buf0[0] = 0; - buf0[1] &= tmp; - break; - case 2: buf0[0] = 0; - buf0[1] = 0; - buf0[2] &= tmp; - break; - case 3: buf0[0] = 0; - buf0[1] = 0; - buf0[2] = 0; - buf0[3] &= tmp; - break; - case 4: buf0[0] = 0; - buf0[1] = 0; - buf0[2] = 0; - buf0[3] = 0; - buf1[0] &= tmp; - break; - case 5: buf0[0] = 0; - buf0[1] = 0; - buf0[2] = 0; - buf0[3] = 0; - buf1[0] = 0; - buf1[1] &= tmp; - break; - case 6: buf0[0] = 0; - buf0[1] = 0; - buf0[2] = 0; - buf0[3] = 0; - buf1[0] = 0; - buf1[1] = 0; - buf1[2] &= tmp; - break; - case 7: buf0[0] = 0; - buf0[1] = 0; - buf0[2] = 0; - buf0[3] = 0; - buf1[0] = 0; - buf1[1] = 0; - buf1[2] = 0; - buf1[3] &= tmp; - break; - } -} - -static void lshift_block (const u32 in0[4], const u32 in1[4], u32 out0[4], u32 out1[4]) -{ - out0[0] = amd_bytealign_S (in0[1], in0[0], 1); - out0[1] = amd_bytealign_S (in0[2], in0[1], 1); - out0[2] = amd_bytealign_S (in0[3], in0[2], 1); - out0[3] = amd_bytealign_S (in1[0], in0[3], 1); - out1[0] = amd_bytealign_S (in1[1], in1[0], 1); - out1[1] = amd_bytealign_S (in1[2], in1[1], 1); - out1[2] = amd_bytealign_S (in1[3], in1[2], 1); - out1[3] = amd_bytealign_S ( 0, in1[3], 1); -} - -static void rshift_block (const u32 in0[4], const u32 in1[4], u32 out0[4], u32 out1[4]) -{ - out1[3] = amd_bytealign_S (in1[3], in1[2], 3); - out1[2] = amd_bytealign_S (in1[2], in1[1], 3); - out1[1] = amd_bytealign_S (in1[1], in1[0], 3); - out1[0] = amd_bytealign_S (in1[0], in0[3], 3); - out0[3] = amd_bytealign_S (in0[3], in0[2], 3); - out0[2] = amd_bytealign_S (in0[2], in0[1], 3); - out0[1] = amd_bytealign_S (in0[1], in0[0], 3); - out0[0] = amd_bytealign_S (in0[0], 0, 3); -} - -static void lshift_block_N (const u32 in0[4], const u32 in1[4], u32 out0[4], u32 out1[4], const u32 num) -{ - switch (num) - { - case 0: out0[0] = in0[0]; - out0[1] = in0[1]; - out0[2] = in0[2]; - out0[3] = in0[3]; - out1[0] = in1[0]; - out1[1] = in1[1]; - out1[2] = in1[2]; - out1[3] = in1[3]; - break; - case 1: out0[0] = amd_bytealign_S (in0[1], in0[0], 1); - out0[1] = amd_bytealign_S (in0[2], in0[1], 1); - out0[2] = amd_bytealign_S (in0[3], in0[2], 1); - out0[3] = amd_bytealign_S (in1[0], in0[3], 1); - out1[0] = amd_bytealign_S (in1[1], in1[0], 1); - out1[1] = amd_bytealign_S (in1[2], in1[1], 1); - out1[2] = amd_bytealign_S (in1[3], in1[2], 1); - out1[3] = amd_bytealign_S ( 0, in1[3], 1); - break; - case 2: out0[0] = amd_bytealign_S (in0[1], in0[0], 2); - out0[1] = amd_bytealign_S (in0[2], in0[1], 2); - out0[2] = amd_bytealign_S (in0[3], in0[2], 2); - out0[3] = amd_bytealign_S (in1[0], in0[3], 2); - out1[0] = amd_bytealign_S (in1[1], in1[0], 2); - out1[1] = amd_bytealign_S (in1[2], in1[1], 2); - out1[2] = amd_bytealign_S (in1[3], in1[2], 2); - out1[3] = amd_bytealign_S ( 0, in1[3], 2); - break; - case 3: out0[0] = amd_bytealign_S (in0[1], in0[0], 3); - out0[1] = amd_bytealign_S (in0[2], in0[1], 3); - out0[2] = amd_bytealign_S (in0[3], in0[2], 3); - out0[3] = amd_bytealign_S (in1[0], in0[3], 3); - out1[0] = amd_bytealign_S (in1[1], in1[0], 3); - out1[1] = amd_bytealign_S (in1[2], in1[1], 3); - out1[2] = amd_bytealign_S (in1[3], in1[2], 3); - out1[3] = amd_bytealign_S ( 0, in1[3], 3); - break; - case 4: out0[0] = in0[1]; - out0[1] = in0[2]; - out0[2] = in0[3]; - out0[3] = in1[0]; - out1[0] = in1[1]; - out1[1] = in1[2]; - out1[2] = in1[3]; - out1[3] = 0; - break; - case 5: out0[0] = amd_bytealign_S (in0[2], in0[1], 1); - out0[1] = amd_bytealign_S (in0[3], in0[2], 1); - out0[2] = amd_bytealign_S (in1[0], in0[3], 1); - out0[3] = amd_bytealign_S (in1[1], in1[0], 1); - out1[0] = amd_bytealign_S (in1[2], in1[1], 1); - out1[1] = amd_bytealign_S (in1[3], in1[2], 1); - out1[2] = amd_bytealign_S ( 0, in1[3], 1); - out1[3] = 0; - break; - case 6: out0[0] = amd_bytealign_S (in0[2], in0[1], 2); - out0[1] = amd_bytealign_S (in0[3], in0[2], 2); - out0[2] = amd_bytealign_S (in1[0], in0[3], 2); - out0[3] = amd_bytealign_S (in1[1], in1[0], 2); - out1[0] = amd_bytealign_S (in1[2], in1[1], 2); - out1[1] = amd_bytealign_S (in1[3], in1[2], 2); - out1[2] = amd_bytealign_S ( 0, in1[3], 2); - out1[3] = 0; - break; - case 7: out0[0] = amd_bytealign_S (in0[2], in0[1], 3); - out0[1] = amd_bytealign_S (in0[3], in0[2], 3); - out0[2] = amd_bytealign_S (in1[0], in0[3], 3); - out0[3] = amd_bytealign_S (in1[1], in1[0], 3); - out1[0] = amd_bytealign_S (in1[2], in1[1], 3); - out1[1] = amd_bytealign_S (in1[3], in1[2], 3); - out1[2] = amd_bytealign_S ( 0, in1[3], 3); - out1[3] = 0; - break; - case 8: out0[0] = in0[2]; - out0[1] = in0[3]; - out0[2] = in1[0]; - out0[3] = in1[1]; - out1[0] = in1[2]; - out1[1] = in1[3]; - out1[2] = 0; - out1[3] = 0; - break; - case 9: out0[0] = amd_bytealign_S (in0[3], in0[2], 1); - out0[1] = amd_bytealign_S (in1[0], in0[3], 1); - out0[2] = amd_bytealign_S (in1[1], in1[0], 1); - out0[3] = amd_bytealign_S (in1[2], in1[1], 1); - out1[0] = amd_bytealign_S (in1[3], in1[2], 1); - out1[1] = amd_bytealign_S ( 0, in1[3], 1); - out1[2] = 0; - out1[3] = 0; - break; - case 10: out0[0] = amd_bytealign_S (in0[3], in0[2], 2); - out0[1] = amd_bytealign_S (in1[0], in0[3], 2); - out0[2] = amd_bytealign_S (in1[1], in1[0], 2); - out0[3] = amd_bytealign_S (in1[2], in1[1], 2); - out1[0] = amd_bytealign_S (in1[3], in1[2], 2); - out1[1] = amd_bytealign_S ( 0, in1[3], 2); - out1[2] = 0; - out1[3] = 0; - break; - case 11: out0[0] = amd_bytealign_S (in0[3], in0[2], 3); - out0[1] = amd_bytealign_S (in1[0], in0[3], 3); - out0[2] = amd_bytealign_S (in1[1], in1[0], 3); - out0[3] = amd_bytealign_S (in1[2], in1[1], 3); - out1[0] = amd_bytealign_S (in1[3], in1[2], 3); - out1[1] = amd_bytealign_S ( 0, in1[3], 3); - out1[2] = 0; - out1[3] = 0; - break; - case 12: out0[0] = in0[3]; - out0[1] = in1[0]; - out0[2] = in1[1]; - out0[3] = in1[2]; - out1[0] = in1[3]; - out1[1] = 0; - out1[2] = 0; - out1[3] = 0; - break; - case 13: out0[0] = amd_bytealign_S (in1[0], in0[3], 1); - out0[1] = amd_bytealign_S (in1[1], in1[0], 1); - out0[2] = amd_bytealign_S (in1[2], in1[1], 1); - out0[3] = amd_bytealign_S (in1[3], in1[2], 1); - out1[0] = amd_bytealign_S ( 0, in1[3], 1); - out1[1] = 0; - out1[2] = 0; - out1[3] = 0; - break; - case 14: out0[0] = amd_bytealign_S (in1[0], in0[3], 2); - out0[1] = amd_bytealign_S (in1[1], in1[0], 2); - out0[2] = amd_bytealign_S (in1[2], in1[1], 2); - out0[3] = amd_bytealign_S (in1[3], in1[2], 2); - out1[0] = amd_bytealign_S ( 0, in1[3], 2); - out1[1] = 0; - out1[2] = 0; - out1[3] = 0; - break; - case 15: out0[0] = amd_bytealign_S (in1[0], in0[3], 3); - out0[1] = amd_bytealign_S (in1[1], in1[0], 3); - out0[2] = amd_bytealign_S (in1[2], in1[1], 3); - out0[3] = amd_bytealign_S (in1[3], in1[2], 3); - out1[0] = amd_bytealign_S ( 0, in1[3], 3); - out1[1] = 0; - out1[2] = 0; - out1[3] = 0; - break; - case 16: out0[0] = in1[0]; - out0[1] = in1[1]; - out0[2] = in1[2]; - out0[3] = in1[3]; - out1[0] = 0; - out1[1] = 0; - out1[2] = 0; - out1[3] = 0; - break; - case 17: out0[0] = amd_bytealign_S (in1[1], in1[0], 1); - out0[1] = amd_bytealign_S (in1[2], in1[1], 1); - out0[2] = amd_bytealign_S (in1[3], in1[2], 1); - out0[3] = amd_bytealign_S ( 0, in1[3], 1); - out1[0] = 0; - out1[1] = 0; - out1[2] = 0; - out1[3] = 0; - break; - case 18: out0[0] = amd_bytealign_S (in1[1], in1[0], 2); - out0[1] = amd_bytealign_S (in1[2], in1[1], 2); - out0[2] = amd_bytealign_S (in1[3], in1[2], 2); - out0[3] = amd_bytealign_S ( 0, in1[3], 2); - out1[0] = 0; - out1[1] = 0; - out1[2] = 0; - out1[3] = 0; - break; - case 19: out0[0] = amd_bytealign_S (in1[1], in1[0], 3); - out0[1] = amd_bytealign_S (in1[2], in1[1], 3); - out0[2] = amd_bytealign_S (in1[3], in1[2], 3); - out0[3] = amd_bytealign_S ( 0, in1[3], 3); - out1[0] = 0; - out1[1] = 0; - out1[2] = 0; - out1[3] = 0; - break; - case 20: out0[0] = in1[1]; - out0[1] = in1[2]; - out0[2] = in1[3]; - out0[3] = 0; - out1[0] = 0; - out1[1] = 0; - out1[2] = 0; - out1[3] = 0; - break; - case 21: out0[0] = amd_bytealign_S (in1[2], in1[1], 1); - out0[1] = amd_bytealign_S (in1[3], in1[2], 1); - out0[2] = amd_bytealign_S ( 0, in1[3], 1); - out0[3] = 0; - out1[0] = 0; - out1[1] = 0; - out1[2] = 0; - out1[3] = 0; - break; - case 22: out0[0] = amd_bytealign_S (in1[2], in1[1], 2); - out0[1] = amd_bytealign_S (in1[3], in1[2], 2); - out0[2] = amd_bytealign_S ( 0, in1[3], 2); - out0[3] = 0; - out1[0] = 0; - out1[1] = 0; - out1[2] = 0; - out1[3] = 0; - break; - case 23: out0[0] = amd_bytealign_S (in1[2], in1[1], 3); - out0[1] = amd_bytealign_S (in1[3], in1[2], 3); - out0[2] = amd_bytealign_S ( 0, in1[3], 3); - out0[3] = 0; - out1[0] = 0; - out1[1] = 0; - out1[2] = 0; - out1[3] = 0; - break; - case 24: out0[0] = in1[2]; - out0[1] = in1[3]; - out0[2] = 0; - out0[3] = 0; - out1[0] = 0; - out1[1] = 0; - out1[2] = 0; - out1[3] = 0; - break; - case 25: out0[0] = amd_bytealign_S (in1[3], in1[2], 1); - out0[1] = amd_bytealign_S ( 0, in1[3], 1); - out0[2] = 0; - out0[3] = 0; - out1[0] = 0; - out1[1] = 0; - out1[2] = 0; - out1[3] = 0; - break; - case 26: out0[0] = amd_bytealign_S (in1[3], in1[2], 2); - out0[1] = amd_bytealign_S ( 0, in1[3], 2); - out0[2] = 0; - out0[3] = 0; - out1[0] = 0; - out1[1] = 0; - out1[2] = 0; - out1[3] = 0; - break; - case 27: out0[0] = amd_bytealign_S (in1[3], in1[2], 3); - out0[1] = amd_bytealign_S ( 0, in1[3], 3); - out0[2] = 0; - out0[3] = 0; - out1[0] = 0; - out1[1] = 0; - out1[2] = 0; - out1[3] = 0; - break; - case 28: out0[0] = in1[3]; - out0[1] = 0; - out0[2] = 0; - out0[3] = 0; - out1[0] = 0; - out1[1] = 0; - out1[2] = 0; - out1[3] = 0; - break; - case 29: out0[0] = amd_bytealign_S ( 0, in1[3], 1); - out0[1] = 0; - out0[2] = 0; - out0[3] = 0; - out1[0] = 0; - out1[1] = 0; - out1[2] = 0; - out1[3] = 0; - break; - case 30: out0[0] = amd_bytealign_S ( 0, in1[3], 2); - out0[1] = 0; - out0[2] = 0; - out0[3] = 0; - out1[0] = 0; - out1[1] = 0; - out1[2] = 0; - out1[3] = 0; - break; - case 31: out0[0] = amd_bytealign_S ( 0, in1[3], 3); - out0[1] = 0; - out0[2] = 0; - out0[3] = 0; - out1[0] = 0; - out1[1] = 0; - out1[2] = 0; - out1[3] = 0; - break; - } -} - -static void rshift_block_N (const u32 in0[4], const u32 in1[4], u32 out0[4], u32 out1[4], const u32 num) -{ - switch (num) - { - case 0: out1[3] = in1[3]; - out1[2] = in1[2]; - out1[1] = in1[1]; - out1[0] = in1[0]; - out0[3] = in0[3]; - out0[2] = in0[2]; - out0[1] = in0[1]; - out0[0] = in0[0]; - break; - case 1: out1[3] = amd_bytealign_S (in1[3], in1[2], 3); - out1[2] = amd_bytealign_S (in1[2], in1[1], 3); - out1[1] = amd_bytealign_S (in1[1], in1[0], 3); - out1[0] = amd_bytealign_S (in1[0], in0[3], 3); - out0[3] = amd_bytealign_S (in0[3], in0[2], 3); - out0[2] = amd_bytealign_S (in0[2], in0[1], 3); - out0[1] = amd_bytealign_S (in0[1], in0[0], 3); - out0[0] = amd_bytealign_S (in0[0], 0, 3); - break; - case 2: out1[3] = amd_bytealign_S (in1[3], in1[2], 2); - out1[2] = amd_bytealign_S (in1[2], in1[1], 2); - out1[1] = amd_bytealign_S (in1[1], in1[0], 2); - out1[0] = amd_bytealign_S (in1[0], in0[3], 2); - out0[3] = amd_bytealign_S (in0[3], in0[2], 2); - out0[2] = amd_bytealign_S (in0[2], in0[1], 2); - out0[1] = amd_bytealign_S (in0[1], in0[0], 2); - out0[0] = amd_bytealign_S (in0[0], 0, 2); - break; - case 3: out1[3] = amd_bytealign_S (in1[3], in1[2], 1); - out1[2] = amd_bytealign_S (in1[2], in1[1], 1); - out1[1] = amd_bytealign_S (in1[1], in1[0], 1); - out1[0] = amd_bytealign_S (in1[0], in0[3], 1); - out0[3] = amd_bytealign_S (in0[3], in0[2], 1); - out0[2] = amd_bytealign_S (in0[2], in0[1], 1); - out0[1] = amd_bytealign_S (in0[1], in0[0], 1); - out0[0] = amd_bytealign_S (in0[0], 0, 1); - break; - case 4: out1[3] = in1[2]; - out1[2] = in1[1]; - out1[1] = in1[0]; - out1[0] = in0[3]; - out0[3] = in0[2]; - out0[2] = in0[1]; - out0[1] = in0[0]; - out0[0] = 0; - break; - case 5: out1[3] = amd_bytealign_S (in1[2], in1[1], 3); - out1[2] = amd_bytealign_S (in1[1], in1[0], 3); - out1[1] = amd_bytealign_S (in1[0], in0[3], 3); - out1[0] = amd_bytealign_S (in0[3], in0[2], 3); - out0[3] = amd_bytealign_S (in0[2], in0[1], 3); - out0[2] = amd_bytealign_S (in0[1], in0[0], 3); - out0[1] = amd_bytealign_S (in0[0], 0, 3); - out0[0] = 0; - break; - case 6: out1[3] = amd_bytealign_S (in1[2], in1[1], 2); - out1[2] = amd_bytealign_S (in1[1], in1[0], 2); - out1[1] = amd_bytealign_S (in1[0], in0[3], 2); - out1[0] = amd_bytealign_S (in0[3], in0[2], 2); - out0[3] = amd_bytealign_S (in0[2], in0[1], 2); - out0[2] = amd_bytealign_S (in0[1], in0[0], 2); - out0[1] = amd_bytealign_S (in0[0], 0, 2); - out0[0] = 0; - break; - case 7: out1[3] = amd_bytealign_S (in1[2], in1[1], 1); - out1[2] = amd_bytealign_S (in1[1], in1[0], 1); - out1[1] = amd_bytealign_S (in1[0], in0[3], 1); - out1[0] = amd_bytealign_S (in0[3], in0[2], 1); - out0[3] = amd_bytealign_S (in0[2], in0[1], 1); - out0[2] = amd_bytealign_S (in0[1], in0[0], 1); - out0[1] = amd_bytealign_S (in0[0], 0, 1); - out0[0] = 0; - break; - case 8: out1[3] = in1[1]; - out1[2] = in1[0]; - out1[1] = in0[3]; - out1[0] = in0[2]; - out0[3] = in0[1]; - out0[2] = in0[0]; - out0[1] = 0; - out0[0] = 0; - break; - case 9: out1[3] = amd_bytealign_S (in1[1], in1[0], 3); - out1[2] = amd_bytealign_S (in1[0], in0[3], 3); - out1[1] = amd_bytealign_S (in0[3], in0[2], 3); - out1[0] = amd_bytealign_S (in0[2], in0[1], 3); - out0[3] = amd_bytealign_S (in0[1], in0[0], 3); - out0[2] = amd_bytealign_S (in0[0], 0, 3); - out0[1] = 0; - out0[0] = 0; - break; - case 10: out1[3] = amd_bytealign_S (in1[1], in1[0], 2); - out1[2] = amd_bytealign_S (in1[0], in0[3], 2); - out1[1] = amd_bytealign_S (in0[3], in0[2], 2); - out1[0] = amd_bytealign_S (in0[2], in0[1], 2); - out0[3] = amd_bytealign_S (in0[1], in0[0], 2); - out0[2] = amd_bytealign_S (in0[0], 0, 2); - out0[1] = 0; - out0[0] = 0; - break; - case 11: out1[3] = amd_bytealign_S (in1[1], in1[0], 1); - out1[2] = amd_bytealign_S (in1[0], in0[3], 1); - out1[1] = amd_bytealign_S (in0[3], in0[2], 1); - out1[0] = amd_bytealign_S (in0[2], in0[1], 1); - out0[3] = amd_bytealign_S (in0[1], in0[0], 1); - out0[2] = amd_bytealign_S (in0[0], 0, 1); - out0[1] = 0; - out0[0] = 0; - break; - case 12: out1[3] = in1[0]; - out1[2] = in0[3]; - out1[1] = in0[2]; - out1[0] = in0[1]; - out0[3] = in0[0]; - out0[2] = 0; - out0[1] = 0; - out0[0] = 0; - break; - case 13: out1[3] = amd_bytealign_S (in1[0], in0[3], 3); - out1[2] = amd_bytealign_S (in0[3], in0[2], 3); - out1[1] = amd_bytealign_S (in0[2], in0[1], 3); - out1[0] = amd_bytealign_S (in0[1], in0[0], 3); - out0[3] = amd_bytealign_S (in0[0], 0, 3); - out0[2] = 0; - out0[1] = 0; - out0[0] = 0; - break; - case 14: out1[3] = amd_bytealign_S (in1[0], in0[3], 2); - out1[2] = amd_bytealign_S (in0[3], in0[2], 2); - out1[1] = amd_bytealign_S (in0[2], in0[1], 2); - out1[0] = amd_bytealign_S (in0[1], in0[0], 2); - out0[3] = amd_bytealign_S (in0[0], 0, 2); - out0[2] = 0; - out0[1] = 0; - out0[0] = 0; - break; - case 15: out1[3] = amd_bytealign_S (in1[0], in0[3], 1); - out1[2] = amd_bytealign_S (in0[3], in0[2], 1); - out1[1] = amd_bytealign_S (in0[2], in0[1], 1); - out1[0] = amd_bytealign_S (in0[1], in0[0], 1); - out0[3] = amd_bytealign_S (in0[0], 0, 1); - out0[2] = 0; - out0[1] = 0; - out0[0] = 0; - break; - case 16: out1[3] = in0[3]; - out1[2] = in0[2]; - out1[1] = in0[1]; - out1[0] = in0[0]; - out0[3] = 0; - out0[2] = 0; - out0[1] = 0; - out0[0] = 0; - break; - case 17: out1[3] = amd_bytealign_S (in0[3], in0[2], 3); - out1[2] = amd_bytealign_S (in0[2], in0[1], 3); - out1[1] = amd_bytealign_S (in0[1], in0[0], 3); - out1[0] = amd_bytealign_S (in0[0], 0, 3); - out0[3] = 0; - out0[2] = 0; - out0[1] = 0; - out0[0] = 0; - break; - case 18: out1[3] = amd_bytealign_S (in0[3], in0[2], 2); - out1[2] = amd_bytealign_S (in0[2], in0[1], 2); - out1[1] = amd_bytealign_S (in0[1], in0[0], 2); - out1[0] = amd_bytealign_S (in0[0], 0, 2); - out0[3] = 0; - out0[2] = 0; - out0[1] = 0; - out0[0] = 0; - break; - case 19: out1[3] = amd_bytealign_S (in0[3], in0[2], 1); - out1[2] = amd_bytealign_S (in0[2], in0[1], 1); - out1[1] = amd_bytealign_S (in0[1], in0[0], 1); - out1[0] = amd_bytealign_S (in0[0], 0, 1); - out0[3] = 0; - out0[2] = 0; - out0[1] = 0; - out0[0] = 0; - break; - case 20: out1[3] = in0[2]; - out1[2] = in0[1]; - out1[1] = in0[0]; - out1[0] = 0; - out0[3] = 0; - out0[2] = 0; - out0[1] = 0; - out0[0] = 0; - break; - case 21: out1[3] = amd_bytealign_S (in0[2], in0[1], 3); - out1[2] = amd_bytealign_S (in0[1], in0[0], 3); - out1[1] = amd_bytealign_S (in0[0], 0, 3); - out1[0] = 0; - out0[3] = 0; - out0[2] = 0; - out0[1] = 0; - out0[0] = 0; - break; - case 22: out1[3] = amd_bytealign_S (in0[2], in0[1], 2); - out1[2] = amd_bytealign_S (in0[1], in0[0], 2); - out1[1] = amd_bytealign_S (in0[0], 0, 2); - out1[0] = 0; - out0[3] = 0; - out0[2] = 0; - out0[1] = 0; - out0[0] = 0; - break; - case 23: out1[3] = amd_bytealign_S (in0[2], in0[1], 1); - out1[2] = amd_bytealign_S (in0[1], in0[0], 1); - out1[1] = amd_bytealign_S (in0[0], 0, 1); - out1[0] = 0; - out0[3] = 0; - out0[2] = 0; - out0[1] = 0; - out0[0] = 0; - break; - case 24: out1[3] = in0[1]; - out1[2] = in0[0]; - out1[1] = 0; - out1[0] = 0; - out0[3] = 0; - out0[2] = 0; - out0[1] = 0; - out0[0] = 0; - break; - case 25: out1[3] = amd_bytealign_S (in0[1], in0[0], 3); - out1[2] = amd_bytealign_S (in0[0], 0, 3); - out1[1] = 0; - out1[0] = 0; - out0[3] = 0; - out0[2] = 0; - out0[1] = 0; - out0[0] = 0; - break; - case 26: out1[3] = amd_bytealign_S (in0[1], in0[0], 2); - out1[2] = amd_bytealign_S (in0[0], 0, 2); - out1[1] = 0; - out1[0] = 0; - out0[3] = 0; - out0[2] = 0; - out0[1] = 0; - out0[0] = 0; - break; - case 27: out1[3] = amd_bytealign_S (in0[1], in0[0], 1); - out1[2] = amd_bytealign_S (in0[0], 0, 1); - out1[1] = 0; - out1[0] = 0; - out0[3] = 0; - out0[2] = 0; - out0[1] = 0; - out0[0] = 0; - break; - case 28: out1[3] = in0[0]; - out1[2] = 0; - out1[1] = 0; - out1[0] = 0; - out0[3] = 0; - out0[2] = 0; - out0[1] = 0; - out0[0] = 0; - break; - case 29: out1[3] = amd_bytealign_S (in0[0], 0, 3); - out1[2] = 0; - out1[1] = 0; - out1[0] = 0; - out0[3] = 0; - out0[2] = 0; - out0[1] = 0; - out0[0] = 0; - break; - case 30: out1[3] = amd_bytealign_S (in0[0], 0, 2); - out1[2] = 0; - out1[1] = 0; - out1[0] = 0; - out0[3] = 0; - out0[2] = 0; - out0[1] = 0; - out0[0] = 0; - break; - case 31: out1[3] = amd_bytealign_S (in0[0], 0, 1); - out1[2] = 0; - out1[1] = 0; - out1[0] = 0; - out0[3] = 0; - out0[2] = 0; - out0[1] = 0; - out0[0] = 0; - break; - } -} - -static void append_block1 (const u32 offset, u32 buf0[4], u32 buf1[4], const u32 src_r0) -{ - // this version works with 1 byte append only - - const u32 value = src_r0 & 0xff; - - const u32 shift = (offset & 3) * 8; - - const u32 tmp = value << shift; - - buf0[0] |= (offset < 4) ? tmp : 0; - buf0[1] |= ((offset >= 4) && (offset < 8)) ? tmp : 0; - buf0[2] |= ((offset >= 8) && (offset < 12)) ? tmp : 0; - buf0[3] |= ((offset >= 12) && (offset < 16)) ? tmp : 0; - buf1[0] |= ((offset >= 16) && (offset < 20)) ? tmp : 0; - buf1[1] |= ((offset >= 20) && (offset < 24)) ? tmp : 0; - buf1[2] |= ((offset >= 24) && (offset < 28)) ? tmp : 0; - buf1[3] |= (offset >= 28) ? tmp : 0; -} - -static void append_block8 (const u32 offset, u32 buf0[4], u32 buf1[4], const u32 src_l0[4], const u32 src_l1[4], const u32 src_r0[4], const u32 src_r1[4]) -{ - u32 s0 = 0; - u32 s1 = 0; - u32 s2 = 0; - u32 s3 = 0; - u32 s4 = 0; - u32 s5 = 0; - u32 s6 = 0; - u32 s7 = 0; - - const u32 src_r00 = swap32_S (src_r0[0]); - const u32 src_r01 = swap32_S (src_r0[1]); - const u32 src_r02 = swap32_S (src_r0[2]); - const u32 src_r03 = swap32_S (src_r0[3]); - const u32 src_r10 = swap32_S (src_r1[0]); - const u32 src_r11 = swap32_S (src_r1[1]); - const u32 src_r12 = swap32_S (src_r1[2]); - const u32 src_r13 = swap32_S (src_r1[3]); - - switch (offset / 4) - { - case 0: - s7 = amd_bytealign_S (src_r12, src_r13, offset); - s6 = amd_bytealign_S (src_r11, src_r12, offset); - s5 = amd_bytealign_S (src_r10, src_r11, offset); - s4 = amd_bytealign_S (src_r03, src_r10, offset); - s3 = amd_bytealign_S (src_r02, src_r03, offset); - s2 = amd_bytealign_S (src_r01, src_r02, offset); - s1 = amd_bytealign_S (src_r00, src_r01, offset); - s0 = amd_bytealign_S ( 0, src_r00, offset); - break; - - case 1: - s7 = amd_bytealign_S (src_r11, src_r12, offset); - s6 = amd_bytealign_S (src_r10, src_r11, offset); - s5 = amd_bytealign_S (src_r03, src_r10, offset); - s4 = amd_bytealign_S (src_r02, src_r03, offset); - s3 = amd_bytealign_S (src_r01, src_r02, offset); - s2 = amd_bytealign_S (src_r00, src_r01, offset); - s1 = amd_bytealign_S ( 0, src_r00, offset); - s0 = 0; - break; - - case 2: - s7 = amd_bytealign_S (src_r10, src_r11, offset); - s6 = amd_bytealign_S (src_r03, src_r10, offset); - s5 = amd_bytealign_S (src_r02, src_r03, offset); - s4 = amd_bytealign_S (src_r01, src_r02, offset); - s3 = amd_bytealign_S (src_r00, src_r01, offset); - s2 = amd_bytealign_S ( 0, src_r00, offset); - s1 = 0; - s0 = 0; - break; - - case 3: - s7 = amd_bytealign_S (src_r03, src_r10, offset); - s6 = amd_bytealign_S (src_r02, src_r03, offset); - s5 = amd_bytealign_S (src_r01, src_r02, offset); - s4 = amd_bytealign_S (src_r00, src_r01, offset); - s3 = amd_bytealign_S ( 0, src_r00, offset); - s2 = 0; - s1 = 0; - s0 = 0; - - break; - - case 4: - s7 = amd_bytealign_S (src_r02, src_r03, offset); - s6 = amd_bytealign_S (src_r01, src_r02, offset); - s5 = amd_bytealign_S (src_r00, src_r01, offset); - s4 = amd_bytealign_S ( 0, src_r00, offset); - s3 = 0; - s2 = 0; - s1 = 0; - s0 = 0; - break; - - case 5: - s7 = amd_bytealign_S (src_r01, src_r02, offset); - s6 = amd_bytealign_S (src_r00, src_r01, offset); - s5 = amd_bytealign_S ( 0, src_r00, offset); - s4 = 0; - s3 = 0; - s2 = 0; - s1 = 0; - s0 = 0; - break; - - case 6: - s7 = amd_bytealign_S (src_r00, src_r01, offset); - s6 = amd_bytealign_S ( 0, src_r00, offset); - s5 = 0; - s4 = 0; - s3 = 0; - s2 = 0; - s1 = 0; - s0 = 0; - break; - - case 7: - s7 = amd_bytealign_S ( 0, src_r00, offset); - s6 = 0; - s5 = 0; - s4 = 0; - s3 = 0; - s2 = 0; - s1 = 0; - s0 = 0; - break; - } - - s0 = swap32_S (s0); - s1 = swap32_S (s1); - s2 = swap32_S (s2); - s3 = swap32_S (s3); - s4 = swap32_S (s4); - s5 = swap32_S (s5); - s6 = swap32_S (s6); - s7 = swap32_S (s7); - - buf0[0] = src_l0[0] | s0; - buf0[1] = src_l0[1] | s1; - buf0[2] = src_l0[2] | s2; - buf0[3] = src_l0[3] | s3; - buf1[0] = src_l1[0] | s4; - buf1[1] = src_l1[1] | s5; - buf1[2] = src_l1[2] | s6; - buf1[3] = src_l1[3] | s7; -} - -static void reverse_block (u32 in0[4], u32 in1[4], u32 out0[4], u32 out1[4], const u32 len) -{ - rshift_block_N (in0, in1, out0, out1, 32 - len); - - u32 tib40[4]; - u32 tib41[4]; - - tib40[0] = out1[3]; - tib40[1] = out1[2]; - tib40[2] = out1[1]; - tib40[3] = out1[0]; - tib41[0] = out0[3]; - tib41[1] = out0[2]; - tib41[2] = out0[1]; - tib41[3] = out0[0]; - - out0[0] = swap32_S (tib40[0]); - out0[1] = swap32_S (tib40[1]); - out0[2] = swap32_S (tib40[2]); - out0[3] = swap32_S (tib40[3]); - out1[0] = swap32_S (tib41[0]); - out1[1] = swap32_S (tib41[1]); - out1[2] = swap32_S (tib41[2]); - out1[3] = swap32_S (tib41[3]); -} - -static u32 rule_op_mangle_lrest (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - buf0[0] |= (generate_cmask (buf0[0])); - buf0[1] |= (generate_cmask (buf0[1])); - buf0[2] |= (generate_cmask (buf0[2])); - buf0[3] |= (generate_cmask (buf0[3])); - buf1[0] |= (generate_cmask (buf1[0])); - buf1[1] |= (generate_cmask (buf1[1])); - buf1[2] |= (generate_cmask (buf1[2])); - buf1[3] |= (generate_cmask (buf1[3])); - - return in_len; -} - -static u32 rule_op_mangle_urest (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - buf0[0] &= ~(generate_cmask (buf0[0])); - buf0[1] &= ~(generate_cmask (buf0[1])); - buf0[2] &= ~(generate_cmask (buf0[2])); - buf0[3] &= ~(generate_cmask (buf0[3])); - buf1[0] &= ~(generate_cmask (buf1[0])); - buf1[1] &= ~(generate_cmask (buf1[1])); - buf1[2] &= ~(generate_cmask (buf1[2])); - buf1[3] &= ~(generate_cmask (buf1[3])); - - return in_len; -} - -static u32 rule_op_mangle_lrest_ufirst (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - rule_op_mangle_lrest (p0, p1, buf0, buf1, in_len); - - buf0[0] &= ~(0x00000020 & generate_cmask (buf0[0])); - - return in_len; -} - -static u32 rule_op_mangle_urest_lfirst (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - rule_op_mangle_urest (p0, p1, buf0, buf1, in_len); - - buf0[0] |= (0x00000020 & generate_cmask (buf0[0])); - - return in_len; -} - -static u32 rule_op_mangle_trest (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - buf0[0] ^= (generate_cmask (buf0[0])); - buf0[1] ^= (generate_cmask (buf0[1])); - buf0[2] ^= (generate_cmask (buf0[2])); - buf0[3] ^= (generate_cmask (buf0[3])); - buf1[0] ^= (generate_cmask (buf1[0])); - buf1[1] ^= (generate_cmask (buf1[1])); - buf1[2] ^= (generate_cmask (buf1[2])); - buf1[3] ^= (generate_cmask (buf1[3])); - - return in_len; -} - -static u32 rule_op_mangle_toggle_at (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - if (p0 >= in_len) return (in_len); - - const u32 tmp = 0x20u << ((p0 & 3) * 8); - - switch (p0 / 4) - { - case 0: buf0[0] ^= (tmp & generate_cmask (buf0[0])); break; - case 1: buf0[1] ^= (tmp & generate_cmask (buf0[1])); break; - case 2: buf0[2] ^= (tmp & generate_cmask (buf0[2])); break; - case 3: buf0[3] ^= (tmp & generate_cmask (buf0[3])); break; - case 4: buf1[0] ^= (tmp & generate_cmask (buf1[0])); break; - case 5: buf1[1] ^= (tmp & generate_cmask (buf1[1])); break; - case 6: buf1[2] ^= (tmp & generate_cmask (buf1[2])); break; - case 7: buf1[3] ^= (tmp & generate_cmask (buf1[3])); break; - } - - return in_len; -} - -static u32 rule_op_mangle_reverse (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - reverse_block (buf0, buf1, buf0, buf1, in_len); - - return in_len; -} - -static u32 rule_op_mangle_dupeword (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - if ((in_len + in_len) >= 32) return (in_len); - - u32 out_len = in_len; - - append_block8 (out_len, buf0, buf1, buf0, buf1, buf0, buf1); - - out_len += in_len; - - return out_len; -} - -static u32 rule_op_mangle_dupeword_times (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - if (((in_len * p0) + in_len) >= 32) return (in_len); - - u32 out_len = in_len; - - u32 tib40[4]; - u32 tib41[4]; - - tib40[0] = buf0[0]; - tib40[1] = buf0[1]; - tib40[2] = buf0[2]; - tib40[3] = buf0[3]; - tib41[0] = buf1[0]; - tib41[1] = buf1[1]; - tib41[2] = buf1[2]; - tib41[3] = buf1[3]; - - for (u32 i = 0; i < p0; i++) - { - append_block8 (out_len, buf0, buf1, buf0, buf1, tib40, tib41); - - out_len += in_len; - } - - return out_len; -} - -static u32 rule_op_mangle_reflect (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - if ((in_len + in_len) >= 32) return (in_len); - - u32 out_len = in_len; - - u32 tib40[4] = { 0 }; - u32 tib41[4] = { 0 }; - - reverse_block (buf0, buf1, tib40, tib41, out_len); - - append_block8 (out_len, buf0, buf1, buf0, buf1, tib40, tib41); - - out_len += in_len; - - return out_len; -} - -static u32 rule_op_mangle_append (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - if ((in_len + 1) >= 32) return (in_len); - - u32 out_len = in_len; - - append_block1 (out_len, buf0, buf1, p0); - - out_len++; - - return out_len; -} - -static u32 rule_op_mangle_prepend (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - if ((in_len + 1) >= 32) return (in_len); - - u32 out_len = in_len; - - rshift_block (buf0, buf1, buf0, buf1); - - buf0[0] = buf0[0] | p0; - - out_len++; - - return out_len; -} - -static u32 rule_op_mangle_rotate_left (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - if (in_len == 0) return (in_len); - - const u32 in_len1 = in_len - 1; - - const u32 sh = (in_len1 & 3) * 8; - - const u32 tmp = (buf0[0] & 0xff) << sh; - - lshift_block (buf0, buf1, buf0, buf1); - - buf0[0] |= (in_len1 < 4) ? tmp : 0; - buf0[1] |= ((in_len1 >= 4) && (in_len1 < 8)) ? tmp : 0; - buf0[2] |= ((in_len1 >= 8) && (in_len1 < 12)) ? tmp : 0; - buf0[3] |= ((in_len1 >= 12) && (in_len1 < 16)) ? tmp : 0; - buf1[0] |= ((in_len1 >= 16) && (in_len1 < 20)) ? tmp : 0; - buf1[1] |= ((in_len1 >= 20) && (in_len1 < 24)) ? tmp : 0; - buf1[2] |= ((in_len1 >= 24) && (in_len1 < 28)) ? tmp : 0; - buf1[3] |= (in_len1 >= 28) ? tmp : 0; - - return in_len; -} - -static u32 rule_op_mangle_rotate_right (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - if (in_len == 0) return (in_len); - - const u32 in_len1 = in_len - 1; - - const u32 sh = (in_len1 & 3) * 8; - - u32 tmp = 0; - - tmp |= (in_len1 < 4) ? buf0[0] : 0; - tmp |= ((in_len1 >= 4) && (in_len1 < 8)) ? buf0[1] : 0; - tmp |= ((in_len1 >= 8) && (in_len1 < 12)) ? buf0[2] : 0; - tmp |= ((in_len1 >= 12) && (in_len1 < 16)) ? buf0[3] : 0; - tmp |= ((in_len1 >= 16) && (in_len1 < 20)) ? buf1[0] : 0; - tmp |= ((in_len1 >= 20) && (in_len1 < 24)) ? buf1[1] : 0; - tmp |= ((in_len1 >= 24) && (in_len1 < 28)) ? buf1[2] : 0; - tmp |= (in_len1 >= 28) ? buf1[3] : 0; - - tmp = (tmp >> sh) & 0xff; - - rshift_block (buf0, buf1, buf0, buf1); - - buf0[0] |= tmp; - - truncate_right (buf0, buf1, in_len); - - return in_len; -} - -static u32 rule_op_mangle_delete_first (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - if (in_len == 0) return (in_len); - - const u32 in_len1 = in_len - 1; - - lshift_block (buf0, buf1, buf0, buf1); - - return in_len1; -} - -static u32 rule_op_mangle_delete_last (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - if (in_len == 0) return (in_len); - - const u32 in_len1 = in_len - 1; - - const u32 mask = (1 << ((in_len1 & 3) * 8)) - 1; - - buf0[0] &= (in_len1 < 4) ? mask : 0xffffffff; - buf0[1] &= ((in_len1 >= 4) && (in_len1 < 8)) ? mask : 0xffffffff; - buf0[2] &= ((in_len1 >= 8) && (in_len1 < 12)) ? mask : 0xffffffff; - buf0[3] &= ((in_len1 >= 12) && (in_len1 < 16)) ? mask : 0xffffffff; - buf1[0] &= ((in_len1 >= 16) && (in_len1 < 20)) ? mask : 0xffffffff; - buf1[1] &= ((in_len1 >= 20) && (in_len1 < 24)) ? mask : 0xffffffff; - buf1[2] &= ((in_len1 >= 24) && (in_len1 < 28)) ? mask : 0xffffffff; - buf1[3] &= (in_len1 >= 28) ? mask : 0xffffffff; - - return in_len1; -} - -static u32 rule_op_mangle_delete_at (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - if (p0 >= in_len) return (in_len); - - u32 out_len = in_len; - - u32 tib40[4]; - u32 tib41[4]; - - lshift_block (buf0, buf1, tib40, tib41); - - const u32 ml = (1 << ((p0 & 3) * 8)) - 1; - const u32 mr = ~ml; - - switch (p0 / 4) - { - case 0: buf0[0] = (buf0[0] & ml) - | (tib40[0] & mr); - buf0[1] = tib40[1]; - buf0[2] = tib40[2]; - buf0[3] = tib40[3]; - buf1[0] = tib41[0]; - buf1[1] = tib41[1]; - buf1[2] = tib41[2]; - buf1[3] = tib41[3]; - break; - case 1: buf0[1] = (buf0[1] & ml) - | (tib40[1] & mr); - buf0[2] = tib40[2]; - buf0[3] = tib40[3]; - buf1[0] = tib41[0]; - buf1[1] = tib41[1]; - buf1[2] = tib41[2]; - buf1[3] = tib41[3]; - break; - case 2: buf0[2] = (buf0[2] & ml) - | (tib40[2] & mr); - buf0[3] = tib40[3]; - buf1[0] = tib41[0]; - buf1[1] = tib41[1]; - buf1[2] = tib41[2]; - buf1[3] = tib41[3]; - break; - case 3: buf0[3] = (buf0[3] & ml) - | (tib40[3] & mr); - buf1[0] = tib41[0]; - buf1[1] = tib41[1]; - buf1[2] = tib41[2]; - buf1[3] = tib41[3]; - break; - case 4: buf1[0] = (buf1[0] & ml) - | (tib41[0] & mr); - buf1[1] = tib41[1]; - buf1[2] = tib41[2]; - buf1[3] = tib41[3]; - break; - case 5: buf1[1] = (buf1[1] & ml) - | (tib41[1] & mr); - buf1[2] = tib41[2]; - buf1[3] = tib41[3]; - break; - case 6: buf1[2] = (buf1[2] & ml) - | (tib41[2] & mr); - buf1[3] = tib41[3]; - break; - case 7: buf1[3] = (buf1[3] & ml) - | (tib41[3] & mr); - break; - } - - out_len--; - - return out_len; -} - -static u32 rule_op_mangle_extract (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - if (p0 >= in_len) return (in_len); - - if ((p0 + p1) > in_len) return (in_len); - - u32 out_len = p1; - - lshift_block_N (buf0, buf1, buf0, buf1, p0); - - truncate_right (buf0, buf1, out_len); - - return out_len; -} - -static u32 rule_op_mangle_omit (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - if (p0 >= in_len) return (in_len); - - if ((p0 + p1) > in_len) return (in_len); - - u32 out_len = in_len; - - u32 tib40[4]; - u32 tib41[4]; - - tib40[0] = 0; - tib40[1] = 0; - tib40[2] = 0; - tib40[3] = 0; - tib41[0] = 0; - tib41[1] = 0; - tib41[2] = 0; - tib41[3] = 0; - - lshift_block_N (buf0, buf1, tib40, tib41, p1); - - const u32 ml = (1 << ((p0 & 3) * 8)) - 1; - const u32 mr = ~ml; - - switch (p0 / 4) - { - case 0: buf0[0] = (buf0[0] & ml) - | (tib40[0] & mr); - buf0[1] = tib40[1]; - buf0[2] = tib40[2]; - buf0[3] = tib40[3]; - buf1[0] = tib41[0]; - buf1[1] = tib41[1]; - buf1[2] = tib41[2]; - buf1[3] = tib41[3]; - break; - case 1: buf0[1] = (buf0[1] & ml) - | (tib40[1] & mr); - buf0[2] = tib40[2]; - buf0[3] = tib40[3]; - buf1[0] = tib41[0]; - buf1[1] = tib41[1]; - buf1[2] = tib41[2]; - buf1[3] = tib41[3]; - break; - case 2: buf0[2] = (buf0[2] & ml) - | (tib40[2] & mr); - buf0[3] = tib40[3]; - buf1[0] = tib41[0]; - buf1[1] = tib41[1]; - buf1[2] = tib41[2]; - buf1[3] = tib41[3]; - break; - case 3: buf0[3] = (buf0[3] & ml) - | (tib40[3] & mr); - buf1[0] = tib41[0]; - buf1[1] = tib41[1]; - buf1[2] = tib41[2]; - buf1[3] = tib41[3]; - break; - case 4: buf1[0] = (buf1[0] & ml) - | (tib41[0] & mr); - buf1[1] = tib41[1]; - buf1[2] = tib41[2]; - buf1[3] = tib41[3]; - break; - case 5: buf1[1] = (buf1[1] & ml) - | (tib41[1] & mr); - buf1[2] = tib41[2]; - buf1[3] = tib41[3]; - break; - case 6: buf1[2] = (buf1[2] & ml) - | (tib41[2] & mr); - buf1[3] = tib41[3]; - break; - case 7: buf1[3] = (buf1[3] & ml) - | (tib41[3] & mr); - break; - } - - out_len -= p1; - - return out_len; -} - -static u32 rule_op_mangle_insert (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - if (p0 > in_len) return (in_len); - - if ((in_len + 1) >= 32) return (in_len); - - u32 out_len = in_len; - - u32 tib40[4]; - u32 tib41[4]; - - rshift_block (buf0, buf1, tib40, tib41); - - const u32 p1n = p1 << ((p0 & 3) * 8); - - const u32 ml = (1 << ((p0 & 3) * 8)) - 1; - - const u32 mr = 0xffffff00 << ((p0 & 3) * 8); - - switch (p0 / 4) - { - case 0: buf0[0] = (buf0[0] & ml) | p1n | (tib40[0] & mr); - buf0[1] = tib40[1]; - buf0[2] = tib40[2]; - buf0[3] = tib40[3]; - buf1[0] = tib41[0]; - buf1[1] = tib41[1]; - buf1[2] = tib41[2]; - buf1[3] = tib41[3]; - break; - case 1: buf0[1] = (buf0[1] & ml) | p1n | (tib40[1] & mr); - buf0[2] = tib40[2]; - buf0[3] = tib40[3]; - buf1[0] = tib41[0]; - buf1[1] = tib41[1]; - buf1[2] = tib41[2]; - buf1[3] = tib41[3]; - break; - case 2: buf0[2] = (buf0[2] & ml) | p1n | (tib40[2] & mr); - buf0[3] = tib40[3]; - buf1[0] = tib41[0]; - buf1[1] = tib41[1]; - buf1[2] = tib41[2]; - buf1[3] = tib41[3]; - break; - case 3: buf0[3] = (buf0[3] & ml) | p1n | (tib40[3] & mr); - buf1[0] = tib41[0]; - buf1[1] = tib41[1]; - buf1[2] = tib41[2]; - buf1[3] = tib41[3]; - break; - case 4: buf1[0] = (buf1[0] & ml) | p1n | (tib41[0] & mr); - buf1[1] = tib41[1]; - buf1[2] = tib41[2]; - buf1[3] = tib41[3]; - break; - case 5: buf1[1] = (buf1[1] & ml) | p1n | (tib41[1] & mr); - buf1[2] = tib41[2]; - buf1[3] = tib41[3]; - break; - case 6: buf1[2] = (buf1[2] & ml) | p1n | (tib41[2] & mr); - buf1[3] = tib41[3]; - break; - case 7: buf1[3] = (buf1[3] & ml) | p1n | (tib41[3] & mr); - break; - } - - out_len++; - - return out_len; -} - -static u32 rule_op_mangle_overstrike (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - if (p0 >= in_len) return (in_len); - - const u32 p1n = p1 << ((p0 & 3) * 8); - - const u32 m = ~(0xffu << ((p0 & 3) * 8)); - - switch (p0 / 4) - { - case 0: buf0[0] = (buf0[0] & m) | p1n; break; - case 1: buf0[1] = (buf0[1] & m) | p1n; break; - case 2: buf0[2] = (buf0[2] & m) | p1n; break; - case 3: buf0[3] = (buf0[3] & m) | p1n; break; - case 4: buf1[0] = (buf1[0] & m) | p1n; break; - case 5: buf1[1] = (buf1[1] & m) | p1n; break; - case 6: buf1[2] = (buf1[2] & m) | p1n; break; - case 7: buf1[3] = (buf1[3] & m) | p1n; break; - } - - return in_len; -} - -static u32 rule_op_mangle_truncate_at (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - if (p0 >= in_len) return (in_len); - - truncate_right (buf0, buf1, p0); - - return p0; -} - -static u32 rule_op_mangle_replace (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - for (u32 i = 0; i < in_len; i++) - { - switch (i) - { - case 0: if (((buf0[0] >> 0) & 0xFF) == p0) buf0[0] = (buf0[0] & 0xFFFFFF00) | p1 << 0; break; - case 1: if (((buf0[0] >> 8) & 0xFF) == p0) buf0[0] = (buf0[0] & 0xFFFF00FF) | p1 << 8; break; - case 2: if (((buf0[0] >> 16) & 0xFF) == p0) buf0[0] = (buf0[0] & 0xFF00FFFF) | p1 << 16; break; - case 3: if (((buf0[0] >> 24) & 0xFF) == p0) buf0[0] = (buf0[0] & 0x00FFFFFF) | p1 << 24; break; - case 4: if (((buf0[1] >> 0) & 0xFF) == p0) buf0[1] = (buf0[1] & 0xFFFFFF00) | p1 << 0; break; - case 5: if (((buf0[1] >> 8) & 0xFF) == p0) buf0[1] = (buf0[1] & 0xFFFF00FF) | p1 << 8; break; - case 6: if (((buf0[1] >> 16) & 0xFF) == p0) buf0[1] = (buf0[1] & 0xFF00FFFF) | p1 << 16; break; - case 7: if (((buf0[1] >> 24) & 0xFF) == p0) buf0[1] = (buf0[1] & 0x00FFFFFF) | p1 << 24; break; - case 8: if (((buf0[2] >> 0) & 0xFF) == p0) buf0[2] = (buf0[2] & 0xFFFFFF00) | p1 << 0; break; - case 9: if (((buf0[2] >> 8) & 0xFF) == p0) buf0[2] = (buf0[2] & 0xFFFF00FF) | p1 << 8; break; - case 10: if (((buf0[2] >> 16) & 0xFF) == p0) buf0[2] = (buf0[2] & 0xFF00FFFF) | p1 << 16; break; - case 11: if (((buf0[2] >> 24) & 0xFF) == p0) buf0[2] = (buf0[2] & 0x00FFFFFF) | p1 << 24; break; - case 12: if (((buf0[3] >> 0) & 0xFF) == p0) buf0[3] = (buf0[3] & 0xFFFFFF00) | p1 << 0; break; - case 13: if (((buf0[3] >> 8) & 0xFF) == p0) buf0[3] = (buf0[3] & 0xFFFF00FF) | p1 << 8; break; - case 14: if (((buf0[3] >> 16) & 0xFF) == p0) buf0[3] = (buf0[3] & 0xFF00FFFF) | p1 << 16; break; - case 15: if (((buf0[3] >> 24) & 0xFF) == p0) buf0[3] = (buf0[3] & 0x00FFFFFF) | p1 << 24; break; - case 16: if (((buf1[0] >> 0) & 0xFF) == p0) buf1[0] = (buf1[0] & 0xFFFFFF00) | p1 << 0; break; - case 17: if (((buf1[0] >> 8) & 0xFF) == p0) buf1[0] = (buf1[0] & 0xFFFF00FF) | p1 << 8; break; - case 18: if (((buf1[0] >> 16) & 0xFF) == p0) buf1[0] = (buf1[0] & 0xFF00FFFF) | p1 << 16; break; - case 19: if (((buf1[0] >> 24) & 0xFF) == p0) buf1[0] = (buf1[0] & 0x00FFFFFF) | p1 << 24; break; - case 20: if (((buf1[1] >> 0) & 0xFF) == p0) buf1[1] = (buf1[1] & 0xFFFFFF00) | p1 << 0; break; - case 21: if (((buf1[1] >> 8) & 0xFF) == p0) buf1[1] = (buf1[1] & 0xFFFF00FF) | p1 << 8; break; - case 22: if (((buf1[1] >> 16) & 0xFF) == p0) buf1[1] = (buf1[1] & 0xFF00FFFF) | p1 << 16; break; - case 23: if (((buf1[1] >> 24) & 0xFF) == p0) buf1[1] = (buf1[1] & 0x00FFFFFF) | p1 << 24; break; - case 24: if (((buf1[2] >> 0) & 0xFF) == p0) buf1[2] = (buf1[2] & 0xFFFFFF00) | p1 << 0; break; - case 25: if (((buf1[2] >> 8) & 0xFF) == p0) buf1[2] = (buf1[2] & 0xFFFF00FF) | p1 << 8; break; - case 26: if (((buf1[2] >> 16) & 0xFF) == p0) buf1[2] = (buf1[2] & 0xFF00FFFF) | p1 << 16; break; - case 27: if (((buf1[2] >> 24) & 0xFF) == p0) buf1[2] = (buf1[2] & 0x00FFFFFF) | p1 << 24; break; - case 28: if (((buf1[3] >> 0) & 0xFF) == p0) buf1[3] = (buf1[3] & 0xFFFFFF00) | p1 << 0; break; - case 29: if (((buf1[3] >> 8) & 0xFF) == p0) buf1[3] = (buf1[3] & 0xFFFF00FF) | p1 << 8; break; - case 30: if (((buf1[3] >> 16) & 0xFF) == p0) buf1[3] = (buf1[3] & 0xFF00FFFF) | p1 << 16; break; - case 31: if (((buf1[3] >> 24) & 0xFF) == p0) buf1[3] = (buf1[3] & 0x00FFFFFF) | p1 << 24; break; - } - } - - return in_len; -} - -static u32 rule_op_mangle_purgechar (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - u32 out_len = 0; - - u32 buf_in[8]; - - buf_in[0] = buf0[0]; - buf_in[1] = buf0[1]; - buf_in[2] = buf0[2]; - buf_in[3] = buf0[3]; - buf_in[4] = buf1[0]; - buf_in[5] = buf1[1]; - buf_in[6] = buf1[2]; - buf_in[7] = buf1[3]; - - u32 buf_out[8] = { 0 }; - - u8 *in = (u8 *) buf_in; - u8 *out = (u8 *) buf_out; - - for (u32 pos = 0; pos < in_len; pos++) - { - if (in[pos] == (u8) p0) continue; - - out[out_len] = in[pos]; - - out_len++; - } - - buf0[0] = buf_out[0]; - buf0[1] = buf_out[1]; - buf0[2] = buf_out[2]; - buf0[3] = buf_out[3]; - buf1[0] = buf_out[4]; - buf1[1] = buf_out[5]; - buf1[2] = buf_out[6]; - buf1[3] = buf_out[7]; - - return out_len; -} - -static u32 rule_op_mangle_dupechar_first (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - if ( in_len == 0) return (in_len); - if ((in_len + p0) >= 32) return (in_len); - - u32 out_len = in_len; - - const u32 tmp = buf0[0] & 0xFF; - - rshift_block_N (buf0, buf1, buf0, buf1, p0); - - switch (p0) - { - case 1: buf0[0] |= tmp << 0; - break; - case 2: buf0[0] |= tmp << 0 | tmp << 8; - break; - case 3: buf0[0] |= tmp << 0 | tmp << 8 | tmp << 16; - break; - case 4: buf0[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - break; - case 5: buf0[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[1] |= tmp << 0; - break; - case 6: buf0[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[1] |= tmp << 0 | tmp << 8; - break; - case 7: buf0[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[1] |= tmp << 0 | tmp << 8 | tmp << 16; - break; - case 8: buf0[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[1] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - break; - case 9: buf0[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[1] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[2] |= tmp << 0; - break; - case 10: buf0[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[1] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[2] |= tmp << 0 | tmp << 8; - break; - case 11: buf0[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[1] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[2] |= tmp << 0 | tmp << 8 | tmp << 16; - break; - case 12: buf0[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[1] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[2] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - break; - case 13: buf0[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[1] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[2] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[3] |= tmp << 0; - break; - case 14: buf0[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[1] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[2] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[3] |= tmp << 0 | tmp << 8; - break; - case 15: buf0[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[1] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[2] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[3] |= tmp << 0 | tmp << 8 | tmp << 16; - break; - case 16: buf0[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[1] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[2] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[3] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - break; - case 17: buf0[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[1] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[2] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[3] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[0] |= tmp << 0; - break; - case 18: buf0[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[1] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[2] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[3] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[0] |= tmp << 0 | tmp << 8; - break; - case 19: buf0[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[1] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[2] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[3] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[0] |= tmp << 0 | tmp << 8 | tmp << 16; - break; - case 20: buf0[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[1] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[2] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[3] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - break; - case 21: buf0[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[1] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[2] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[3] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[1] |= tmp << 0; - break; - case 22: buf0[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[1] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[2] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[3] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[1] |= tmp << 0 | tmp << 8; - break; - case 23: buf0[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[1] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[2] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[3] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[1] |= tmp << 0 | tmp << 8 | tmp << 16; - break; - case 24: buf0[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[1] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[2] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[3] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[1] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - break; - case 25: buf0[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[1] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[2] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[3] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[1] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[2] |= tmp << 0; - break; - case 26: buf0[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[1] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[2] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[3] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[1] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[2] |= tmp << 0 | tmp << 8; - break; - case 27: buf0[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[1] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[2] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[3] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[1] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[2] |= tmp << 0 | tmp << 8 | tmp << 16; - break; - case 28: buf0[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[1] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[2] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[3] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[1] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[2] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - break; - case 29: buf0[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[1] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[2] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[3] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[1] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[2] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[3] |= tmp << 0; - break; - case 30: buf0[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[1] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[2] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[3] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[1] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[2] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[3] |= tmp << 0 | tmp << 8; - break; - case 31: buf0[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[1] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[2] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf0[3] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[0] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[1] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[2] |= tmp << 0 | tmp << 8 | tmp << 16 | tmp << 24; - buf1[3] |= tmp << 0 | tmp << 8 | tmp << 16; - break; - } - - out_len += p0; - - return out_len; -} - -static u32 rule_op_mangle_dupechar_last (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - if ( in_len == 0) return (in_len); - if ((in_len + p0) >= 32) return (in_len); - - const u32 in_len1 = in_len - 1; - - const u32 sh = (in_len1 & 3) * 8; - - u32 tmp = 0; - - tmp |= (in_len1 < 4) ? buf0[0] : 0; - tmp |= ((in_len1 >= 4) && (in_len1 < 8)) ? buf0[1] : 0; - tmp |= ((in_len1 >= 8) && (in_len1 < 12)) ? buf0[2] : 0; - tmp |= ((in_len1 >= 12) && (in_len1 < 16)) ? buf0[3] : 0; - tmp |= ((in_len1 >= 16) && (in_len1 < 20)) ? buf1[0] : 0; - tmp |= ((in_len1 >= 20) && (in_len1 < 24)) ? buf1[1] : 0; - tmp |= ((in_len1 >= 24) && (in_len1 < 28)) ? buf1[2] : 0; - tmp |= (in_len1 >= 28) ? buf1[3] : 0; - - tmp = (tmp >> sh) & 0xff; - - u32 out_len = in_len; - - for (u32 i = 0; i < p0; i++) - { - append_block1 (out_len, buf0, buf1, tmp); - - out_len++; - } - - return out_len; -} - -static u32 rule_op_mangle_dupechar_all (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - if ( in_len == 0) return (in_len); - if ((in_len + in_len) >= 32) return (in_len); - - u32 out_len = in_len; - - u32 tib40[4]; - u32 tib41[4]; - - tib40[0] = ((buf0[0] & 0x000000FF) << 0) | ((buf0[0] & 0x0000FF00) << 8); - tib40[1] = ((buf0[0] & 0x00FF0000) >> 16) | ((buf0[0] & 0xFF000000) >> 8); - tib40[2] = ((buf0[1] & 0x000000FF) << 0) | ((buf0[1] & 0x0000FF00) << 8); - tib40[3] = ((buf0[1] & 0x00FF0000) >> 16) | ((buf0[1] & 0xFF000000) >> 8); - tib41[0] = ((buf0[2] & 0x000000FF) << 0) | ((buf0[2] & 0x0000FF00) << 8); - tib41[1] = ((buf0[2] & 0x00FF0000) >> 16) | ((buf0[2] & 0xFF000000) >> 8); - tib41[2] = ((buf0[3] & 0x000000FF) << 0) | ((buf0[3] & 0x0000FF00) << 8); - tib41[3] = ((buf0[3] & 0x00FF0000) >> 16) | ((buf0[3] & 0xFF000000) >> 8); - - buf0[0] = tib40[0] | (tib40[0] << 8); - buf0[1] = tib40[1] | (tib40[1] << 8); - buf0[2] = tib40[2] | (tib40[2] << 8); - buf0[3] = tib40[3] | (tib40[3] << 8); - buf1[0] = tib41[0] | (tib41[0] << 8); - buf1[1] = tib41[1] | (tib41[1] << 8); - buf1[2] = tib41[2] | (tib41[2] << 8); - buf1[3] = tib41[3] | (tib41[3] << 8); - - out_len = out_len + out_len; - - return out_len; -} - -static u32 rule_op_mangle_switch_first (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - if (in_len < 2) return (in_len); - - buf0[0] = (buf0[0] & 0xFFFF0000) | ((buf0[0] << 8) & 0x0000FF00) | ((buf0[0] >> 8) & 0x000000FF); - - return in_len; -} - -static u32 rule_op_mangle_switch_last (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - if (in_len < 2) return (in_len); - - switch (in_len) - { - case 2: buf0[0] = ((buf0[0] << 8) & 0x0000FF00) | ((buf0[0] >> 8) & 0x000000FF); - break; - case 3: buf0[0] = (buf0[0] & 0x000000FF) | ((buf0[0] << 8) & 0x00FF0000) | ((buf0[0] >> 8) & 0x0000FF00); - break; - case 4: buf0[0] = (buf0[0] & 0x0000FFFF) | ((buf0[0] << 8) & 0xFF000000) | ((buf0[0] >> 8) & 0x00FF0000); - break; - case 5: buf0[1] = (buf0[0] & 0xFF000000) | buf0[1]; - buf0[0] = (buf0[0] & 0x00FFFFFF) | (buf0[1] << 24); - buf0[1] = (buf0[1] >> 24); - break; - case 6: buf0[1] = ((buf0[1] << 8) & 0x0000FF00) | ((buf0[1] >> 8) & 0x000000FF); - break; - case 7: buf0[1] = (buf0[1] & 0x000000FF) | ((buf0[1] << 8) & 0x00FF0000) | ((buf0[1] >> 8) & 0x0000FF00); - break; - case 8: buf0[1] = (buf0[1] & 0x0000FFFF) | ((buf0[1] << 8) & 0xFF000000) | ((buf0[1] >> 8) & 0x00FF0000); - break; - case 9: buf0[2] = (buf0[1] & 0xFF000000) | buf0[2]; - buf0[1] = (buf0[1] & 0x00FFFFFF) | (buf0[2] << 24); - buf0[2] = (buf0[2] >> 24); - break; - case 10: buf0[2] = ((buf0[2] << 8) & 0x0000FF00) | ((buf0[2] >> 8) & 0x000000FF); - break; - case 11: buf0[2] = (buf0[2] & 0x000000FF) | ((buf0[2] << 8) & 0x00FF0000) | ((buf0[2] >> 8) & 0x0000FF00); - break; - case 12: buf0[2] = (buf0[2] & 0x0000FFFF) | ((buf0[2] << 8) & 0xFF000000) | ((buf0[2] >> 8) & 0x00FF0000); - break; - case 13: buf0[3] = (buf0[2] & 0xFF000000) | buf0[3]; - buf0[2] = (buf0[2] & 0x00FFFFFF) | (buf0[3] << 24); - buf0[3] = (buf0[3] >> 24); - break; - case 14: buf0[3] = ((buf0[3] << 8) & 0x0000FF00) | ((buf0[3] >> 8) & 0x000000FF); - break; - case 15: buf0[3] = (buf0[3] & 0x000000FF) | ((buf0[3] << 8) & 0x00FF0000) | ((buf0[3] >> 8) & 0x0000FF00); - break; - case 16: buf0[3] = (buf0[3] & 0x0000FFFF) | ((buf0[3] << 8) & 0xFF000000) | ((buf0[3] >> 8) & 0x00FF0000); - break; - case 17: buf1[0] = (buf0[3] & 0xFF000000) | buf1[0]; - buf0[3] = (buf0[3] & 0x00FFFFFF) | (buf1[0] << 24); - buf1[0] = (buf1[0] >> 24); - break; - case 18: buf1[0] = ((buf1[0] << 8) & 0x0000FF00) | ((buf1[0] >> 8) & 0x000000FF); - break; - case 19: buf1[0] = (buf1[0] & 0x000000FF) | ((buf1[0] << 8) & 0x00FF0000) | ((buf1[0] >> 8) & 0x0000FF00); - break; - case 20: buf1[0] = (buf1[0] & 0x0000FFFF) | ((buf1[0] << 8) & 0xFF000000) | ((buf1[0] >> 8) & 0x00FF0000); - break; - case 21: buf1[1] = (buf1[0] & 0xFF000000) | buf1[1]; - buf1[0] = (buf1[0] & 0x00FFFFFF) | (buf1[1] << 24); - buf1[1] = (buf1[1] >> 24); - break; - case 22: buf1[1] = ((buf1[1] << 8) & 0x0000FF00) | ((buf1[1] >> 8) & 0x000000FF); - break; - case 23: buf1[1] = (buf1[1] & 0x000000FF) | ((buf1[1] << 8) & 0x00FF0000) | ((buf1[1] >> 8) & 0x0000FF00); - break; - case 24: buf1[1] = (buf1[1] & 0x0000FFFF) | ((buf1[1] << 8) & 0xFF000000) | ((buf1[1] >> 8) & 0x00FF0000); - break; - case 25: buf1[2] = (buf1[1] & 0xFF000000) | buf1[2]; - buf1[1] = (buf1[1] & 0x00FFFFFF) | (buf1[2] << 24); - buf1[2] = (buf1[2] >> 24); - break; - case 26: buf1[2] = ((buf1[2] << 8) & 0x0000FF00) | ((buf1[2] >> 8) & 0x000000FF); - break; - case 27: buf1[2] = (buf1[2] & 0x000000FF) | ((buf1[2] << 8) & 0x00FF0000) | ((buf1[2] >> 8) & 0x0000FF00); - break; - case 28: buf1[2] = (buf1[2] & 0x0000FFFF) | ((buf1[2] << 8) & 0xFF000000) | ((buf1[2] >> 8) & 0x00FF0000); - break; - case 29: buf1[3] = (buf1[2] & 0xFF000000) | buf1[3]; - buf1[2] = (buf1[2] & 0x00FFFFFF) | (buf1[3] << 24); - buf1[3] = (buf1[3] >> 24); - break; - case 30: buf1[3] = ((buf1[3] << 8) & 0x0000FF00) | ((buf1[3] >> 8) & 0x000000FF); - break; - case 31: buf1[3] = (buf1[3] & 0x000000FF) | ((buf1[3] << 8) & 0x00FF0000) | ((buf1[3] >> 8) & 0x0000FF00); - break; - } - - return in_len; -} - -static u32 rule_op_mangle_switch_at (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - if (p0 >= in_len) return (in_len); - if (p1 >= in_len) return (in_len); - - u32 tmp0 = 0; - u32 tmp1 = 0; - - switch (p0) - { - case 0: tmp0 = (buf0[0] >> 0) & 0xFF; - break; - case 1: tmp0 = (buf0[0] >> 8) & 0xFF; - break; - case 2: tmp0 = (buf0[0] >> 16) & 0xFF; - break; - case 3: tmp0 = (buf0[0] >> 24) & 0xFF; - break; - case 4: tmp0 = (buf0[1] >> 0) & 0xFF; - break; - case 5: tmp0 = (buf0[1] >> 8) & 0xFF; - break; - case 6: tmp0 = (buf0[1] >> 16) & 0xFF; - break; - case 7: tmp0 = (buf0[1] >> 24) & 0xFF; - break; - case 8: tmp0 = (buf0[2] >> 0) & 0xFF; - break; - case 9: tmp0 = (buf0[2] >> 8) & 0xFF; - break; - case 10: tmp0 = (buf0[2] >> 16) & 0xFF; - break; - case 11: tmp0 = (buf0[2] >> 24) & 0xFF; - break; - case 12: tmp0 = (buf0[3] >> 0) & 0xFF; - break; - case 13: tmp0 = (buf0[3] >> 8) & 0xFF; - break; - case 14: tmp0 = (buf0[3] >> 16) & 0xFF; - break; - case 15: tmp0 = (buf0[3] >> 24) & 0xFF; - break; - case 16: tmp0 = (buf1[0] >> 0) & 0xFF; - break; - case 17: tmp0 = (buf1[0] >> 8) & 0xFF; - break; - case 18: tmp0 = (buf1[0] >> 16) & 0xFF; - break; - case 19: tmp0 = (buf1[0] >> 24) & 0xFF; - break; - case 20: tmp0 = (buf1[1] >> 0) & 0xFF; - break; - case 21: tmp0 = (buf1[1] >> 8) & 0xFF; - break; - case 22: tmp0 = (buf1[1] >> 16) & 0xFF; - break; - case 23: tmp0 = (buf1[1] >> 24) & 0xFF; - break; - case 24: tmp0 = (buf1[2] >> 0) & 0xFF; - break; - case 25: tmp0 = (buf1[2] >> 8) & 0xFF; - break; - case 26: tmp0 = (buf1[2] >> 16) & 0xFF; - break; - case 27: tmp0 = (buf1[2] >> 24) & 0xFF; - break; - case 28: tmp0 = (buf1[3] >> 0) & 0xFF; - break; - case 29: tmp0 = (buf1[3] >> 8) & 0xFF; - break; - case 30: tmp0 = (buf1[3] >> 16) & 0xFF; - break; - case 31: tmp0 = (buf1[3] >> 24) & 0xFF; - break; - } - - switch (p1) - { - case 0: tmp1 = (buf0[0] >> 0) & 0xff; - buf0[0] = (buf0[0] & 0xffffff00) | tmp0 << 0; - break; - case 1: tmp1 = (buf0[0] >> 8) & 0xff; - buf0[0] = (buf0[0] & 0xffff00ff) | tmp0 << 8; - break; - case 2: tmp1 = (buf0[0] >> 16) & 0xff; - buf0[0] = (buf0[0] & 0xff00ffff) | tmp0 << 16; - break; - case 3: tmp1 = (buf0[0] >> 24) & 0xff; - buf0[0] = (buf0[0] & 0x00ffffff) | tmp0 << 24; - break; - case 4: tmp1 = (buf0[1] >> 0) & 0xff; - buf0[1] = (buf0[1] & 0xffffff00) | tmp0 << 0; - break; - case 5: tmp1 = (buf0[1] >> 8) & 0xff; - buf0[1] = (buf0[1] & 0xffff00ff) | tmp0 << 8; - break; - case 6: tmp1 = (buf0[1] >> 16) & 0xff; - buf0[1] = (buf0[1] & 0xff00ffff) | tmp0 << 16; - break; - case 7: tmp1 = (buf0[1] >> 24) & 0xff; - buf0[1] = (buf0[1] & 0x00ffffff) | tmp0 << 24; - break; - case 8: tmp1 = (buf0[2] >> 0) & 0xff; - buf0[2] = (buf0[2] & 0xffffff00) | tmp0 << 0; - break; - case 9: tmp1 = (buf0[2] >> 8) & 0xff; - buf0[2] = (buf0[2] & 0xffff00ff) | tmp0 << 8; - break; - case 10: tmp1 = (buf0[2] >> 16) & 0xff; - buf0[2] = (buf0[2] & 0xff00ffff) | tmp0 << 16; - break; - case 11: tmp1 = (buf0[2] >> 24) & 0xff; - buf0[2] = (buf0[2] & 0x00ffffff) | tmp0 << 24; - break; - case 12: tmp1 = (buf0[3] >> 0) & 0xff; - buf0[3] = (buf0[3] & 0xffffff00) | tmp0 << 0; - break; - case 13: tmp1 = (buf0[3] >> 8) & 0xff; - buf0[3] = (buf0[3] & 0xffff00ff) | tmp0 << 8; - break; - case 14: tmp1 = (buf0[3] >> 16) & 0xff; - buf0[3] = (buf0[3] & 0xff00ffff) | tmp0 << 16; - break; - case 15: tmp1 = (buf0[3] >> 24) & 0xff; - buf0[3] = (buf0[3] & 0x00ffffff) | tmp0 << 24; - break; - case 16: tmp1 = (buf1[0] >> 0) & 0xff; - buf1[0] = (buf1[0] & 0xffffff00) | tmp0 << 0; - break; - case 17: tmp1 = (buf1[0] >> 8) & 0xff; - buf1[0] = (buf1[0] & 0xffff00ff) | tmp0 << 8; - break; - case 18: tmp1 = (buf1[0] >> 16) & 0xff; - buf1[0] = (buf1[0] & 0xff00ffff) | tmp0 << 16; - break; - case 19: tmp1 = (buf1[0] >> 24) & 0xff; - buf1[0] = (buf1[0] & 0x00ffffff) | tmp0 << 24; - break; - case 20: tmp1 = (buf1[1] >> 0) & 0xff; - buf1[1] = (buf1[1] & 0xffffff00) | tmp0 << 0; - break; - case 21: tmp1 = (buf1[1] >> 8) & 0xff; - buf1[1] = (buf1[1] & 0xffff00ff) | tmp0 << 8; - break; - case 22: tmp1 = (buf1[1] >> 16) & 0xff; - buf1[1] = (buf1[1] & 0xff00ffff) | tmp0 << 16; - break; - case 23: tmp1 = (buf1[1] >> 24) & 0xff; - buf1[1] = (buf1[1] & 0x00ffffff) | tmp0 << 24; - break; - case 24: tmp1 = (buf1[2] >> 0) & 0xff; - buf1[2] = (buf1[2] & 0xffffff00) | tmp0 << 0; - break; - case 25: tmp1 = (buf1[2] >> 8) & 0xff; - buf1[2] = (buf1[2] & 0xffff00ff) | tmp0 << 8; - break; - case 26: tmp1 = (buf1[2] >> 16) & 0xff; - buf1[2] = (buf1[2] & 0xff00ffff) | tmp0 << 16; - break; - case 27: tmp1 = (buf1[2] >> 24) & 0xff; - buf1[2] = (buf1[2] & 0x00ffffff) | tmp0 << 24; - break; - case 28: tmp1 = (buf1[3] >> 0) & 0xff; - buf1[3] = (buf1[3] & 0xffffff00) | tmp0 << 0; - break; - case 29: tmp1 = (buf1[3] >> 8) & 0xff; - buf1[3] = (buf1[3] & 0xffff00ff) | tmp0 << 8; - break; - case 30: tmp1 = (buf1[3] >> 16) & 0xff; - buf1[3] = (buf1[3] & 0xff00ffff) | tmp0 << 16; - break; - case 31: tmp1 = (buf1[3] >> 24) & 0xff; - buf1[3] = (buf1[3] & 0x00ffffff) | tmp0 << 24; - break; - } - - switch (p0) - { - case 0: buf0[0] = (buf0[0] & 0xffffff00) | tmp1 << 0; - break; - case 1: buf0[0] = (buf0[0] & 0xffff00ff) | tmp1 << 8; - break; - case 2: buf0[0] = (buf0[0] & 0xff00ffff) | tmp1 << 16; - break; - case 3: buf0[0] = (buf0[0] & 0x00ffffff) | tmp1 << 24; - break; - case 4: buf0[1] = (buf0[1] & 0xffffff00) | tmp1 << 0; - break; - case 5: buf0[1] = (buf0[1] & 0xffff00ff) | tmp1 << 8; - break; - case 6: buf0[1] = (buf0[1] & 0xff00ffff) | tmp1 << 16; - break; - case 7: buf0[1] = (buf0[1] & 0x00ffffff) | tmp1 << 24; - break; - case 8: buf0[2] = (buf0[2] & 0xffffff00) | tmp1 << 0; - break; - case 9: buf0[2] = (buf0[2] & 0xffff00ff) | tmp1 << 8; - break; - case 10: buf0[2] = (buf0[2] & 0xff00ffff) | tmp1 << 16; - break; - case 11: buf0[2] = (buf0[2] & 0x00ffffff) | tmp1 << 24; - break; - case 12: buf0[3] = (buf0[3] & 0xffffff00) | tmp1 << 0; - break; - case 13: buf0[3] = (buf0[3] & 0xffff00ff) | tmp1 << 8; - break; - case 14: buf0[3] = (buf0[3] & 0xff00ffff) | tmp1 << 16; - break; - case 15: buf0[3] = (buf0[3] & 0x00ffffff) | tmp1 << 24; - break; - case 16: buf1[0] = (buf1[0] & 0xffffff00) | tmp1 << 0; - break; - case 17: buf1[0] = (buf1[0] & 0xffff00ff) | tmp1 << 8; - break; - case 18: buf1[0] = (buf1[0] & 0xff00ffff) | tmp1 << 16; - break; - case 19: buf1[0] = (buf1[0] & 0x00ffffff) | tmp1 << 24; - break; - case 20: buf1[1] = (buf1[1] & 0xffffff00) | tmp1 << 0; - break; - case 21: buf1[1] = (buf1[1] & 0xffff00ff) | tmp1 << 8; - break; - case 22: buf1[1] = (buf1[1] & 0xff00ffff) | tmp1 << 16; - break; - case 23: buf1[1] = (buf1[1] & 0x00ffffff) | tmp1 << 24; - break; - case 24: buf1[2] = (buf1[2] & 0xffffff00) | tmp1 << 0; - break; - case 25: buf1[2] = (buf1[2] & 0xffff00ff) | tmp1 << 8; - break; - case 26: buf1[2] = (buf1[2] & 0xff00ffff) | tmp1 << 16; - break; - case 27: buf1[2] = (buf1[2] & 0x00ffffff) | tmp1 << 24; - break; - case 28: buf1[3] = (buf1[3] & 0xffffff00) | tmp1 << 0; - break; - case 29: buf1[3] = (buf1[3] & 0xffff00ff) | tmp1 << 8; - break; - case 30: buf1[3] = (buf1[3] & 0xff00ffff) | tmp1 << 16; - break; - case 31: buf1[3] = (buf1[3] & 0x00ffffff) | tmp1 << 24; - break; - } - - return in_len; -} - -static u32 rule_op_mangle_chr_shiftl (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - if (p0 >= in_len) return (in_len); - - const u32 mr = 0xffu << ((p0 & 3) * 8); - const u32 ml = ~mr; - - switch (p0 / 4) - { - case 0: buf0[0] = (buf0[0] & ml) | (((buf0[0] & mr) << 1) & mr); break; - case 1: buf0[1] = (buf0[1] & ml) | (((buf0[1] & mr) << 1) & mr); break; - case 2: buf0[2] = (buf0[2] & ml) | (((buf0[2] & mr) << 1) & mr); break; - case 3: buf0[3] = (buf0[3] & ml) | (((buf0[3] & mr) << 1) & mr); break; - case 4: buf1[0] = (buf1[0] & ml) | (((buf1[0] & mr) << 1) & mr); break; - case 5: buf1[1] = (buf1[1] & ml) | (((buf1[1] & mr) << 1) & mr); break; - case 6: buf1[2] = (buf1[2] & ml) | (((buf1[2] & mr) << 1) & mr); break; - case 7: buf1[3] = (buf1[3] & ml) | (((buf1[3] & mr) << 1) & mr); break; - } - - return in_len; -} - -static u32 rule_op_mangle_chr_shiftr (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - if (p0 >= in_len) return (in_len); - - const u32 mr = 0xffu << ((p0 & 3) * 8); - const u32 ml = ~mr; - - switch (p0 / 4) - { - case 0: buf0[0] = (buf0[0] & ml) | (((buf0[0] & mr) >> 1) & mr); break; - case 1: buf0[1] = (buf0[1] & ml) | (((buf0[1] & mr) >> 1) & mr); break; - case 2: buf0[2] = (buf0[2] & ml) | (((buf0[2] & mr) >> 1) & mr); break; - case 3: buf0[3] = (buf0[3] & ml) | (((buf0[3] & mr) >> 1) & mr); break; - case 4: buf1[0] = (buf1[0] & ml) | (((buf1[0] & mr) >> 1) & mr); break; - case 5: buf1[1] = (buf1[1] & ml) | (((buf1[1] & mr) >> 1) & mr); break; - case 6: buf1[2] = (buf1[2] & ml) | (((buf1[2] & mr) >> 1) & mr); break; - case 7: buf1[3] = (buf1[3] & ml) | (((buf1[3] & mr) >> 1) & mr); break; - } - - return in_len; -} - -static u32 rule_op_mangle_chr_incr (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - if (p0 >= in_len) return (in_len); - - const u32 mr = 0xffu << ((p0 & 3) * 8); - const u32 ml = ~mr; - - const u32 n = 0x01010101 & mr; - - switch (p0 / 4) - { - case 0: buf0[0] = (buf0[0] & ml) | (((buf0[0] & mr) + n) & mr); break; - case 1: buf0[1] = (buf0[1] & ml) | (((buf0[1] & mr) + n) & mr); break; - case 2: buf0[2] = (buf0[2] & ml) | (((buf0[2] & mr) + n) & mr); break; - case 3: buf0[3] = (buf0[3] & ml) | (((buf0[3] & mr) + n) & mr); break; - case 4: buf1[0] = (buf1[0] & ml) | (((buf1[0] & mr) + n) & mr); break; - case 5: buf1[1] = (buf1[1] & ml) | (((buf1[1] & mr) + n) & mr); break; - case 6: buf1[2] = (buf1[2] & ml) | (((buf1[2] & mr) + n) & mr); break; - case 7: buf1[3] = (buf1[3] & ml) | (((buf1[3] & mr) + n) & mr); break; - } - - return in_len; -} - -static u32 rule_op_mangle_chr_decr (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - if (p0 >= in_len) return (in_len); - - const u32 mr = 0xffu << ((p0 & 3) * 8); - const u32 ml = ~mr; - - const u32 n = 0x01010101 & mr; - - switch (p0 / 4) - { - case 0: buf0[0] = (buf0[0] & ml) | (((buf0[0] & mr) - n) & mr); break; - case 1: buf0[1] = (buf0[1] & ml) | (((buf0[1] & mr) - n) & mr); break; - case 2: buf0[2] = (buf0[2] & ml) | (((buf0[2] & mr) - n) & mr); break; - case 3: buf0[3] = (buf0[3] & ml) | (((buf0[3] & mr) - n) & mr); break; - case 4: buf1[0] = (buf1[0] & ml) | (((buf1[0] & mr) - n) & mr); break; - case 5: buf1[1] = (buf1[1] & ml) | (((buf1[1] & mr) - n) & mr); break; - case 6: buf1[2] = (buf1[2] & ml) | (((buf1[2] & mr) - n) & mr); break; - case 7: buf1[3] = (buf1[3] & ml) | (((buf1[3] & mr) - n) & mr); break; - } - - return in_len; -} - -static u32 rule_op_mangle_replace_np1 (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - if ((p0 + 1) >= in_len) return (in_len); - - u32 tib40[4]; - u32 tib41[4]; - - lshift_block (buf0, buf1, tib40, tib41); - - const u32 mr = 0xffu << ((p0 & 3) * 8); - const u32 ml = ~mr; - - switch (p0 / 4) - { - case 0: buf0[0] = (buf0[0] & ml) | (tib40[0] & mr); break; - case 1: buf0[1] = (buf0[1] & ml) | (tib40[1] & mr); break; - case 2: buf0[2] = (buf0[2] & ml) | (tib40[2] & mr); break; - case 3: buf0[3] = (buf0[3] & ml) | (tib40[3] & mr); break; - case 4: buf1[0] = (buf1[0] & ml) | (tib41[0] & mr); break; - case 5: buf1[1] = (buf1[1] & ml) | (tib41[1] & mr); break; - case 6: buf1[2] = (buf1[2] & ml) | (tib41[2] & mr); break; - case 7: buf1[3] = (buf1[3] & ml) | (tib41[3] & mr); break; - } - - return in_len; -} - -static u32 rule_op_mangle_replace_nm1 (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - if (p0 == 0) return (in_len); - - if (p0 >= in_len) return (in_len); - - u32 tib40[4]; - u32 tib41[4]; - - rshift_block (buf0, buf1, tib40, tib41); - - const u32 mr = 0xffu << ((p0 & 3) * 8); - const u32 ml = ~mr; - - switch (p0 / 4) - { - case 0: buf0[0] = (buf0[0] & ml) | (tib40[0] & mr); break; - case 1: buf0[1] = (buf0[1] & ml) | (tib40[1] & mr); break; - case 2: buf0[2] = (buf0[2] & ml) | (tib40[2] & mr); break; - case 3: buf0[3] = (buf0[3] & ml) | (tib40[3] & mr); break; - case 4: buf1[0] = (buf1[0] & ml) | (tib41[0] & mr); break; - case 5: buf1[1] = (buf1[1] & ml) | (tib41[1] & mr); break; - case 6: buf1[2] = (buf1[2] & ml) | (tib41[2] & mr); break; - case 7: buf1[3] = (buf1[3] & ml) | (tib41[3] & mr); break; - } - - return in_len; -} - -static u32 rule_op_mangle_dupeblock_first (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - if (p0 > in_len) return (in_len); - - if ((in_len + p0) >= 32) return (in_len); - - u32 out_len = in_len; - - u32 tib40[4]; - u32 tib41[4]; - - tib40[0] = buf0[0]; - tib40[1] = buf0[1]; - tib40[2] = buf0[2]; - tib40[3] = buf0[3]; - tib41[0] = buf1[0]; - tib41[1] = buf1[1]; - tib41[2] = buf1[2]; - tib41[3] = buf1[3]; - - truncate_right (tib40, tib41, p0); - - rshift_block_N (buf0, buf1, buf0, buf1, p0); - - buf0[0] |= tib40[0]; - buf0[1] |= tib40[1]; - buf0[2] |= tib40[2]; - buf0[3] |= tib40[3]; - buf1[0] |= tib41[0]; - buf1[1] |= tib41[1]; - buf1[2] |= tib41[2]; - buf1[3] |= tib41[3]; - - out_len += p0; - - return out_len; -} - -static u32 rule_op_mangle_dupeblock_last (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - if (p0 > in_len) return (in_len); - - if ((in_len + p0) >= 32) return (in_len); - - u32 out_len = in_len; - - u32 tib40[4] = { 0 }; - u32 tib41[4] = { 0 }; - - rshift_block_N (buf0, buf1, tib40, tib41, p0); - - truncate_left (tib40, tib41, out_len); - - buf0[0] |= tib40[0]; - buf0[1] |= tib40[1]; - buf0[2] |= tib40[2]; - buf0[3] |= tib40[3]; - buf1[0] |= tib41[0]; - buf1[1] |= tib41[1]; - buf1[2] |= tib41[2]; - buf1[3] |= tib41[3]; - - out_len += p0; - - return out_len; -} - -static u32 rule_op_mangle_title_sep (MAYBE_UNUSED const u32 p0, MAYBE_UNUSED const u32 p1, MAYBE_UNUSED u32 buf0[4], MAYBE_UNUSED u32 buf1[4], const u32 in_len) -{ - buf0[0] |= (generate_cmask (buf0[0])); - buf0[1] |= (generate_cmask (buf0[1])); - buf0[2] |= (generate_cmask (buf0[2])); - buf0[3] |= (generate_cmask (buf0[3])); - buf1[0] |= (generate_cmask (buf1[0])); - buf1[1] |= (generate_cmask (buf1[1])); - buf1[2] |= (generate_cmask (buf1[2])); - buf1[3] |= (generate_cmask (buf1[3])); - - buf0[0] &= ~(0x00000020 & generate_cmask (buf0[0])); - - const u8 tmp2 = (u8) p0; - - for (u32 i = 0; i < in_len; i++) - { - u32 tmp0 = 0; - u32 tmp1 = 0; - - switch (i) - { - case 0: tmp0 = (buf0[0] >> 0) & 0xFF; - tmp1 = ~(0x00002000 & generate_cmask (buf0[0])); break; - case 1: tmp0 = (buf0[0] >> 8) & 0xFF; - tmp1 = ~(0x00200000 & generate_cmask (buf0[0])); break; - case 2: tmp0 = (buf0[0] >> 16) & 0xFF; - tmp1 = ~(0x20000000 & generate_cmask (buf0[0])); break; - case 3: tmp0 = (buf0[0] >> 24) & 0xFF; - tmp1 = ~(0x00000020 & generate_cmask (buf0[1])); break; - case 4: tmp0 = (buf0[1] >> 0) & 0xFF; - tmp1 = ~(0x00002000 & generate_cmask (buf0[1])); break; - case 5: tmp0 = (buf0[1] >> 8) & 0xFF; - tmp1 = ~(0x00200000 & generate_cmask (buf0[1])); break; - case 6: tmp0 = (buf0[1] >> 16) & 0xFF; - tmp1 = ~(0x20000000 & generate_cmask (buf0[1])); break; - case 7: tmp0 = (buf0[1] >> 24) & 0xFF; - tmp1 = ~(0x00000020 & generate_cmask (buf0[2])); break; - case 8: tmp0 = (buf0[2] >> 0) & 0xFF; - tmp1 = ~(0x00002000 & generate_cmask (buf0[2])); break; - case 9: tmp0 = (buf0[2] >> 8) & 0xFF; - tmp1 = ~(0x00200000 & generate_cmask (buf0[2])); break; - case 10: tmp0 = (buf0[2] >> 16) & 0xFF; - tmp1 = ~(0x20000000 & generate_cmask (buf0[2])); break; - case 11: tmp0 = (buf0[2] >> 24) & 0xFF; - tmp1 = ~(0x00000020 & generate_cmask (buf0[3])); break; - case 12: tmp0 = (buf0[3] >> 0) & 0xFF; - tmp1 = ~(0x00002000 & generate_cmask (buf0[3])); break; - case 13: tmp0 = (buf0[3] >> 8) & 0xFF; - tmp1 = ~(0x00200000 & generate_cmask (buf0[3])); break; - case 14: tmp0 = (buf0[3] >> 16) & 0xFF; - tmp1 = ~(0x20000000 & generate_cmask (buf0[3])); break; - case 15: tmp0 = (buf0[3] >> 24) & 0xFF; - tmp1 = ~(0x00000020 & generate_cmask (buf1[0])); break; - case 16: tmp0 = (buf1[0] >> 0) & 0xFF; - tmp1 = ~(0x00002000 & generate_cmask (buf1[0])); break; - case 17: tmp0 = (buf1[0] >> 8) & 0xFF; - tmp1 = ~(0x00200000 & generate_cmask (buf1[0])); break; - case 18: tmp0 = (buf1[0] >> 16) & 0xFF; - tmp1 = ~(0x20000000 & generate_cmask (buf1[0])); break; - case 19: tmp0 = (buf1[0] >> 24) & 0xFF; - tmp1 = ~(0x00000020 & generate_cmask (buf1[1])); break; - case 20: tmp0 = (buf1[1] >> 0) & 0xFF; - tmp1 = ~(0x00002000 & generate_cmask (buf1[1])); break; - case 21: tmp0 = (buf1[1] >> 8) & 0xFF; - tmp1 = ~(0x00200000 & generate_cmask (buf1[1])); break; - case 22: tmp0 = (buf1[1] >> 16) & 0xFF; - tmp1 = ~(0x20000000 & generate_cmask (buf1[1])); break; - case 23: tmp0 = (buf1[1] >> 24) & 0xFF; - tmp1 = ~(0x00000020 & generate_cmask (buf1[2])); break; - case 24: tmp0 = (buf1[2] >> 0) & 0xFF; - tmp1 = ~(0x00002000 & generate_cmask (buf1[2])); break; - case 25: tmp0 = (buf1[2] >> 8) & 0xFF; - tmp1 = ~(0x00200000 & generate_cmask (buf1[2])); break; - case 26: tmp0 = (buf1[2] >> 16) & 0xFF; - tmp1 = ~(0x20000000 & generate_cmask (buf1[2])); break; - case 27: tmp0 = (buf1[2] >> 24) & 0xFF; - tmp1 = ~(0x00000020 & generate_cmask (buf1[3])); break; - case 28: tmp0 = (buf1[3] >> 0) & 0xFF; - tmp1 = ~(0x00002000 & generate_cmask (buf1[3])); break; - case 29: tmp0 = (buf1[3] >> 8) & 0xFF; - tmp1 = ~(0x00200000 & generate_cmask (buf1[3])); break; - case 30: tmp0 = (buf1[3] >> 16) & 0xFF; - tmp1 = ~(0x20000000 & generate_cmask (buf1[3])); break; - } - - if (i < 3) - { - if (tmp0 == tmp2) buf0[0] &= tmp1 ; - } - else if (i < 7) - { - if (tmp0 == tmp2) buf0[1] &= tmp1 ; - } - else if (i < 11) - { - if (tmp0 == tmp2) buf0[2] &= tmp1 ; - } - else if (i < 15) - { - if (tmp0 == tmp2) buf0[3] &= tmp1 ; - } - else if (i < 19) - { - if (tmp0 == tmp2) buf1[0] &= tmp1 ; - } - else if (i < 23) - { - if (tmp0 == tmp2) buf1[1] &= tmp1 ; - } - else if (i < 27) - { - if (tmp0 == tmp2) buf1[2] &= tmp1 ; - } - else if (i < 31) - { - if (tmp0 == tmp2) buf1[3] &= tmp1 ; - } - } - - return in_len; -} - -u32 apply_rule_optimized (const u32 name, const u32 p0, const u32 p1, u32 buf0[4], u32 buf1[4], const u32 in_len) -{ - u32 out_len = in_len; - - switch (name) - { - case RULE_OP_MANGLE_LREST: out_len = rule_op_mangle_lrest (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_UREST: out_len = rule_op_mangle_urest (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_LREST_UFIRST: out_len = rule_op_mangle_lrest_ufirst (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_UREST_LFIRST: out_len = rule_op_mangle_urest_lfirst (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_TREST: out_len = rule_op_mangle_trest (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_TOGGLE_AT: out_len = rule_op_mangle_toggle_at (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_REVERSE: out_len = rule_op_mangle_reverse (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_DUPEWORD: out_len = rule_op_mangle_dupeword (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_DUPEWORD_TIMES: out_len = rule_op_mangle_dupeword_times (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_REFLECT: out_len = rule_op_mangle_reflect (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_APPEND: out_len = rule_op_mangle_append (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_PREPEND: out_len = rule_op_mangle_prepend (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_ROTATE_LEFT: out_len = rule_op_mangle_rotate_left (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_ROTATE_RIGHT: out_len = rule_op_mangle_rotate_right (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_DELETE_FIRST: out_len = rule_op_mangle_delete_first (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_DELETE_LAST: out_len = rule_op_mangle_delete_last (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_DELETE_AT: out_len = rule_op_mangle_delete_at (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_EXTRACT: out_len = rule_op_mangle_extract (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_OMIT: out_len = rule_op_mangle_omit (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_INSERT: out_len = rule_op_mangle_insert (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_OVERSTRIKE: out_len = rule_op_mangle_overstrike (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_TRUNCATE_AT: out_len = rule_op_mangle_truncate_at (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_REPLACE: out_len = rule_op_mangle_replace (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_PURGECHAR: out_len = rule_op_mangle_purgechar (p0, p1, buf0, buf1, out_len); break; - //case RULE_OP_MANGLE_TOGGLECASE_REC: out_len = rule_op_mangle_togglecase_rec (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_DUPECHAR_FIRST: out_len = rule_op_mangle_dupechar_first (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_DUPECHAR_LAST: out_len = rule_op_mangle_dupechar_last (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_DUPECHAR_ALL: out_len = rule_op_mangle_dupechar_all (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_SWITCH_FIRST: out_len = rule_op_mangle_switch_first (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_SWITCH_LAST: out_len = rule_op_mangle_switch_last (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_SWITCH_AT: out_len = rule_op_mangle_switch_at (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_CHR_SHIFTL: out_len = rule_op_mangle_chr_shiftl (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_CHR_SHIFTR: out_len = rule_op_mangle_chr_shiftr (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_CHR_INCR: out_len = rule_op_mangle_chr_incr (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_CHR_DECR: out_len = rule_op_mangle_chr_decr (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_REPLACE_NP1: out_len = rule_op_mangle_replace_np1 (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_REPLACE_NM1: out_len = rule_op_mangle_replace_nm1 (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_DUPEBLOCK_FIRST: out_len = rule_op_mangle_dupeblock_first (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_DUPEBLOCK_LAST: out_len = rule_op_mangle_dupeblock_last (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_TITLE_SEP: out_len = rule_op_mangle_title_sep (p0, p1, buf0, buf1, out_len); break; - case RULE_OP_MANGLE_TITLE: out_len = rule_op_mangle_title_sep (' ', p1, buf0, buf1, out_len); break; - } - - return out_len; -} - -u32 apply_rules_optimized (const u32 *cmds, u32 buf0[4], u32 buf1[4], const u32 len) -{ - u32 out_len = len; - - for (u32 i = 0; cmds[i] != 0; i++) - { - const u32 cmd = cmds[i]; - - const u32 name = (cmd >> 0) & 0xff; - const u32 p0 = (cmd >> 8) & 0xff; - const u32 p1 = (cmd >> 16) & 0xff; - - out_len = apply_rule_optimized (name, p0, p1, buf0, buf1, out_len); - } - - return out_len; -} diff --git a/src/slow_candidates.c b/src/slow_candidates.c index d0cec2f10..03b4586e7 100644 --- a/src/slow_candidates.c +++ b/src/slow_candidates.c @@ -7,8 +7,8 @@ #include "types.h" #include "rp.h" #include "rp_cpu.h" -#include "rp_kernel_on_cpu.h" -#include "rp_kernel_on_cpu_optimized.h" +#include "emu_inc_rp.h" +#include "emu_inc_rp_optimized.h" #include "wordlist.h" #include "mpsp.h" #include "filehandling.h" diff --git a/src/stdout.c b/src/stdout.c index a2c4efe5b..40bdd35d3 100644 --- a/src/stdout.c +++ b/src/stdout.c @@ -7,8 +7,8 @@ #include "types.h" #include "event.h" #include "locking.h" -#include "rp_kernel_on_cpu.h" -#include "rp_kernel_on_cpu_optimized.h" +#include "emu_inc_rp.h" +#include "emu_inc_rp_optimized.h" #include "mpsp.h" #include "opencl.h" #include "shared.h"