sleeping_kangaroo12 0.0.1 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.md +27 -0
- data/README.md +48 -53
- data/ext/Rakefile +12 -37
- data/ext/binding/sleeping_kangaroo12.c +1 -16
- data/ext/{xkcp → k12}/Makefile +0 -0
- data/ext/k12/Makefile.build +118 -0
- data/ext/k12/README.markdown +86 -0
- data/ext/k12/lib/ARMv8Asha3/KeccakP-1600-ARMv8Asha3.S +623 -0
- data/ext/k12/lib/ARMv8Asha3/KeccakP-1600-SnP.h +65 -0
- data/ext/k12/lib/ARMv8Asha3/KeccakP-1600-opt64.c +227 -0
- data/ext/{xkcp/lib/low/KeccakP-1600/compact → k12/lib/Inplace32BI}/KeccakP-1600-SnP.h +4 -9
- data/ext/{xkcp/lib/low/KeccakP-1600/plain-32bits-inplace → k12/lib/Inplace32BI}/KeccakP-1600-inplace32BI.c +65 -160
- data/ext/k12/lib/KangarooTwelve.c +332 -0
- data/ext/{xkcp/lib/high/KangarooTwelve → k12/lib}/KangarooTwelve.h +53 -16
- data/ext/{xkcp/lib/low/KeccakP-1600/AVX2 → k12/lib/Optimized64}/KeccakP-1600-AVX2.s +122 -558
- data/ext/k12/lib/Optimized64/KeccakP-1600-AVX512-plainC.c +241 -0
- data/ext/k12/lib/Optimized64/KeccakP-1600-AVX512.s +551 -0
- data/ext/k12/lib/Optimized64/KeccakP-1600-SnP.h +74 -0
- data/ext/{xkcp/lib/low/KeccakP-1600/common/KeccakP-1600-64.macros → k12/lib/Optimized64/KeccakP-1600-opt64.c} +447 -169
- data/ext/k12/lib/Optimized64/KeccakP-1600-runtimeDispatch.c +406 -0
- data/ext/k12/lib/Optimized64/KeccakP-1600-timesN-AVX2.c +419 -0
- data/ext/k12/lib/Optimized64/KeccakP-1600-timesN-AVX512.c +458 -0
- data/ext/k12/lib/Optimized64/KeccakP-1600-timesN-SSSE3.c +438 -0
- data/ext/{xkcp/lib/low/KeccakP-1600/plain-64bits → k12/lib/Plain64}/KeccakP-1600-SnP.h +14 -20
- data/ext/{xkcp/lib/low/KeccakP-1600/ref-64bits/KeccakP-1600-reference.h → k12/lib/Plain64/KeccakP-1600-plain64.c} +9 -8
- data/ext/{xkcp/lib/common → k12/lib}/align.h +3 -2
- data/ext/{xkcp/lib/common → k12/lib}/brg_endian.h +0 -0
- data/ext/{xkcp → k12}/support/Build/ExpandProducts.xsl +0 -0
- data/ext/{xkcp → k12}/support/Build/ToGlobalMakefile.xsl +0 -0
- data/ext/{xkcp → k12}/support/Build/ToOneTarget.xsl +0 -0
- data/ext/{xkcp → k12}/support/Build/ToTargetConfigFile.xsl +0 -0
- data/ext/{xkcp → k12}/support/Build/ToTargetMakefile.xsl +10 -16
- data/ext/{xkcp → k12}/support/Build/ToVCXProj.xsl +0 -0
- data/lib/sleeping_kangaroo12/binding.rb +2 -1
- data/lib/sleeping_kangaroo12/build/loader.rb +1 -0
- data/lib/sleeping_kangaroo12/build/platform.rb +1 -0
- data/lib/sleeping_kangaroo12/digest.rb +38 -4
- data/lib/sleeping_kangaroo12/version.rb +1 -1
- metadata +48 -288
- data/ext/config/xkcp.build +0 -17
- data/ext/xkcp/LICENSE +0 -1
- data/ext/xkcp/Makefile.build +0 -200
- data/ext/xkcp/README.markdown +0 -296
- data/ext/xkcp/lib/HighLevel.build +0 -143
- data/ext/xkcp/lib/LowLevel.build +0 -757
- data/ext/xkcp/lib/high/KangarooTwelve/KangarooTwelve.c +0 -301
- data/ext/xkcp/lib/high/Keccak/FIPS202/KeccakHash.c +0 -81
- data/ext/xkcp/lib/high/Keccak/FIPS202/KeccakHash.h +0 -125
- data/ext/xkcp/lib/high/Keccak/FIPS202/SimpleFIPS202.c +0 -48
- data/ext/xkcp/lib/high/Keccak/FIPS202/SimpleFIPS202.h +0 -79
- data/ext/xkcp/lib/high/Keccak/KeccakDuplex.c +0 -81
- data/ext/xkcp/lib/high/Keccak/KeccakDuplex.h +0 -73
- data/ext/xkcp/lib/high/Keccak/KeccakDuplex.inc +0 -195
- data/ext/xkcp/lib/high/Keccak/KeccakSponge.c +0 -111
- data/ext/xkcp/lib/high/Keccak/KeccakSponge.h +0 -76
- data/ext/xkcp/lib/high/Keccak/KeccakSponge.inc +0 -314
- data/ext/xkcp/lib/high/Keccak/PRG/KeccakPRG.c +0 -61
- data/ext/xkcp/lib/high/Keccak/PRG/KeccakPRG.h +0 -67
- data/ext/xkcp/lib/high/Keccak/PRG/KeccakPRG.inc +0 -128
- data/ext/xkcp/lib/high/Keccak/SP800-185/SP800-185.c +0 -93
- data/ext/xkcp/lib/high/Keccak/SP800-185/SP800-185.h +0 -599
- data/ext/xkcp/lib/high/Keccak/SP800-185/SP800-185.inc +0 -573
- data/ext/xkcp/lib/high/Ketje/Ketjev2.c +0 -87
- data/ext/xkcp/lib/high/Ketje/Ketjev2.h +0 -88
- data/ext/xkcp/lib/high/Ketje/Ketjev2.inc +0 -274
- data/ext/xkcp/lib/high/Keyak/Keyakv2.c +0 -132
- data/ext/xkcp/lib/high/Keyak/Keyakv2.h +0 -217
- data/ext/xkcp/lib/high/Keyak/Keyakv2.inc +0 -81
- data/ext/xkcp/lib/high/Keyak/Motorist.inc +0 -953
- data/ext/xkcp/lib/high/Kravatte/Kravatte.c +0 -533
- data/ext/xkcp/lib/high/Kravatte/Kravatte.h +0 -115
- data/ext/xkcp/lib/high/Kravatte/KravatteModes.c +0 -557
- data/ext/xkcp/lib/high/Kravatte/KravatteModes.h +0 -247
- data/ext/xkcp/lib/high/Xoodyak/Cyclist.h +0 -66
- data/ext/xkcp/lib/high/Xoodyak/Cyclist.inc +0 -336
- data/ext/xkcp/lib/high/Xoodyak/Xoodyak-parameters.h +0 -26
- data/ext/xkcp/lib/high/Xoodyak/Xoodyak.c +0 -55
- data/ext/xkcp/lib/high/Xoodyak/Xoodyak.h +0 -35
- data/ext/xkcp/lib/high/Xoofff/Xoofff.c +0 -634
- data/ext/xkcp/lib/high/Xoofff/Xoofff.h +0 -147
- data/ext/xkcp/lib/high/Xoofff/XoofffModes.c +0 -483
- data/ext/xkcp/lib/high/Xoofff/XoofffModes.h +0 -241
- data/ext/xkcp/lib/high/common/Phases.h +0 -25
- data/ext/xkcp/lib/low/KeccakP-1600/ARM/KeccakP-1600-SnP.h +0 -41
- data/ext/xkcp/lib/low/KeccakP-1600/ARM/KeccakP-1600-inplace-32bi-armv6m-le-armcc.s +0 -1666
- data/ext/xkcp/lib/low/KeccakP-1600/ARM/KeccakP-1600-inplace-32bi-armv6m-le-gcc.s +0 -1655
- data/ext/xkcp/lib/low/KeccakP-1600/ARM/KeccakP-1600-inplace-32bi-armv7a-le-armcc.s +0 -1268
- data/ext/xkcp/lib/low/KeccakP-1600/ARM/KeccakP-1600-inplace-32bi-armv7a-le-gcc.s +0 -1264
- data/ext/xkcp/lib/low/KeccakP-1600/ARM/KeccakP-1600-inplace-32bi-armv7m-le-armcc.s +0 -1178
- data/ext/xkcp/lib/low/KeccakP-1600/ARM/KeccakP-1600-inplace-32bi-armv7m-le-gcc.s +0 -1175
- data/ext/xkcp/lib/low/KeccakP-1600/ARM/KeccakP-1600-u1-32bi-armv6m-le-armcc.s +0 -1338
- data/ext/xkcp/lib/low/KeccakP-1600/ARM/KeccakP-1600-u1-32bi-armv6m-le-gcc.s +0 -1336
- data/ext/xkcp/lib/low/KeccakP-1600/ARM/KeccakP-1600-u2-32bi-armv6m-le-armcc.s +0 -1343
- data/ext/xkcp/lib/low/KeccakP-1600/ARM/KeccakP-1600-u2-32bi-armv6m-le-gcc.s +0 -1339
- data/ext/xkcp/lib/low/KeccakP-1600/ARMv7A-NEON/KeccakP-1600-SnP.h +0 -42
- data/ext/xkcp/lib/low/KeccakP-1600/ARMv7A-NEON/KeccakP-1600-armv7a-le-neon-armcc.s +0 -823
- data/ext/xkcp/lib/low/KeccakP-1600/ARMv7A-NEON/KeccakP-1600-armv7a-le-neon-gcc.s +0 -831
- data/ext/xkcp/lib/low/KeccakP-1600/ARMv8A/KeccakP-1600-SnP.h +0 -31
- data/ext/xkcp/lib/low/KeccakP-1600/ARMv8A/KeccakP-1600-armv8a-neon.s +0 -540
- data/ext/xkcp/lib/low/KeccakP-1600/AVR8/KeccakP-1600-SnP.h +0 -42
- data/ext/xkcp/lib/low/KeccakP-1600/AVR8/KeccakP-1600-avr8-compact.s +0 -733
- data/ext/xkcp/lib/low/KeccakP-1600/AVR8/KeccakP-1600-avr8-fast.s +0 -1121
- data/ext/xkcp/lib/low/KeccakP-1600/AVX2/KeccakP-1600-SnP.h +0 -52
- data/ext/xkcp/lib/low/KeccakP-1600/AVX512/C/KeccakP-1600-AVX512.c +0 -623
- data/ext/xkcp/lib/low/KeccakP-1600/AVX512/C/KeccakP-1600-SnP.h +0 -47
- data/ext/xkcp/lib/low/KeccakP-1600/AVX512/C/u12/KeccakP-1600-AVX512-config.h +0 -6
- data/ext/xkcp/lib/low/KeccakP-1600/AVX512/C/u6/KeccakP-1600-AVX512-config.h +0 -6
- data/ext/xkcp/lib/low/KeccakP-1600/AVX512/C/ua/KeccakP-1600-AVX512-config.h +0 -6
- data/ext/xkcp/lib/low/KeccakP-1600/AVX512/KeccakP-1600-AVX512.s +0 -1031
- data/ext/xkcp/lib/low/KeccakP-1600/AVX512/KeccakP-1600-SnP.h +0 -53
- data/ext/xkcp/lib/low/KeccakP-1600/XOP/KeccakP-1600-SnP.h +0 -44
- data/ext/xkcp/lib/low/KeccakP-1600/XOP/KeccakP-1600-XOP.c +0 -476
- data/ext/xkcp/lib/low/KeccakP-1600/XOP/u6/KeccakP-1600-XOP-config.h +0 -6
- data/ext/xkcp/lib/low/KeccakP-1600/XOP/ua/KeccakP-1600-XOP-config.h +0 -6
- data/ext/xkcp/lib/low/KeccakP-1600/common/KeccakP-1600-unrolling.macros +0 -305
- data/ext/xkcp/lib/low/KeccakP-1600/compact/KeccakP-1600-compact64.c +0 -420
- data/ext/xkcp/lib/low/KeccakP-1600/plain-32bits-inplace/KeccakP-1600-SnP.h +0 -43
- data/ext/xkcp/lib/low/KeccakP-1600/plain-64bits/KeccakP-1600-opt64.c +0 -565
- data/ext/xkcp/lib/low/KeccakP-1600/plain-64bits/lcu6/KeccakP-1600-opt64-config.h +0 -7
- data/ext/xkcp/lib/low/KeccakP-1600/plain-64bits/lcua/KeccakP-1600-opt64-config.h +0 -7
- data/ext/xkcp/lib/low/KeccakP-1600/plain-64bits/lcua-shld/KeccakP-1600-opt64-config.h +0 -8
- data/ext/xkcp/lib/low/KeccakP-1600/plain-64bits/u6/KeccakP-1600-opt64-config.h +0 -6
- data/ext/xkcp/lib/low/KeccakP-1600/plain-64bits/ua/KeccakP-1600-opt64-config.h +0 -6
- data/ext/xkcp/lib/low/KeccakP-1600/ref-32bits/KeccakP-1600-SnP.h +0 -44
- data/ext/xkcp/lib/low/KeccakP-1600/ref-32bits/KeccakP-1600-reference.h +0 -23
- data/ext/xkcp/lib/low/KeccakP-1600/ref-32bits/KeccakP-1600-reference32BI.c +0 -625
- data/ext/xkcp/lib/low/KeccakP-1600/ref-64bits/KeccakP-1600-SnP.h +0 -44
- data/ext/xkcp/lib/low/KeccakP-1600/ref-64bits/KeccakP-1600-reference.c +0 -440
- data/ext/xkcp/lib/low/KeccakP-1600/x86-64/KeccakP-1600-SnP.h +0 -42
- data/ext/xkcp/lib/low/KeccakP-1600/x86-64/KeccakP-1600-x86-64-gas.s +0 -1196
- data/ext/xkcp/lib/low/KeccakP-1600/x86-64/KeccakP-1600-x86-64-gas_Apple.s +0 -1124
- data/ext/xkcp/lib/low/KeccakP-1600/x86-64/KeccakP-1600-x86-64-shld-gas.s +0 -1196
- data/ext/xkcp/lib/low/KeccakP-1600-times2/ARMv7A-NEON/KeccakP-1600-inplace-pl2-armv7a-neon-le-armcc.s +0 -1392
- data/ext/xkcp/lib/low/KeccakP-1600-times2/ARMv7A-NEON/KeccakP-1600-inplace-pl2-armv7a-neon-le-gcc.s +0 -1394
- data/ext/xkcp/lib/low/KeccakP-1600-times2/ARMv7A-NEON/KeccakP-1600-times2-SnP.h +0 -42
- data/ext/xkcp/lib/low/KeccakP-1600-times2/AVX512/AVX512u12/SIMD512-2-config.h +0 -7
- data/ext/xkcp/lib/low/KeccakP-1600-times2/AVX512/AVX512u4/SIMD512-2-config.h +0 -7
- data/ext/xkcp/lib/low/KeccakP-1600-times2/AVX512/AVX512ufull/SIMD512-2-config.h +0 -7
- data/ext/xkcp/lib/low/KeccakP-1600-times2/AVX512/KeccakP-1600-times2-SIMD512.c +0 -850
- data/ext/xkcp/lib/low/KeccakP-1600-times2/AVX512/KeccakP-1600-times2-SnP.h +0 -51
- data/ext/xkcp/lib/low/KeccakP-1600-times2/SIMD128/KeccakP-1600-times2-SIMD128.c +0 -957
- data/ext/xkcp/lib/low/KeccakP-1600-times2/SIMD128/KeccakP-1600-times2-SnP.h +0 -49
- data/ext/xkcp/lib/low/KeccakP-1600-times2/SIMD128/SSSE3-u2/SIMD128-config.h +0 -8
- data/ext/xkcp/lib/low/KeccakP-1600-times2/SIMD128/SSSE3-ua/SIMD128-config.h +0 -8
- data/ext/xkcp/lib/low/KeccakP-1600-times2/SIMD128/XOP-u2/SIMD128-config.h +0 -9
- data/ext/xkcp/lib/low/KeccakP-1600-times2/SIMD128/XOP-ua/SIMD128-config.h +0 -9
- data/ext/xkcp/lib/low/KeccakP-1600-times2/fallback-on1/KeccakP-1600-times2-SnP.h +0 -45
- data/ext/xkcp/lib/low/KeccakP-1600-times2/fallback-on1/KeccakP-1600-times2-on1.c +0 -37
- data/ext/xkcp/lib/low/KeccakP-1600-times4/AVX2/KeccakP-1600-times4-SIMD256.c +0 -1321
- data/ext/xkcp/lib/low/KeccakP-1600-times4/AVX2/KeccakP-1600-times4-SnP.h +0 -55
- data/ext/xkcp/lib/low/KeccakP-1600-times4/AVX2/u12/SIMD256-config.h +0 -7
- data/ext/xkcp/lib/low/KeccakP-1600-times4/AVX2/u6/SIMD256-config.h +0 -7
- data/ext/xkcp/lib/low/KeccakP-1600-times4/AVX2/ua/SIMD256-config.h +0 -7
- data/ext/xkcp/lib/low/KeccakP-1600-times4/AVX512/AVX512u12/SIMD512-4-config.h +0 -7
- data/ext/xkcp/lib/low/KeccakP-1600-times4/AVX512/AVX512u4/SIMD512-4-config.h +0 -7
- data/ext/xkcp/lib/low/KeccakP-1600-times4/AVX512/AVX512ufull/SIMD512-4-config.h +0 -7
- data/ext/xkcp/lib/low/KeccakP-1600-times4/AVX512/KeccakP-1600-times4-SIMD512.c +0 -881
- data/ext/xkcp/lib/low/KeccakP-1600-times4/AVX512/KeccakP-1600-times4-SnP.h +0 -51
- data/ext/xkcp/lib/low/KeccakP-1600-times4/fallback-on1/KeccakP-1600-times4-SnP.h +0 -45
- data/ext/xkcp/lib/low/KeccakP-1600-times4/fallback-on1/KeccakP-1600-times4-on1.c +0 -37
- data/ext/xkcp/lib/low/KeccakP-1600-times4/fallback-on2/KeccakP-1600-times4-SnP.h +0 -45
- data/ext/xkcp/lib/low/KeccakP-1600-times4/fallback-on2/KeccakP-1600-times4-on2.c +0 -38
- data/ext/xkcp/lib/low/KeccakP-1600-times8/AVX512/KeccakP-1600-times8-SIMD512.c +0 -1615
- data/ext/xkcp/lib/low/KeccakP-1600-times8/AVX512/KeccakP-1600-times8-SnP.h +0 -57
- data/ext/xkcp/lib/low/KeccakP-1600-times8/AVX512/u12/SIMD512-config.h +0 -7
- data/ext/xkcp/lib/low/KeccakP-1600-times8/AVX512/u4/SIMD512-config.h +0 -7
- data/ext/xkcp/lib/low/KeccakP-1600-times8/AVX512/ua/SIMD512-config.h +0 -7
- data/ext/xkcp/lib/low/KeccakP-1600-times8/fallback-on1/KeccakP-1600-times8-SnP.h +0 -45
- data/ext/xkcp/lib/low/KeccakP-1600-times8/fallback-on1/KeccakP-1600-times8-on1.c +0 -37
- data/ext/xkcp/lib/low/KeccakP-1600-times8/fallback-on2/KeccakP-1600-times8-SnP.h +0 -45
- data/ext/xkcp/lib/low/KeccakP-1600-times8/fallback-on2/KeccakP-1600-times8-on2.c +0 -38
- data/ext/xkcp/lib/low/KeccakP-1600-times8/fallback-on4/KeccakP-1600-times8-SnP.h +0 -45
- data/ext/xkcp/lib/low/KeccakP-1600-times8/fallback-on4/KeccakP-1600-times8-on4.c +0 -38
- data/ext/xkcp/lib/low/KeccakP-200/ARM/KeccakP-200-SnP.h +0 -41
- data/ext/xkcp/lib/low/KeccakP-200/ARM/KeccakP-200-armv6m-le-armcc.s +0 -442
- data/ext/xkcp/lib/low/KeccakP-200/ARM/KeccakP-200-armv6m-le-gcc.s +0 -446
- data/ext/xkcp/lib/low/KeccakP-200/ARM/KeccakP-200-armv7m-le-armcc.s +0 -419
- data/ext/xkcp/lib/low/KeccakP-200/ARM/KeccakP-200-armv7m-le-gcc.s +0 -427
- data/ext/xkcp/lib/low/KeccakP-200/AVR8/KeccakP-200-SnP.h +0 -41
- data/ext/xkcp/lib/low/KeccakP-200/AVR8/KeccakP-200-avr8-fast.s +0 -647
- data/ext/xkcp/lib/low/KeccakP-200/compact/KeccakP-200-SnP.h +0 -39
- data/ext/xkcp/lib/low/KeccakP-200/compact/KeccakP-200-compact.c +0 -190
- data/ext/xkcp/lib/low/KeccakP-200/ref/KeccakP-200-SnP.h +0 -43
- data/ext/xkcp/lib/low/KeccakP-200/ref/KeccakP-200-reference.c +0 -412
- data/ext/xkcp/lib/low/KeccakP-200/ref/KeccakP-200-reference.h +0 -23
- data/ext/xkcp/lib/low/KeccakP-400/ARM/KeccakP-400-SnP.h +0 -41
- data/ext/xkcp/lib/low/KeccakP-400/ARM/KeccakP-400-armv6m-le-armcc.s +0 -454
- data/ext/xkcp/lib/low/KeccakP-400/ARM/KeccakP-400-armv6m-le-gcc.s +0 -458
- data/ext/xkcp/lib/low/KeccakP-400/ARM/KeccakP-400-armv7m-le-armcc.s +0 -455
- data/ext/xkcp/lib/low/KeccakP-400/ARM/KeccakP-400-armv7m-le-gcc.s +0 -458
- data/ext/xkcp/lib/low/KeccakP-400/AVR8/KeccakP-400-SnP.h +0 -41
- data/ext/xkcp/lib/low/KeccakP-400/AVR8/KeccakP-400-avr8-fast.s +0 -728
- data/ext/xkcp/lib/low/KeccakP-400/ref/KeccakP-400-SnP.h +0 -43
- data/ext/xkcp/lib/low/KeccakP-400/ref/KeccakP-400-reference.c +0 -414
- data/ext/xkcp/lib/low/KeccakP-400/ref/KeccakP-400-reference.h +0 -23
- data/ext/xkcp/lib/low/KeccakP-800/ARM/KeccakP-800-SnP.h +0 -42
- data/ext/xkcp/lib/low/KeccakP-800/ARM/KeccakP-800-u1-armv6m-le-armcc.s +0 -527
- data/ext/xkcp/lib/low/KeccakP-800/ARM/KeccakP-800-u1-armv6m-le-gcc.s +0 -533
- data/ext/xkcp/lib/low/KeccakP-800/ARM/KeccakP-800-u2-armv6m-le-armcc.s +0 -528
- data/ext/xkcp/lib/low/KeccakP-800/ARM/KeccakP-800-u2-armv6m-le-gcc.s +0 -534
- data/ext/xkcp/lib/low/KeccakP-800/ARM/KeccakP-800-u2-armv7a-le-armcc.s +0 -521
- data/ext/xkcp/lib/low/KeccakP-800/ARM/KeccakP-800-u2-armv7a-le-gcc.s +0 -527
- data/ext/xkcp/lib/low/KeccakP-800/ARM/KeccakP-800-u2-armv7m-le-armcc.s +0 -517
- data/ext/xkcp/lib/low/KeccakP-800/ARM/KeccakP-800-u2-armv7m-le-gcc.s +0 -523
- data/ext/xkcp/lib/low/KeccakP-800/ARM/KeccakP-800-uf-armv7m-le-armcc.s +0 -550
- data/ext/xkcp/lib/low/KeccakP-800/ARM/KeccakP-800-uf-armv7m-le-gcc.s +0 -556
- data/ext/xkcp/lib/low/KeccakP-800/ARMv8A/KeccakP-800-SnP.h +0 -32
- data/ext/xkcp/lib/low/KeccakP-800/ARMv8A/KeccakP-800-armv8a-neon.s +0 -432
- data/ext/xkcp/lib/low/KeccakP-800/AVR8/KeccakP-800-SnP.h +0 -42
- data/ext/xkcp/lib/low/KeccakP-800/AVR8/KeccakP-800-avr8-fast.s +0 -929
- data/ext/xkcp/lib/low/KeccakP-800/compact/KeccakP-800-SnP.h +0 -40
- data/ext/xkcp/lib/low/KeccakP-800/compact/KeccakP-800-compact.c +0 -244
- data/ext/xkcp/lib/low/KeccakP-800/plain/KeccakP-800-SnP.h +0 -46
- data/ext/xkcp/lib/low/KeccakP-800/plain/KeccakP-800-opt32-bis.macros +0 -184
- data/ext/xkcp/lib/low/KeccakP-800/plain/KeccakP-800-opt32.c +0 -454
- data/ext/xkcp/lib/low/KeccakP-800/plain/KeccakP-800-opt32.macros +0 -459
- data/ext/xkcp/lib/low/KeccakP-800/plain/KeccakP-800-unrolling-bis.macros +0 -83
- data/ext/xkcp/lib/low/KeccakP-800/plain/KeccakP-800-unrolling.macros +0 -88
- data/ext/xkcp/lib/low/KeccakP-800/plain/lcu2/KeccakP-800-opt32-config.h +0 -7
- data/ext/xkcp/lib/low/KeccakP-800/plain/lcua/KeccakP-800-opt32-config.h +0 -7
- data/ext/xkcp/lib/low/KeccakP-800/plain/u2/KeccakP-800-opt32-config.h +0 -7
- data/ext/xkcp/lib/low/KeccakP-800/plain/ua/KeccakP-800-opt32-config.h +0 -7
- data/ext/xkcp/lib/low/KeccakP-800/ref/KeccakP-800-SnP.h +0 -44
- data/ext/xkcp/lib/low/KeccakP-800/ref/KeccakP-800-reference.c +0 -437
- data/ext/xkcp/lib/low/KeccakP-800/ref/KeccakP-800-reference.h +0 -23
- data/ext/xkcp/lib/low/Ketje/OptimizedAsmARM/Ket.h +0 -57
- data/ext/xkcp/lib/low/Ketje/OptimizedAsmARM/KetjeJr-armv7m-le-armcc.s +0 -475
- data/ext/xkcp/lib/low/Ketje/OptimizedAsmARM/KetjeJr-armv7m-le-gcc.s +0 -480
- data/ext/xkcp/lib/low/Ketje/OptimizedAsmARM/KetjeSr-armv7m-le-armcc.s +0 -590
- data/ext/xkcp/lib/low/Ketje/OptimizedAsmARM/KetjeSr-armv7m-le-gcc.s +0 -590
- data/ext/xkcp/lib/low/Ketje/OptimizedLE/Ket.c +0 -126
- data/ext/xkcp/lib/low/Ketje/OptimizedLE/Ket.h +0 -68
- data/ext/xkcp/lib/low/Ketje/OptimizedLE/Ket.inc +0 -174
- data/ext/xkcp/lib/low/Ketje/SnP-compliant/Ket.c +0 -80
- data/ext/xkcp/lib/low/Ketje/SnP-compliant/Ket.h +0 -68
- data/ext/xkcp/lib/low/Ketje/SnP-compliant/Ket.inc +0 -142
- data/ext/xkcp/lib/low/Xoodoo/ARM/Xoodoo-SnP.h +0 -55
- data/ext/xkcp/lib/low/Xoodoo/ARM/Xoodoo-u1-armv6m-le-armcc.s +0 -1086
- data/ext/xkcp/lib/low/Xoodoo/ARM/Xoodoo-u1-armv6m-le-gcc.s +0 -1092
- data/ext/xkcp/lib/low/Xoodoo/ARM/Xoodoo-uf-armv6-le-armcc.s +0 -721
- data/ext/xkcp/lib/low/Xoodoo/ARM/Xoodoo-uf-armv6-le-gcc.s +0 -726
- data/ext/xkcp/lib/low/Xoodoo/ARM/Xoodoo-uf-armv7m-le-armcc.s +0 -723
- data/ext/xkcp/lib/low/Xoodoo/ARM/Xoodoo-uf-armv7m-le-gcc.s +0 -729
- data/ext/xkcp/lib/low/Xoodoo/ARM/Xoodyak-u1-armv6m-le-armcc.s +0 -1164
- data/ext/xkcp/lib/low/Xoodoo/ARM/Xoodyak-u1-armv6m-le-gcc.s +0 -1165
- data/ext/xkcp/lib/low/Xoodoo/ARM/Xoodyak-uf-armv6-le-armcc.s +0 -562
- data/ext/xkcp/lib/low/Xoodoo/ARM/Xoodyak-uf-armv6-le-gcc.s +0 -563
- data/ext/xkcp/lib/low/Xoodoo/ARM/Xoodyak-uf-armv7m-le-armcc.s +0 -563
- data/ext/xkcp/lib/low/Xoodoo/ARM/Xoodyak-uf-armv7m-le-gcc.s +0 -565
- data/ext/xkcp/lib/low/Xoodoo/ARMv7A-NEON/Xoodoo-SnP.h +0 -55
- data/ext/xkcp/lib/low/Xoodoo/ARMv7A-NEON/Xoodoo-uf-armv7a-neon-le-armcc.s +0 -476
- data/ext/xkcp/lib/low/Xoodoo/ARMv7A-NEON/Xoodoo-uf-armv7a-neon-le-gcc.s +0 -485
- data/ext/xkcp/lib/low/Xoodoo/ARMv7A-NEON/Xoodyak-uf-armv7a-neon-le-armcc.s +0 -362
- data/ext/xkcp/lib/low/Xoodoo/ARMv7A-NEON/Xoodyak-uf-armv7a-neon-le-gcc.s +0 -367
- data/ext/xkcp/lib/low/Xoodoo/AVR8/Xoodoo-SnP.h +0 -43
- data/ext/xkcp/lib/low/Xoodoo/AVR8/Xoodoo-avr8-u1.s +0 -1341
- data/ext/xkcp/lib/low/Xoodoo/AVX512/Xoodoo-SIMD512.c +0 -581
- data/ext/xkcp/lib/low/Xoodoo/AVX512/Xoodoo-SnP.h +0 -58
- data/ext/xkcp/lib/low/Xoodoo/AVX512/Xoodyak-full-block-SIMD512.c +0 -332
- data/ext/xkcp/lib/low/Xoodoo/SSE2/Xoodoo-SIMD128.c +0 -329
- data/ext/xkcp/lib/low/Xoodoo/SSE2/Xoodoo-SnP.h +0 -53
- data/ext/xkcp/lib/low/Xoodoo/SSE2/Xoodyak-full-block-SIMD128.c +0 -355
- data/ext/xkcp/lib/low/Xoodoo/Xoodoo.h +0 -79
- data/ext/xkcp/lib/low/Xoodoo/plain/Xoodoo-SnP.h +0 -56
- data/ext/xkcp/lib/low/Xoodoo/plain/Xoodoo-optimized.c +0 -399
- data/ext/xkcp/lib/low/Xoodoo/plain/Xoodyak-full-blocks.c +0 -127
- data/ext/xkcp/lib/low/Xoodoo/ref/Xoodoo-SnP.h +0 -43
- data/ext/xkcp/lib/low/Xoodoo/ref/Xoodoo-reference.c +0 -253
- data/ext/xkcp/lib/low/Xoodoo-times16/AVX512/Xoodoo-times16-SIMD512.c +0 -1044
- data/ext/xkcp/lib/low/Xoodoo-times16/AVX512/Xoodoo-times16-SnP.h +0 -49
- data/ext/xkcp/lib/low/Xoodoo-times16/fallback-on1/Xoodoo-times16-SnP.h +0 -45
- data/ext/xkcp/lib/low/Xoodoo-times16/fallback-on1/Xoodoo-times16-on1.c +0 -37
- data/ext/xkcp/lib/low/Xoodoo-times4/ARMv7A-NEON/Xoodoo-times4-ARMv7A.s +0 -1587
- data/ext/xkcp/lib/low/Xoodoo-times4/ARMv7A-NEON/Xoodoo-times4-SnP.h +0 -48
- data/ext/xkcp/lib/low/Xoodoo-times4/AVX512/Xoodoo-times4-SIMD512.c +0 -1202
- data/ext/xkcp/lib/low/Xoodoo-times4/AVX512/Xoodoo-times4-SnP.h +0 -48
- data/ext/xkcp/lib/low/Xoodoo-times4/SSSE3/Xoodoo-times4-SIMD128.c +0 -484
- data/ext/xkcp/lib/low/Xoodoo-times4/SSSE3/Xoodoo-times4-SnP.h +0 -44
- data/ext/xkcp/lib/low/Xoodoo-times4/fallback-on1/Xoodoo-times4-SnP.h +0 -45
- data/ext/xkcp/lib/low/Xoodoo-times4/fallback-on1/Xoodoo-times4-on1.c +0 -37
- data/ext/xkcp/lib/low/Xoodoo-times8/AVX2/Xoodoo-times8-SIMD256.c +0 -939
- data/ext/xkcp/lib/low/Xoodoo-times8/AVX2/Xoodoo-times8-SnP.h +0 -49
- data/ext/xkcp/lib/low/Xoodoo-times8/AVX512/Xoodoo-times8-SIMD512.c +0 -1216
- data/ext/xkcp/lib/low/Xoodoo-times8/AVX512/Xoodoo-times8-SnP.h +0 -48
- data/ext/xkcp/lib/low/Xoodoo-times8/fallback-on1/Xoodoo-times8-SnP.h +0 -45
- data/ext/xkcp/lib/low/Xoodoo-times8/fallback-on1/Xoodoo-times8-on1.c +0 -37
- data/ext/xkcp/lib/low/common/PlSnP-Fallback.inc +0 -290
- data/ext/xkcp/lib/low/common/SnP-Relaned.h +0 -141
- data/ext/xkcp/support/Kernel-PMU/Kernel-pmu.md +0 -133
- data/ext/xkcp/support/Kernel-PMU/Makefile +0 -8
- data/ext/xkcp/support/Kernel-PMU/enable_arm_pmu.c +0 -129
- data/ext/xkcp/support/Kernel-PMU/load-module +0 -1
- data/ext/xkcp/util/KeccakSum/KeccakSum.c +0 -394
- data/ext/xkcp/util/KeccakSum/base64.c +0 -86
- data/ext/xkcp/util/KeccakSum/base64.h +0 -12
@@ -1,48 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
The eXtended Keccak Code Package (XKCP)
|
3
|
-
https://github.com/XKCP/XKCP
|
4
|
-
|
5
|
-
The Xoodoo permutation, designed by Joan Daemen, Seth Hoffert, Gilles Van Assche and Ronny Van Keer.
|
6
|
-
|
7
|
-
Implementation by Ronny Van Keer, hereby denoted as "the implementer".
|
8
|
-
|
9
|
-
For more information, feedback or questions, please refer to the Keccak Team website:
|
10
|
-
https://keccak.team/
|
11
|
-
|
12
|
-
To the extent possible under law, the implementer has waived all copyright
|
13
|
-
and related or neighboring rights to the source code in this file.
|
14
|
-
http://creativecommons.org/publicdomain/zero/1.0/
|
15
|
-
*/
|
16
|
-
|
17
|
-
#ifndef _Xoodoo_times4_SnP_h_
|
18
|
-
#define _Xoodoo_times4_SnP_h_
|
19
|
-
|
20
|
-
/** For the documentation, see PlSnP-documentation.h.
|
21
|
-
*/
|
22
|
-
|
23
|
-
#define Xoodootimes4_implementation "512-bit SIMD (AVX-512) implementation"
|
24
|
-
#define Xoodootimes4_statesSizeInBytes (4*3*4*4)
|
25
|
-
#define Xoodootimes4_statesAlignment 64
|
26
|
-
|
27
|
-
#define Xoodootimes4_StaticInitialize()
|
28
|
-
void Xoodootimes4_InitializeAll(void *states);
|
29
|
-
#define Xoodootimes4_AddByte(states, instanceIndex, byte, offset) \
|
30
|
-
((unsigned char*)(states))[(instanceIndex)*4 + ((offset)/4)*4*4 + (offset)%4] ^= (byte)
|
31
|
-
void Xoodootimes4_AddBytes(void *states, unsigned int instanceIndex, const unsigned char *data, unsigned int offset, unsigned int length);
|
32
|
-
void Xoodootimes4_AddLanesAll(void *states, const unsigned char *data, unsigned int laneCount, unsigned int laneOffset);
|
33
|
-
void Xoodootimes4_OverwriteBytes(void *states, unsigned int instanceIndex, const unsigned char *data, unsigned int offset, unsigned int length);
|
34
|
-
void Xoodootimes4_OverwriteLanesAll(void *states, const unsigned char *data, unsigned int laneCount, unsigned int laneOffset);
|
35
|
-
void Xoodootimes4_OverwriteWithZeroes(void *states, unsigned int instanceIndex, unsigned int byteCount);
|
36
|
-
void Xoodootimes4_PermuteAll_6rounds(void *states);
|
37
|
-
void Xoodootimes4_PermuteAll_12rounds(void *states);
|
38
|
-
void Xoodootimes4_ExtractBytes(const void *states, unsigned int instanceIndex, unsigned char *data, unsigned int offset, unsigned int length);
|
39
|
-
void Xoodootimes4_ExtractLanesAll(const void *states, unsigned char *data, unsigned int laneCount, unsigned int laneOffset);
|
40
|
-
void Xoodootimes4_ExtractAndAddBytes(const void *states, unsigned int instanceIndex, const unsigned char *input, unsigned char *output, unsigned int offset, unsigned int length);
|
41
|
-
void Xoodootimes4_ExtractAndAddLanesAll(const void *states, const unsigned char *input, unsigned char *output, unsigned int laneCount, unsigned int laneOffset);
|
42
|
-
|
43
|
-
#define Xoodootimes4_FastXoofff_supported
|
44
|
-
void Xooffftimes4_AddIs(unsigned char *output, const unsigned char *input, size_t bitLen);
|
45
|
-
size_t Xooffftimes4_CompressFastLoop(unsigned char *k, unsigned char *x, const unsigned char *input, size_t length);
|
46
|
-
size_t Xooffftimes4_ExpandFastLoop(unsigned char *yAccu, const unsigned char *kRoll, unsigned char *output, size_t length);
|
47
|
-
|
48
|
-
#endif
|
@@ -1,484 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
The eXtended Keccak Code Package (XKCP)
|
3
|
-
https://github.com/XKCP/XKCP
|
4
|
-
|
5
|
-
The Xoodoo permutation, designed by Joan Daemen, Seth Hoffert, Gilles Van Assche and Ronny Van Keer.
|
6
|
-
|
7
|
-
Implementation by Ronny Van Keer, hereby denoted as "the implementer".
|
8
|
-
|
9
|
-
For more information, feedback or questions, please refer to the Keccak Team website:
|
10
|
-
https://keccak.team/
|
11
|
-
|
12
|
-
To the extent possible under law, the implementer has waived all copyright
|
13
|
-
and related or neighboring rights to the source code in this file.
|
14
|
-
http://creativecommons.org/publicdomain/zero/1.0/
|
15
|
-
*/
|
16
|
-
|
17
|
-
#include <stdio.h>
|
18
|
-
#include <string.h>
|
19
|
-
#include <smmintrin.h>
|
20
|
-
#include <emmintrin.h>
|
21
|
-
#include "align.h"
|
22
|
-
#include "brg_endian.h"
|
23
|
-
#include "Xoodoo.h"
|
24
|
-
#include "Xoodoo-times4-SnP.h"
|
25
|
-
|
26
|
-
#if (PLATFORM_BYTE_ORDER != IS_LITTLE_ENDIAN)
|
27
|
-
#error Expecting a little-endian platform
|
28
|
-
#endif
|
29
|
-
|
30
|
-
#define VERBOSE 0
|
31
|
-
|
32
|
-
typedef __m128i V128;
|
33
|
-
|
34
|
-
#define SnP_laneLengthInBytes 4
|
35
|
-
#define laneIndex(instanceIndex, lanePosition) ((lanePosition)*4 + instanceIndex)
|
36
|
-
|
37
|
-
#define ANDnu128(a, b) _mm_andnot_si128(a, b)
|
38
|
-
#define LOAD128(a) _mm_load_si128((const V128 *)&(a))
|
39
|
-
#define LOAD4_32(a,b,c,d) _mm_setr_epi32(a,b,c,d)
|
40
|
-
#if defined(Waffel_useXOP)
|
41
|
-
#define ROL32in128(a, o) _mm_roti_epi32(a, o)
|
42
|
-
// #define ROL32in128_8(a) ROL32in128(a, 8)
|
43
|
-
#else
|
44
|
-
#define ROL32in128(a, o) _mm_or_si128(_mm_slli_epi32(a, o), _mm_srli_epi32(a, 32-(o)))
|
45
|
-
// #define ROL32in128_8(a) _mm_shuffle_epi8(a, CONST128(rho8))
|
46
|
-
//static const uint64_t rho8[2] = {0x0605040302010007, 0x0E0D0C0B0A09080F};
|
47
|
-
#endif
|
48
|
-
#define STORE128(a, b) _mm_store_si128((V128 *)&(a), b)
|
49
|
-
#define STORE4_32(r, a, b, c, d) a = _mm_extract_epi32(r, 0), b = _mm_extract_epi32(r, 1), c = _mm_extract_epi32(r, 2), d = _mm_extract_epi32(r, 3)
|
50
|
-
#define XOR128(a, b) _mm_xor_si128(a, b)
|
51
|
-
#define XOReq128(a, b) a = XOR128(a, b)
|
52
|
-
|
53
|
-
#if (VERBOSE > 0)
|
54
|
-
#define Dump(__t) printf(__t "\n"); \
|
55
|
-
Vars2State; \
|
56
|
-
printf("a00 %08x, a01 %08x, a02 %08x, a03 %08x\n", states[4*(0+0)], states[4*(0+1)], states[4*(0+2)], states[4*(0+3)] ); \
|
57
|
-
printf("a10 %08x, a11 %08x, a12 %08x, a13 %08x\n", states[4*(4+0)], states[4*(4+1)], states[4*(4+2)], states[4*(4+3)] ); \
|
58
|
-
printf("a20 %08x, a21 %08x, a22 %08x, a23 %08x\n\n", states[4*(8+0)], states[4*(8+1)], states[4*(8+2)], states[4*(8+3)] );
|
59
|
-
#else
|
60
|
-
#define Dump(__t)
|
61
|
-
#endif
|
62
|
-
|
63
|
-
#if (VERBOSE >= 1)
|
64
|
-
#define Dump1(__t) Dump(__t)
|
65
|
-
#else
|
66
|
-
#define Dump1(__t)
|
67
|
-
#endif
|
68
|
-
|
69
|
-
#if (VERBOSE >= 2)
|
70
|
-
#define Dump2(__t) Dump(__t)
|
71
|
-
#else
|
72
|
-
#define Dump2(__t)
|
73
|
-
#endif
|
74
|
-
|
75
|
-
#if (VERBOSE >= 3)
|
76
|
-
#define Dump3(__t) Dump(__t)
|
77
|
-
#else
|
78
|
-
#define Dump3(__t)
|
79
|
-
#endif
|
80
|
-
|
81
|
-
void Xoodootimes4_InitializeAll(void *states)
|
82
|
-
{
|
83
|
-
memset(states, 0, Xoodootimes4_statesSizeInBytes);
|
84
|
-
}
|
85
|
-
|
86
|
-
void Xoodootimes4_AddBytes(void *states, unsigned int instanceIndex, const unsigned char *data, unsigned int offset, unsigned int length)
|
87
|
-
{
|
88
|
-
unsigned int sizeLeft = length;
|
89
|
-
unsigned int lanePosition = offset/SnP_laneLengthInBytes;
|
90
|
-
unsigned int offsetInLane = offset%SnP_laneLengthInBytes;
|
91
|
-
const unsigned char *curData = data;
|
92
|
-
uint32_t *statesAsLanes = (uint32_t *)states;
|
93
|
-
|
94
|
-
if ((sizeLeft > 0) && (offsetInLane != 0)) {
|
95
|
-
unsigned int bytesInLane = SnP_laneLengthInBytes - offsetInLane;
|
96
|
-
uint32_t lane = 0;
|
97
|
-
if (bytesInLane > sizeLeft)
|
98
|
-
bytesInLane = sizeLeft;
|
99
|
-
memcpy((unsigned char*)&lane + offsetInLane, curData, bytesInLane);
|
100
|
-
statesAsLanes[laneIndex(instanceIndex, lanePosition)] ^= lane;
|
101
|
-
sizeLeft -= bytesInLane;
|
102
|
-
lanePosition++;
|
103
|
-
curData += bytesInLane;
|
104
|
-
}
|
105
|
-
|
106
|
-
while(sizeLeft >= SnP_laneLengthInBytes) {
|
107
|
-
uint32_t lane = *((const uint32_t*)curData);
|
108
|
-
statesAsLanes[laneIndex(instanceIndex, lanePosition)] ^= lane;
|
109
|
-
sizeLeft -= SnP_laneLengthInBytes;
|
110
|
-
lanePosition++;
|
111
|
-
curData += SnP_laneLengthInBytes;
|
112
|
-
}
|
113
|
-
|
114
|
-
if (sizeLeft > 0) {
|
115
|
-
uint32_t lane = 0;
|
116
|
-
memcpy(&lane, curData, sizeLeft);
|
117
|
-
statesAsLanes[laneIndex(instanceIndex, lanePosition)] ^= lane;
|
118
|
-
}
|
119
|
-
}
|
120
|
-
|
121
|
-
void Xoodootimes4_AddLanesAll(void *states, const unsigned char *data, unsigned int laneCount, unsigned int laneOffset)
|
122
|
-
{
|
123
|
-
V128 *stateAsLanes = (V128 *)states;
|
124
|
-
unsigned int i;
|
125
|
-
const uint32_t *curData0 = (const uint32_t *)(data+0*laneOffset*SnP_laneLengthInBytes);
|
126
|
-
const uint32_t *curData1 = (const uint32_t *)(data+1*laneOffset*SnP_laneLengthInBytes);
|
127
|
-
const uint32_t *curData2 = (const uint32_t *)(data+2*laneOffset*SnP_laneLengthInBytes);
|
128
|
-
const uint32_t *curData3 = (const uint32_t *)(data+3*laneOffset*SnP_laneLengthInBytes);
|
129
|
-
#define XOR_In( argIndex ) XOReq128( stateAsLanes[argIndex], LOAD4_32(curData0[argIndex], curData1[argIndex], curData2[argIndex], curData3[argIndex]))
|
130
|
-
if ( laneCount == 12 ) {
|
131
|
-
XOR_In( 0 );
|
132
|
-
XOR_In( 1 );
|
133
|
-
XOR_In( 2 );
|
134
|
-
XOR_In( 3 );
|
135
|
-
XOR_In( 4 );
|
136
|
-
XOR_In( 5 );
|
137
|
-
XOR_In( 6 );
|
138
|
-
XOR_In( 7 );
|
139
|
-
XOR_In( 8 );
|
140
|
-
XOR_In( 9 );
|
141
|
-
XOR_In( 10 );
|
142
|
-
XOR_In( 11 );
|
143
|
-
}
|
144
|
-
else {
|
145
|
-
for(i=0; i<laneCount; i++)
|
146
|
-
XOR_In( i );
|
147
|
-
}
|
148
|
-
#undef XOR_In
|
149
|
-
}
|
150
|
-
|
151
|
-
void Xoodootimes4_OverwriteBytes(void *states, unsigned int instanceIndex, const unsigned char *data, unsigned int offset, unsigned int length)
|
152
|
-
{
|
153
|
-
unsigned int sizeLeft = length;
|
154
|
-
unsigned int lanePosition = offset/SnP_laneLengthInBytes;
|
155
|
-
unsigned int offsetInLane = offset%SnP_laneLengthInBytes;
|
156
|
-
const unsigned char *curData = data;
|
157
|
-
uint32_t *statesAsLanes = (uint32_t *)states;
|
158
|
-
|
159
|
-
if ((sizeLeft > 0) && (offsetInLane != 0)) {
|
160
|
-
unsigned int bytesInLane = SnP_laneLengthInBytes - offsetInLane;
|
161
|
-
if (bytesInLane > sizeLeft)
|
162
|
-
bytesInLane = sizeLeft;
|
163
|
-
memcpy( ((unsigned char *)&statesAsLanes[laneIndex(instanceIndex, lanePosition)]) + offsetInLane, curData, bytesInLane);
|
164
|
-
sizeLeft -= bytesInLane;
|
165
|
-
lanePosition++;
|
166
|
-
curData += bytesInLane;
|
167
|
-
}
|
168
|
-
|
169
|
-
while(sizeLeft >= SnP_laneLengthInBytes) {
|
170
|
-
uint32_t lane = *((const uint32_t*)curData);
|
171
|
-
statesAsLanes[laneIndex(instanceIndex, lanePosition)] = lane;
|
172
|
-
sizeLeft -= SnP_laneLengthInBytes;
|
173
|
-
lanePosition++;
|
174
|
-
curData += SnP_laneLengthInBytes;
|
175
|
-
}
|
176
|
-
|
177
|
-
if (sizeLeft > 0) {
|
178
|
-
memcpy(&statesAsLanes[laneIndex(instanceIndex, lanePosition)], curData, sizeLeft);
|
179
|
-
}
|
180
|
-
}
|
181
|
-
|
182
|
-
void Xoodootimes4_OverwriteLanesAll(void *states, const unsigned char *data, unsigned int laneCount, unsigned int laneOffset)
|
183
|
-
{
|
184
|
-
V128 *stateAsLanes = (V128 *)states;
|
185
|
-
unsigned int i;
|
186
|
-
const uint32_t *curData0 = (const uint32_t *)(data+0*laneOffset*SnP_laneLengthInBytes);
|
187
|
-
const uint32_t *curData1 = (const uint32_t *)(data+1*laneOffset*SnP_laneLengthInBytes);
|
188
|
-
const uint32_t *curData2 = (const uint32_t *)(data+2*laneOffset*SnP_laneLengthInBytes);
|
189
|
-
const uint32_t *curData3 = (const uint32_t *)(data+3*laneOffset*SnP_laneLengthInBytes);
|
190
|
-
#define OverWr( argIndex ) STORE128(stateAsLanes[argIndex], LOAD4_32(curData0[argIndex], curData1[argIndex], curData2[argIndex], curData3[argIndex]))
|
191
|
-
if ( laneCount == 12 ) {
|
192
|
-
OverWr( 0 );
|
193
|
-
OverWr( 1 );
|
194
|
-
OverWr( 2 );
|
195
|
-
OverWr( 3 );
|
196
|
-
OverWr( 4 );
|
197
|
-
OverWr( 5 );
|
198
|
-
OverWr( 6 );
|
199
|
-
OverWr( 7 );
|
200
|
-
OverWr( 8 );
|
201
|
-
OverWr( 9 );
|
202
|
-
OverWr( 10 );
|
203
|
-
OverWr( 11 );
|
204
|
-
}
|
205
|
-
else {
|
206
|
-
for(i=0; i<laneCount; i++)
|
207
|
-
OverWr( i );
|
208
|
-
}
|
209
|
-
#undef OverWr
|
210
|
-
}
|
211
|
-
|
212
|
-
void Xoodootimes4_OverwriteWithZeroes(void *states, unsigned int instanceIndex, unsigned int byteCount)
|
213
|
-
{
|
214
|
-
unsigned int sizeLeft = byteCount;
|
215
|
-
unsigned int lanePosition = 0;
|
216
|
-
uint32_t *statesAsLanes = (uint32_t *)states;
|
217
|
-
|
218
|
-
while(sizeLeft >= SnP_laneLengthInBytes) {
|
219
|
-
statesAsLanes[laneIndex(instanceIndex, lanePosition)] = 0;
|
220
|
-
sizeLeft -= SnP_laneLengthInBytes;
|
221
|
-
lanePosition++;
|
222
|
-
}
|
223
|
-
if (sizeLeft > 0) {
|
224
|
-
memset(&statesAsLanes[laneIndex(instanceIndex, lanePosition)], 0, sizeLeft);
|
225
|
-
}
|
226
|
-
}
|
227
|
-
|
228
|
-
void Xoodootimes4_ExtractBytes(const void *states, unsigned int instanceIndex, unsigned char *data, unsigned int offset, unsigned int length)
|
229
|
-
{
|
230
|
-
unsigned int sizeLeft = length;
|
231
|
-
unsigned int lanePosition = offset/SnP_laneLengthInBytes;
|
232
|
-
unsigned int offsetInLane = offset%SnP_laneLengthInBytes;
|
233
|
-
unsigned char *curData = data;
|
234
|
-
const uint32_t *statesAsLanes = (const uint32_t *)states;
|
235
|
-
|
236
|
-
if ((sizeLeft > 0) && (offsetInLane != 0)) {
|
237
|
-
unsigned int bytesInLane = SnP_laneLengthInBytes - offsetInLane;
|
238
|
-
if (bytesInLane > sizeLeft)
|
239
|
-
bytesInLane = sizeLeft;
|
240
|
-
memcpy( curData, ((unsigned char *)&statesAsLanes[laneIndex(instanceIndex, lanePosition)]) + offsetInLane, bytesInLane);
|
241
|
-
sizeLeft -= bytesInLane;
|
242
|
-
lanePosition++;
|
243
|
-
curData += bytesInLane;
|
244
|
-
}
|
245
|
-
|
246
|
-
while(sizeLeft >= SnP_laneLengthInBytes) {
|
247
|
-
*(uint32_t*)curData = statesAsLanes[laneIndex(instanceIndex, lanePosition)];
|
248
|
-
sizeLeft -= SnP_laneLengthInBytes;
|
249
|
-
lanePosition++;
|
250
|
-
curData += SnP_laneLengthInBytes;
|
251
|
-
}
|
252
|
-
|
253
|
-
if (sizeLeft > 0) {
|
254
|
-
memcpy( curData, &statesAsLanes[laneIndex(instanceIndex, lanePosition)], sizeLeft);
|
255
|
-
}
|
256
|
-
}
|
257
|
-
|
258
|
-
void Xoodootimes4_ExtractLanesAll(const void *states, unsigned char *data, unsigned int laneCount, unsigned int laneOffset)
|
259
|
-
{
|
260
|
-
const V128 *stateAsLanes = (const V128 *)states;
|
261
|
-
V128 lanes;
|
262
|
-
unsigned int i;
|
263
|
-
uint32_t *curData0 = (uint32_t *)(data+0*laneOffset*SnP_laneLengthInBytes);
|
264
|
-
uint32_t *curData1 = (uint32_t *)(data+1*laneOffset*SnP_laneLengthInBytes);
|
265
|
-
uint32_t *curData2 = (uint32_t *)(data+2*laneOffset*SnP_laneLengthInBytes);
|
266
|
-
uint32_t *curData3 = (uint32_t *)(data+3*laneOffset*SnP_laneLengthInBytes);
|
267
|
-
|
268
|
-
#define Extr( argIndex ) lanes = LOAD128( stateAsLanes[argIndex] ), \
|
269
|
-
STORE4_32(lanes, curData0[argIndex], curData1[argIndex], curData2[argIndex], curData3[argIndex])
|
270
|
-
|
271
|
-
if ( laneCount == 12 ) {
|
272
|
-
Extr( 0 );
|
273
|
-
Extr( 1 );
|
274
|
-
Extr( 2 );
|
275
|
-
Extr( 3 );
|
276
|
-
Extr( 4 );
|
277
|
-
Extr( 5 );
|
278
|
-
Extr( 6 );
|
279
|
-
Extr( 7 );
|
280
|
-
Extr( 8 );
|
281
|
-
Extr( 9 );
|
282
|
-
Extr( 10 );
|
283
|
-
Extr( 11 );
|
284
|
-
}
|
285
|
-
else {
|
286
|
-
for(i=0; i<laneCount; i++)
|
287
|
-
Extr( i );
|
288
|
-
}
|
289
|
-
#undef Extr
|
290
|
-
}
|
291
|
-
|
292
|
-
void Xoodootimes4_ExtractAndAddBytes(const void *states, unsigned int instanceIndex, const unsigned char *input, unsigned char *output, unsigned int offset, unsigned int length)
|
293
|
-
{
|
294
|
-
unsigned int sizeLeft = length;
|
295
|
-
unsigned int lanePosition = offset/SnP_laneLengthInBytes;
|
296
|
-
unsigned int offsetInLane = offset%SnP_laneLengthInBytes;
|
297
|
-
const unsigned char *curInput = input;
|
298
|
-
unsigned char *curOutput = output;
|
299
|
-
const uint32_t *statesAsLanes = (const uint32_t *)states;
|
300
|
-
|
301
|
-
if ((sizeLeft > 0) && (offsetInLane != 0)) {
|
302
|
-
unsigned int bytesInLane = SnP_laneLengthInBytes - offsetInLane;
|
303
|
-
uint32_t lane = statesAsLanes[laneIndex(instanceIndex, lanePosition)] >> (8 * offsetInLane);
|
304
|
-
if (bytesInLane > sizeLeft)
|
305
|
-
bytesInLane = sizeLeft;
|
306
|
-
sizeLeft -= bytesInLane;
|
307
|
-
do {
|
308
|
-
*(curOutput++) = *(curInput++) ^ (unsigned char)lane;
|
309
|
-
lane >>= 8;
|
310
|
-
} while ( --bytesInLane != 0);
|
311
|
-
lanePosition++;
|
312
|
-
}
|
313
|
-
|
314
|
-
while(sizeLeft >= SnP_laneLengthInBytes) {
|
315
|
-
*((uint32_t*)curOutput) = *((uint32_t*)curInput) ^ statesAsLanes[laneIndex(instanceIndex, lanePosition)];
|
316
|
-
sizeLeft -= SnP_laneLengthInBytes;
|
317
|
-
lanePosition++;
|
318
|
-
curInput += SnP_laneLengthInBytes;
|
319
|
-
curOutput += SnP_laneLengthInBytes;
|
320
|
-
}
|
321
|
-
|
322
|
-
if (sizeLeft != 0) {
|
323
|
-
uint32_t lane = statesAsLanes[laneIndex(instanceIndex, lanePosition)];
|
324
|
-
do {
|
325
|
-
*(curOutput++) = *(curInput++) ^ (unsigned char)lane;
|
326
|
-
lane >>= 8;
|
327
|
-
} while ( --sizeLeft != 0);
|
328
|
-
}
|
329
|
-
}
|
330
|
-
|
331
|
-
void Xoodootimes4_ExtractAndAddLanesAll(const void *states, const unsigned char *input, unsigned char *output, unsigned int laneCount, unsigned int laneOffset)
|
332
|
-
{
|
333
|
-
const uint32_t *stateAsLanes = (const uint32_t *)states;
|
334
|
-
unsigned int i;
|
335
|
-
const uint32_t *curInput0 = (const uint32_t *)(input+0*laneOffset*SnP_laneLengthInBytes);
|
336
|
-
const uint32_t *curInput1 = (const uint32_t *)(input+1*laneOffset*SnP_laneLengthInBytes);
|
337
|
-
const uint32_t *curInput2 = (const uint32_t *)(input+2*laneOffset*SnP_laneLengthInBytes);
|
338
|
-
const uint32_t *curInput3 = (const uint32_t *)(input+3*laneOffset*SnP_laneLengthInBytes);
|
339
|
-
uint32_t *curOutput0 = (uint32_t *)(output+0*laneOffset*SnP_laneLengthInBytes);
|
340
|
-
uint32_t *curOutput1 = (uint32_t *)(output+1*laneOffset*SnP_laneLengthInBytes);
|
341
|
-
uint32_t *curOutput2 = (uint32_t *)(output+2*laneOffset*SnP_laneLengthInBytes);
|
342
|
-
uint32_t *curOutput3 = (uint32_t *)(output+3*laneOffset*SnP_laneLengthInBytes);
|
343
|
-
|
344
|
-
#define ExtrXOR( argIndex ) curOutput0[argIndex] = curInput0[argIndex] ^ stateAsLanes[4*(argIndex)+0], curOutput1[argIndex] = curInput1[argIndex] ^ stateAsLanes[4*(argIndex)+1], \
|
345
|
-
curOutput2[argIndex] = curInput2[argIndex] ^ stateAsLanes[4*(argIndex)+2], curOutput3[argIndex] = curInput3[argIndex] ^ stateAsLanes[4*(argIndex)+3]
|
346
|
-
|
347
|
-
if ( laneCount == 12 ) {
|
348
|
-
ExtrXOR( 0 );
|
349
|
-
ExtrXOR( 1 );
|
350
|
-
ExtrXOR( 2 );
|
351
|
-
ExtrXOR( 3 );
|
352
|
-
ExtrXOR( 4 );
|
353
|
-
ExtrXOR( 5 );
|
354
|
-
ExtrXOR( 6 );
|
355
|
-
ExtrXOR( 7 );
|
356
|
-
ExtrXOR( 8 );
|
357
|
-
ExtrXOR( 9 );
|
358
|
-
ExtrXOR( 10 );
|
359
|
-
ExtrXOR( 11 );
|
360
|
-
}
|
361
|
-
else {
|
362
|
-
for(i=0; i<laneCount; i++)
|
363
|
-
ExtrXOR( i );
|
364
|
-
}
|
365
|
-
#undef ExtrXOR
|
366
|
-
}
|
367
|
-
|
368
|
-
#define DeclareVars V128 a00, a01, a02, a03; \
|
369
|
-
V128 a10, a11, a12, a13; \
|
370
|
-
V128 a20, a21, a22, a23; \
|
371
|
-
V128 v1, v2
|
372
|
-
|
373
|
-
#define State2Vars a00 = LOAD128(states[4*(0+0)]), a01 = LOAD128(states[4*(0+1)]), a02 = LOAD128(states[4*(0+2)]), a03 = LOAD128(states[4*(0+3)]); \
|
374
|
-
a10 = LOAD128(states[4*(4+0)]), a11 = LOAD128(states[4*(4+1)]), a12 = LOAD128(states[4*(4+2)]), a13 = LOAD128(states[4*(4+3)]); \
|
375
|
-
a20 = LOAD128(states[4*(8+0)]), a21 = LOAD128(states[4*(8+1)]), a22 = LOAD128(states[4*(8+2)]), a23 = LOAD128(states[4*(8+3)])
|
376
|
-
|
377
|
-
#define State2Vars2 a00 = LOAD128(states[4*(0+0)]), a01 = LOAD128(states[4*(0+1)]), a02 = LOAD128(states[4*(0+2)]), a03 = LOAD128(states[4*(0+3)]); \
|
378
|
-
a12 = LOAD128(states[4*(4+0)]), a13 = LOAD128(states[4*(4+1)]), a10 = LOAD128(states[4*(4+2)]), a11 = LOAD128(states[4*(4+3)]); \
|
379
|
-
a20 = LOAD128(states[4*(8+0)]), a21 = LOAD128(states[4*(8+1)]), a22 = LOAD128(states[4*(8+2)]), a23 = LOAD128(states[4*(8+3)])
|
380
|
-
|
381
|
-
#define Vars2State STORE128(states[4*(0+0)], a00), STORE128(states[4*(0+1)], a01), STORE128(states[4*(0+2)], a02), STORE128(states[4*(0+3)], a03); \
|
382
|
-
STORE128(states[4*(4+0)], a10), STORE128(states[4*(4+1)], a11), STORE128(states[4*(4+2)], a12), STORE128(states[4*(4+3)], a13); \
|
383
|
-
STORE128(states[4*(8+0)], a20), STORE128(states[4*(8+1)], a21), STORE128(states[4*(8+2)], a22), STORE128(states[4*(8+3)], a23)
|
384
|
-
|
385
|
-
#define Round(a10i, a11i, a12i, a13i, a10w, a11w, a12w, a13w, a20i, a21i, a22i, a23i, __rc) \
|
386
|
-
\
|
387
|
-
/* Theta: Column Parity Mixer */ \
|
388
|
-
v1 = XOR128( a03, XOR128( a13i, a23i ) ); \
|
389
|
-
v2 = XOR128( a00, XOR128( a10i, a20i ) ); \
|
390
|
-
v1 = XOR128( ROL32in128(v1, 5), ROL32in128(v1, 14) ); \
|
391
|
-
a00 = XOR128( a00, v1 ); \
|
392
|
-
a10i = XOR128( a10i, v1 ); \
|
393
|
-
a20i = XOR128( a20i, v1 ); \
|
394
|
-
v1 = XOR128( a01, XOR128( a11i, a21i ) ); \
|
395
|
-
v2 = XOR128( ROL32in128(v2, 5), ROL32in128(v2, 14) ); \
|
396
|
-
a01 = XOR128( a01, v2 ); \
|
397
|
-
a11i = XOR128( a11i, v2 ); \
|
398
|
-
a21i = XOR128( a21i, v2 ); \
|
399
|
-
v2 = XOR128( a02, XOR128( a12i, a22i ) ); \
|
400
|
-
v1 = XOR128( ROL32in128(v1, 5), ROL32in128(v1, 14) ); \
|
401
|
-
a02 = XOR128( a02, v1 ); \
|
402
|
-
a12i = XOR128( a12i, v1 ); \
|
403
|
-
a22i = XOR128( a22i, v1 ); \
|
404
|
-
v2 = XOR128( ROL32in128(v2, 5), ROL32in128(v2, 14) ); \
|
405
|
-
a03 = XOR128( a03, v2 ); \
|
406
|
-
a13i = XOR128( a13i, v2 ); \
|
407
|
-
a23i = XOR128( a23i, v2 ); \
|
408
|
-
Dump3("Theta"); \
|
409
|
-
\
|
410
|
-
/* Rho-west: Plane shift */ \
|
411
|
-
a20i = ROL32in128(a20i, 11); \
|
412
|
-
a21i = ROL32in128(a21i, 11); \
|
413
|
-
a22i = ROL32in128(a22i, 11); \
|
414
|
-
a23i = ROL32in128(a23i, 11); \
|
415
|
-
Dump3("Rho-west"); \
|
416
|
-
\
|
417
|
-
/* Iota: round constants */ \
|
418
|
-
a00 = XOR128( a00, _mm_set1_epi32( __rc ) ); \
|
419
|
-
Dump3("Iota"); \
|
420
|
-
\
|
421
|
-
/* Chi: non linear step, on colums */ \
|
422
|
-
a00 = XOR128( a00, ANDnu128( a10w, a20i ) ); \
|
423
|
-
a01 = XOR128( a01, ANDnu128( a11w, a21i ) ); \
|
424
|
-
a02 = XOR128( a02, ANDnu128( a12w, a22i ) ); \
|
425
|
-
a03 = XOR128( a03, ANDnu128( a13w, a23i ) ); \
|
426
|
-
a10w = XOR128( a10w, ANDnu128( a20i, a00 ) ); \
|
427
|
-
a11w = XOR128( a11w, ANDnu128( a21i, a01 ) ); \
|
428
|
-
a12w = XOR128( a12w, ANDnu128( a22i, a02 ) ); \
|
429
|
-
a13w = XOR128( a13w, ANDnu128( a23i, a03 ) ); \
|
430
|
-
a20i = XOR128( a20i, ANDnu128( a00, a10w ) ); \
|
431
|
-
a21i = XOR128( a21i, ANDnu128( a01, a11w ) ); \
|
432
|
-
a22i = XOR128( a22i, ANDnu128( a02, a12w ) ); \
|
433
|
-
a23i = XOR128( a23i, ANDnu128( a03, a13w ) ); \
|
434
|
-
Dump3("Chi"); \
|
435
|
-
\
|
436
|
-
/* Rho-east: Plane shift */ \
|
437
|
-
a10w = ROL32in128(a10w, 1); \
|
438
|
-
a11w = ROL32in128(a11w, 1); \
|
439
|
-
a12w = ROL32in128(a12w, 1); \
|
440
|
-
a13w = ROL32in128(a13w, 1); \
|
441
|
-
/* todo!! optimization for ROTL multiple of 8 */ \
|
442
|
-
a20i = ROL32in128(a20i, 8); \
|
443
|
-
a21i = ROL32in128(a21i, 8); \
|
444
|
-
a22i = ROL32in128(a22i, 8); \
|
445
|
-
a23i = ROL32in128(a23i, 8); \
|
446
|
-
Dump3("Rho-east");
|
447
|
-
|
448
|
-
void Xoodootimes4_PermuteAll_6rounds(void *argStates)
|
449
|
-
{
|
450
|
-
uint32_t *states = (uint32_t*)argStates;
|
451
|
-
DeclareVars;
|
452
|
-
|
453
|
-
State2Vars2;
|
454
|
-
Round( a12, a13, a10, a11, a11, a12, a13, a10, a20, a21, a22, a23, _rc6 );
|
455
|
-
Round( a11, a12, a13, a10, a10, a11, a12, a13, a22, a23, a20, a21, _rc5 );
|
456
|
-
Round( a10, a11, a12, a13, a13, a10, a11, a12, a20, a21, a22, a23, _rc4 );
|
457
|
-
Round( a13, a10, a11, a12, a12, a13, a10, a11, a22, a23, a20, a21, _rc3 );
|
458
|
-
Round( a12, a13, a10, a11, a11, a12, a13, a10, a20, a21, a22, a23, _rc2 );
|
459
|
-
Round( a11, a12, a13, a10, a10, a11, a12, a13, a22, a23, a20, a21, _rc1 );
|
460
|
-
Dump1("Permutation\n");
|
461
|
-
Vars2State;
|
462
|
-
}
|
463
|
-
|
464
|
-
void Xoodootimes4_PermuteAll_12rounds(void *argStates)
|
465
|
-
{
|
466
|
-
uint32_t *states = (uint32_t*)argStates;
|
467
|
-
DeclareVars;
|
468
|
-
|
469
|
-
State2Vars;
|
470
|
-
Round( a10, a11, a12, a13, a13, a10, a11, a12, a20, a21, a22, a23, _rc12 );
|
471
|
-
Round( a13, a10, a11, a12, a12, a13, a10, a11, a22, a23, a20, a21, _rc11 );
|
472
|
-
Round( a12, a13, a10, a11, a11, a12, a13, a10, a20, a21, a22, a23, _rc10 );
|
473
|
-
Round( a11, a12, a13, a10, a10, a11, a12, a13, a22, a23, a20, a21, _rc9 );
|
474
|
-
Round( a10, a11, a12, a13, a13, a10, a11, a12, a20, a21, a22, a23, _rc8 );
|
475
|
-
Round( a13, a10, a11, a12, a12, a13, a10, a11, a22, a23, a20, a21, _rc7 );
|
476
|
-
Round( a12, a13, a10, a11, a11, a12, a13, a10, a20, a21, a22, a23, _rc6 );
|
477
|
-
Round( a11, a12, a13, a10, a10, a11, a12, a13, a22, a23, a20, a21, _rc5 );
|
478
|
-
Round( a10, a11, a12, a13, a13, a10, a11, a12, a20, a21, a22, a23, _rc4 );
|
479
|
-
Round( a13, a10, a11, a12, a12, a13, a10, a11, a22, a23, a20, a21, _rc3 );
|
480
|
-
Round( a12, a13, a10, a11, a11, a12, a13, a10, a20, a21, a22, a23, _rc2 );
|
481
|
-
Round( a11, a12, a13, a10, a10, a11, a12, a13, a22, a23, a20, a21, _rc1 );
|
482
|
-
Dump1("Permutation\n");
|
483
|
-
Vars2State;
|
484
|
-
}
|
@@ -1,44 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
The eXtended Keccak Code Package (XKCP)
|
3
|
-
https://github.com/XKCP/XKCP
|
4
|
-
|
5
|
-
The Xoodoo permutation, designed by Joan Daemen, Seth Hoffert, Gilles Van Assche and Ronny Van Keer.
|
6
|
-
|
7
|
-
Implementation by Ronny Van Keer, hereby denoted as "the implementer".
|
8
|
-
|
9
|
-
For more information, feedback or questions, please refer to the Keccak Team website:
|
10
|
-
https://keccak.team/
|
11
|
-
|
12
|
-
To the extent possible under law, the implementer has waived all copyright
|
13
|
-
and related or neighboring rights to the source code in this file.
|
14
|
-
http://creativecommons.org/publicdomain/zero/1.0/
|
15
|
-
*/
|
16
|
-
|
17
|
-
#ifndef _Xoodoo_times4_SnP_h_
|
18
|
-
#define _Xoodoo_times4_SnP_h_
|
19
|
-
|
20
|
-
/** For the documentation, see PlSnP-documentation.h.
|
21
|
-
*/
|
22
|
-
|
23
|
-
#define Xoodootimes4_implementation "128-bit SIMD implementation"
|
24
|
-
#define Xoodootimes4_statesSizeInBytes (4*3*4*4)
|
25
|
-
#define Xoodootimes4_statesAlignment 16
|
26
|
-
|
27
|
-
#define Xoodootimes4_StaticInitialize()
|
28
|
-
void Xoodootimes4_InitializeAll(void *states);
|
29
|
-
#define Xoodootimes4_AddByte(states, instanceIndex, byte, offset) \
|
30
|
-
((unsigned char*)(states))[(instanceIndex)*4 + ((offset)/4)*4*4 + (offset)%4] ^= (byte)
|
31
|
-
void Xoodootimes4_AddBytes(void *states, unsigned int instanceIndex, const unsigned char *data, unsigned int offset, unsigned int length);
|
32
|
-
void Xoodootimes4_AddLanesAll(void *states, const unsigned char *data, unsigned int laneCount, unsigned int laneOffset);
|
33
|
-
void Xoodootimes4_OverwriteBytes(void *states, unsigned int instanceIndex, const unsigned char *data, unsigned int offset, unsigned int length);
|
34
|
-
void Xoodootimes4_OverwriteLanesAll(void *states, const unsigned char *data, unsigned int laneCount, unsigned int laneOffset);
|
35
|
-
void Xoodootimes4_OverwriteWithZeroes(void *states, unsigned int instanceIndex, unsigned int byteCount);
|
36
|
-
//void Xoodootimes4_PermuteAll_Nrounds(void *states, unsigned int nr);
|
37
|
-
void Xoodootimes4_PermuteAll_6rounds(void *states);
|
38
|
-
void Xoodootimes4_PermuteAll_12rounds(void *states);
|
39
|
-
void Xoodootimes4_ExtractBytes(const void *states, unsigned int instanceIndex, unsigned char *data, unsigned int offset, unsigned int length);
|
40
|
-
void Xoodootimes4_ExtractLanesAll(const void *states, unsigned char *data, unsigned int laneCount, unsigned int laneOffset);
|
41
|
-
void Xoodootimes4_ExtractAndAddBytes(const void *states, unsigned int instanceIndex, const unsigned char *input, unsigned char *output, unsigned int offset, unsigned int length);
|
42
|
-
void Xoodootimes4_ExtractAndAddLanesAll(const void *states, const unsigned char *input, unsigned char *output, unsigned int laneCount, unsigned int laneOffset);
|
43
|
-
|
44
|
-
#endif
|
@@ -1,45 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
The eXtended Keccak Code Package (XKCP)
|
3
|
-
https://github.com/XKCP/XKCP
|
4
|
-
|
5
|
-
The Xoodoo permutation, designed by Joan Daemen, Seth Hoffert, Gilles Van Assche and Ronny Van Keer.
|
6
|
-
|
7
|
-
Implementation by Ronny Van Keer, hereby denoted as "the implementer".
|
8
|
-
|
9
|
-
For more information, feedback or questions, please refer to the Keccak Team website:
|
10
|
-
https://keccak.team/
|
11
|
-
|
12
|
-
To the extent possible under law, the implementer has waived all copyright
|
13
|
-
and related or neighboring rights to the source code in this file.
|
14
|
-
http://creativecommons.org/publicdomain/zero/1.0/
|
15
|
-
*/
|
16
|
-
|
17
|
-
#ifndef _Xoodoo_times4_SnP_h_
|
18
|
-
#define _Xoodoo_times4_SnP_h_
|
19
|
-
|
20
|
-
#include "Xoodoo-SnP.h"
|
21
|
-
|
22
|
-
/** For the documentation, see PlSnP-documentation.h.
|
23
|
-
*/
|
24
|
-
|
25
|
-
#define Xoodootimes4_implementation "fallback on serial implementation (" Xoodoo_implementation ")"
|
26
|
-
#define Xoodootimes4_statesSizeInBytes (((Xoodoo_stateSizeInBytes+(Xoodoo_stateAlignment-1))/Xoodoo_stateAlignment)*Xoodoo_stateAlignment*4)
|
27
|
-
#define Xoodootimes4_statesAlignment Xoodoo_stateAlignment
|
28
|
-
#define Xoodootimes4_isFallback
|
29
|
-
|
30
|
-
void Xoodootimes4_StaticInitialize(void);
|
31
|
-
void Xoodootimes4_InitializeAll(void *states);
|
32
|
-
void Xoodootimes4_AddByte(void *states, unsigned int instanceIndex, unsigned char data, unsigned int offset);
|
33
|
-
void Xoodootimes4_AddBytes(void *states, unsigned int instanceIndex, const unsigned char *data, unsigned int offset, unsigned int length);
|
34
|
-
void Xoodootimes4_AddLanesAll(void *states, const unsigned char *data, unsigned int laneCount, unsigned int laneOffset);
|
35
|
-
void Xoodootimes4_OverwriteBytes(void *states, unsigned int instanceIndex, const unsigned char *data, unsigned int offset, unsigned int length);
|
36
|
-
void Xoodootimes4_OverwriteLanesAll(void *states, const unsigned char *data, unsigned int laneCount, unsigned int laneOffset);
|
37
|
-
void Xoodootimes4_OverwriteWithZeroes(void *states, unsigned int instanceIndex, unsigned int byteCount);
|
38
|
-
void Xoodootimes4_PermuteAll_6rounds(void *states);
|
39
|
-
void Xoodootimes4_PermuteAll_12rounds(void *states);
|
40
|
-
void Xoodootimes4_ExtractBytes(const void *states, unsigned int instanceIndex, unsigned char *data, unsigned int offset, unsigned int length);
|
41
|
-
void Xoodootimes4_ExtractLanesAll(const void *states, unsigned char *data, unsigned int laneCount, unsigned int laneOffset);
|
42
|
-
void Xoodootimes4_ExtractAndAddBytes(const void *states, unsigned int instanceIndex, const unsigned char *input, unsigned char *output, unsigned int offset, unsigned int length);
|
43
|
-
void Xoodootimes4_ExtractAndAddLanesAll(const void *states, const unsigned char *input, unsigned char *output, unsigned int laneCount, unsigned int laneOffset);
|
44
|
-
|
45
|
-
#endif
|
@@ -1,37 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
The eXtended Keccak Code Package (XKCP)
|
3
|
-
https://github.com/XKCP/XKCP
|
4
|
-
|
5
|
-
The Xoodoo permutation, designed by Joan Daemen, Seth Hoffert, Gilles Van Assche and Ronny Van Keer.
|
6
|
-
|
7
|
-
Implementation by Ronny Van Keer, hereby denoted as "the implementer".
|
8
|
-
|
9
|
-
For more information, feedback or questions, please refer to the Keccak Team website:
|
10
|
-
https://keccak.team/
|
11
|
-
|
12
|
-
To the extent possible under law, the implementer has waived all copyright
|
13
|
-
and related or neighboring rights to the source code in this file.
|
14
|
-
http://creativecommons.org/publicdomain/zero/1.0/
|
15
|
-
|
16
|
-
---
|
17
|
-
|
18
|
-
This file implements Xoodoo×4 in a PlSnP-compatible way.
|
19
|
-
Please refer to PlSnP-documentation.h for more details.
|
20
|
-
|
21
|
-
This implementation comes with Xoodoo-times4-SnP.h in the same folder.
|
22
|
-
Please refer to LowLevel.build for the exact list of other files it must be combined with.
|
23
|
-
*/
|
24
|
-
|
25
|
-
#include "Xoodoo-SnP.h"
|
26
|
-
|
27
|
-
#define prefix Xoodootimes4
|
28
|
-
#define PlSnP_baseParallelism 1
|
29
|
-
#define PlSnP_targetParallelism 4
|
30
|
-
#define SnP_laneLengthInBytes 4
|
31
|
-
#define SnP Xoodoo
|
32
|
-
#define SnP_Permute Xoodoo_Permute_6rounds
|
33
|
-
#define SnP_Permute_12rounds Xoodoo_Permute_12rounds
|
34
|
-
#define PlSnP_PermuteAll Xoodootimes4_PermuteAll_6rounds
|
35
|
-
#define PlSnP_PermuteAll_12rounds Xoodootimes4_PermuteAll_12rounds
|
36
|
-
|
37
|
-
#include "PlSnP-Fallback.inc"
|