sleeping_kangaroo12 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +127 -0
- data/ext/Rakefile +73 -0
- data/ext/binding/sleeping_kangaroo12.c +39 -0
- data/ext/config/xkcp.build +17 -0
- data/ext/xkcp/LICENSE +1 -0
- data/ext/xkcp/Makefile +15 -0
- data/ext/xkcp/Makefile.build +200 -0
- data/ext/xkcp/README.markdown +296 -0
- data/ext/xkcp/lib/HighLevel.build +143 -0
- data/ext/xkcp/lib/LowLevel.build +757 -0
- data/ext/xkcp/lib/common/align.h +33 -0
- data/ext/xkcp/lib/common/brg_endian.h +143 -0
- data/ext/xkcp/lib/high/KangarooTwelve/KangarooTwelve.c +301 -0
- data/ext/xkcp/lib/high/KangarooTwelve/KangarooTwelve.h +97 -0
- data/ext/xkcp/lib/high/Keccak/FIPS202/KeccakHash.c +81 -0
- data/ext/xkcp/lib/high/Keccak/FIPS202/KeccakHash.h +125 -0
- data/ext/xkcp/lib/high/Keccak/FIPS202/SimpleFIPS202.c +48 -0
- data/ext/xkcp/lib/high/Keccak/FIPS202/SimpleFIPS202.h +79 -0
- data/ext/xkcp/lib/high/Keccak/KeccakDuplex.c +81 -0
- data/ext/xkcp/lib/high/Keccak/KeccakDuplex.h +73 -0
- data/ext/xkcp/lib/high/Keccak/KeccakDuplex.inc +195 -0
- data/ext/xkcp/lib/high/Keccak/KeccakSponge.c +111 -0
- data/ext/xkcp/lib/high/Keccak/KeccakSponge.h +76 -0
- data/ext/xkcp/lib/high/Keccak/KeccakSponge.inc +314 -0
- data/ext/xkcp/lib/high/Keccak/PRG/KeccakPRG.c +61 -0
- data/ext/xkcp/lib/high/Keccak/PRG/KeccakPRG.h +67 -0
- data/ext/xkcp/lib/high/Keccak/PRG/KeccakPRG.inc +128 -0
- data/ext/xkcp/lib/high/Keccak/SP800-185/SP800-185.c +93 -0
- data/ext/xkcp/lib/high/Keccak/SP800-185/SP800-185.h +599 -0
- data/ext/xkcp/lib/high/Keccak/SP800-185/SP800-185.inc +573 -0
- data/ext/xkcp/lib/high/Ketje/Ketjev2.c +87 -0
- data/ext/xkcp/lib/high/Ketje/Ketjev2.h +88 -0
- data/ext/xkcp/lib/high/Ketje/Ketjev2.inc +274 -0
- data/ext/xkcp/lib/high/Keyak/Keyakv2.c +132 -0
- data/ext/xkcp/lib/high/Keyak/Keyakv2.h +217 -0
- data/ext/xkcp/lib/high/Keyak/Keyakv2.inc +81 -0
- data/ext/xkcp/lib/high/Keyak/Motorist.inc +953 -0
- data/ext/xkcp/lib/high/Kravatte/Kravatte.c +533 -0
- data/ext/xkcp/lib/high/Kravatte/Kravatte.h +115 -0
- data/ext/xkcp/lib/high/Kravatte/KravatteModes.c +557 -0
- data/ext/xkcp/lib/high/Kravatte/KravatteModes.h +247 -0
- data/ext/xkcp/lib/high/Xoodyak/Cyclist.h +66 -0
- data/ext/xkcp/lib/high/Xoodyak/Cyclist.inc +336 -0
- data/ext/xkcp/lib/high/Xoodyak/Xoodyak-parameters.h +26 -0
- data/ext/xkcp/lib/high/Xoodyak/Xoodyak.c +55 -0
- data/ext/xkcp/lib/high/Xoodyak/Xoodyak.h +35 -0
- data/ext/xkcp/lib/high/Xoofff/Xoofff.c +634 -0
- data/ext/xkcp/lib/high/Xoofff/Xoofff.h +147 -0
- data/ext/xkcp/lib/high/Xoofff/XoofffModes.c +483 -0
- data/ext/xkcp/lib/high/Xoofff/XoofffModes.h +241 -0
- data/ext/xkcp/lib/high/common/Phases.h +25 -0
- data/ext/xkcp/lib/low/KeccakP-1600/ARM/KeccakP-1600-SnP.h +41 -0
- data/ext/xkcp/lib/low/KeccakP-1600/ARM/KeccakP-1600-inplace-32bi-armv6m-le-armcc.s +1666 -0
- data/ext/xkcp/lib/low/KeccakP-1600/ARM/KeccakP-1600-inplace-32bi-armv6m-le-gcc.s +1655 -0
- data/ext/xkcp/lib/low/KeccakP-1600/ARM/KeccakP-1600-inplace-32bi-armv7a-le-armcc.s +1268 -0
- data/ext/xkcp/lib/low/KeccakP-1600/ARM/KeccakP-1600-inplace-32bi-armv7a-le-gcc.s +1264 -0
- data/ext/xkcp/lib/low/KeccakP-1600/ARM/KeccakP-1600-inplace-32bi-armv7m-le-armcc.s +1178 -0
- data/ext/xkcp/lib/low/KeccakP-1600/ARM/KeccakP-1600-inplace-32bi-armv7m-le-gcc.s +1175 -0
- data/ext/xkcp/lib/low/KeccakP-1600/ARM/KeccakP-1600-u1-32bi-armv6m-le-armcc.s +1338 -0
- data/ext/xkcp/lib/low/KeccakP-1600/ARM/KeccakP-1600-u1-32bi-armv6m-le-gcc.s +1336 -0
- data/ext/xkcp/lib/low/KeccakP-1600/ARM/KeccakP-1600-u2-32bi-armv6m-le-armcc.s +1343 -0
- data/ext/xkcp/lib/low/KeccakP-1600/ARM/KeccakP-1600-u2-32bi-armv6m-le-gcc.s +1339 -0
- data/ext/xkcp/lib/low/KeccakP-1600/ARMv7A-NEON/KeccakP-1600-SnP.h +42 -0
- data/ext/xkcp/lib/low/KeccakP-1600/ARMv7A-NEON/KeccakP-1600-armv7a-le-neon-armcc.s +823 -0
- data/ext/xkcp/lib/low/KeccakP-1600/ARMv7A-NEON/KeccakP-1600-armv7a-le-neon-gcc.s +831 -0
- data/ext/xkcp/lib/low/KeccakP-1600/ARMv8A/KeccakP-1600-SnP.h +31 -0
- data/ext/xkcp/lib/low/KeccakP-1600/ARMv8A/KeccakP-1600-armv8a-neon.s +540 -0
- data/ext/xkcp/lib/low/KeccakP-1600/AVR8/KeccakP-1600-SnP.h +42 -0
- data/ext/xkcp/lib/low/KeccakP-1600/AVR8/KeccakP-1600-avr8-compact.s +733 -0
- data/ext/xkcp/lib/low/KeccakP-1600/AVR8/KeccakP-1600-avr8-fast.s +1121 -0
- data/ext/xkcp/lib/low/KeccakP-1600/AVX2/KeccakP-1600-AVX2.s +1100 -0
- data/ext/xkcp/lib/low/KeccakP-1600/AVX2/KeccakP-1600-SnP.h +52 -0
- data/ext/xkcp/lib/low/KeccakP-1600/AVX512/C/KeccakP-1600-AVX512.c +623 -0
- data/ext/xkcp/lib/low/KeccakP-1600/AVX512/C/KeccakP-1600-SnP.h +47 -0
- data/ext/xkcp/lib/low/KeccakP-1600/AVX512/C/u12/KeccakP-1600-AVX512-config.h +6 -0
- data/ext/xkcp/lib/low/KeccakP-1600/AVX512/C/u6/KeccakP-1600-AVX512-config.h +6 -0
- data/ext/xkcp/lib/low/KeccakP-1600/AVX512/C/ua/KeccakP-1600-AVX512-config.h +6 -0
- data/ext/xkcp/lib/low/KeccakP-1600/AVX512/KeccakP-1600-AVX512.s +1031 -0
- data/ext/xkcp/lib/low/KeccakP-1600/AVX512/KeccakP-1600-SnP.h +53 -0
- data/ext/xkcp/lib/low/KeccakP-1600/XOP/KeccakP-1600-SnP.h +44 -0
- data/ext/xkcp/lib/low/KeccakP-1600/XOP/KeccakP-1600-XOP.c +476 -0
- data/ext/xkcp/lib/low/KeccakP-1600/XOP/u6/KeccakP-1600-XOP-config.h +6 -0
- data/ext/xkcp/lib/low/KeccakP-1600/XOP/ua/KeccakP-1600-XOP-config.h +6 -0
- data/ext/xkcp/lib/low/KeccakP-1600/common/KeccakP-1600-64.macros +748 -0
- data/ext/xkcp/lib/low/KeccakP-1600/common/KeccakP-1600-unrolling.macros +305 -0
- data/ext/xkcp/lib/low/KeccakP-1600/compact/KeccakP-1600-SnP.h +40 -0
- data/ext/xkcp/lib/low/KeccakP-1600/compact/KeccakP-1600-compact64.c +420 -0
- data/ext/xkcp/lib/low/KeccakP-1600/plain-32bits-inplace/KeccakP-1600-SnP.h +43 -0
- data/ext/xkcp/lib/low/KeccakP-1600/plain-32bits-inplace/KeccakP-1600-inplace32BI.c +1163 -0
- data/ext/xkcp/lib/low/KeccakP-1600/plain-64bits/KeccakP-1600-SnP.h +54 -0
- data/ext/xkcp/lib/low/KeccakP-1600/plain-64bits/KeccakP-1600-opt64.c +565 -0
- data/ext/xkcp/lib/low/KeccakP-1600/plain-64bits/lcu6/KeccakP-1600-opt64-config.h +7 -0
- data/ext/xkcp/lib/low/KeccakP-1600/plain-64bits/lcua/KeccakP-1600-opt64-config.h +7 -0
- data/ext/xkcp/lib/low/KeccakP-1600/plain-64bits/lcua-shld/KeccakP-1600-opt64-config.h +8 -0
- data/ext/xkcp/lib/low/KeccakP-1600/plain-64bits/u6/KeccakP-1600-opt64-config.h +6 -0
- data/ext/xkcp/lib/low/KeccakP-1600/plain-64bits/ua/KeccakP-1600-opt64-config.h +6 -0
- data/ext/xkcp/lib/low/KeccakP-1600/ref-32bits/KeccakP-1600-SnP.h +44 -0
- data/ext/xkcp/lib/low/KeccakP-1600/ref-32bits/KeccakP-1600-reference.h +23 -0
- data/ext/xkcp/lib/low/KeccakP-1600/ref-32bits/KeccakP-1600-reference32BI.c +625 -0
- data/ext/xkcp/lib/low/KeccakP-1600/ref-64bits/KeccakP-1600-SnP.h +44 -0
- data/ext/xkcp/lib/low/KeccakP-1600/ref-64bits/KeccakP-1600-reference.c +440 -0
- data/ext/xkcp/lib/low/KeccakP-1600/ref-64bits/KeccakP-1600-reference.h +23 -0
- data/ext/xkcp/lib/low/KeccakP-1600/x86-64/KeccakP-1600-SnP.h +42 -0
- data/ext/xkcp/lib/low/KeccakP-1600/x86-64/KeccakP-1600-x86-64-gas.s +1196 -0
- data/ext/xkcp/lib/low/KeccakP-1600/x86-64/KeccakP-1600-x86-64-gas_Apple.s +1124 -0
- data/ext/xkcp/lib/low/KeccakP-1600/x86-64/KeccakP-1600-x86-64-shld-gas.s +1196 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times2/ARMv7A-NEON/KeccakP-1600-inplace-pl2-armv7a-neon-le-armcc.s +1392 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times2/ARMv7A-NEON/KeccakP-1600-inplace-pl2-armv7a-neon-le-gcc.s +1394 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times2/ARMv7A-NEON/KeccakP-1600-times2-SnP.h +42 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times2/AVX512/AVX512u12/SIMD512-2-config.h +7 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times2/AVX512/AVX512u4/SIMD512-2-config.h +7 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times2/AVX512/AVX512ufull/SIMD512-2-config.h +7 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times2/AVX512/KeccakP-1600-times2-SIMD512.c +850 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times2/AVX512/KeccakP-1600-times2-SnP.h +51 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times2/SIMD128/KeccakP-1600-times2-SIMD128.c +957 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times2/SIMD128/KeccakP-1600-times2-SnP.h +49 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times2/SIMD128/SSSE3-u2/SIMD128-config.h +8 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times2/SIMD128/SSSE3-ua/SIMD128-config.h +8 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times2/SIMD128/XOP-u2/SIMD128-config.h +9 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times2/SIMD128/XOP-ua/SIMD128-config.h +9 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times2/fallback-on1/KeccakP-1600-times2-SnP.h +45 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times2/fallback-on1/KeccakP-1600-times2-on1.c +37 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times4/AVX2/KeccakP-1600-times4-SIMD256.c +1321 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times4/AVX2/KeccakP-1600-times4-SnP.h +55 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times4/AVX2/u12/SIMD256-config.h +7 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times4/AVX2/u6/SIMD256-config.h +7 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times4/AVX2/ua/SIMD256-config.h +7 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times4/AVX512/AVX512u12/SIMD512-4-config.h +7 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times4/AVX512/AVX512u4/SIMD512-4-config.h +7 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times4/AVX512/AVX512ufull/SIMD512-4-config.h +7 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times4/AVX512/KeccakP-1600-times4-SIMD512.c +881 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times4/AVX512/KeccakP-1600-times4-SnP.h +51 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times4/fallback-on1/KeccakP-1600-times4-SnP.h +45 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times4/fallback-on1/KeccakP-1600-times4-on1.c +37 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times4/fallback-on2/KeccakP-1600-times4-SnP.h +45 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times4/fallback-on2/KeccakP-1600-times4-on2.c +38 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times8/AVX512/KeccakP-1600-times8-SIMD512.c +1615 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times8/AVX512/KeccakP-1600-times8-SnP.h +57 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times8/AVX512/u12/SIMD512-config.h +7 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times8/AVX512/u4/SIMD512-config.h +7 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times8/AVX512/ua/SIMD512-config.h +7 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times8/fallback-on1/KeccakP-1600-times8-SnP.h +45 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times8/fallback-on1/KeccakP-1600-times8-on1.c +37 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times8/fallback-on2/KeccakP-1600-times8-SnP.h +45 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times8/fallback-on2/KeccakP-1600-times8-on2.c +38 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times8/fallback-on4/KeccakP-1600-times8-SnP.h +45 -0
- data/ext/xkcp/lib/low/KeccakP-1600-times8/fallback-on4/KeccakP-1600-times8-on4.c +38 -0
- data/ext/xkcp/lib/low/KeccakP-200/ARM/KeccakP-200-SnP.h +41 -0
- data/ext/xkcp/lib/low/KeccakP-200/ARM/KeccakP-200-armv6m-le-armcc.s +442 -0
- data/ext/xkcp/lib/low/KeccakP-200/ARM/KeccakP-200-armv6m-le-gcc.s +446 -0
- data/ext/xkcp/lib/low/KeccakP-200/ARM/KeccakP-200-armv7m-le-armcc.s +419 -0
- data/ext/xkcp/lib/low/KeccakP-200/ARM/KeccakP-200-armv7m-le-gcc.s +427 -0
- data/ext/xkcp/lib/low/KeccakP-200/AVR8/KeccakP-200-SnP.h +41 -0
- data/ext/xkcp/lib/low/KeccakP-200/AVR8/KeccakP-200-avr8-fast.s +647 -0
- data/ext/xkcp/lib/low/KeccakP-200/compact/KeccakP-200-SnP.h +39 -0
- data/ext/xkcp/lib/low/KeccakP-200/compact/KeccakP-200-compact.c +190 -0
- data/ext/xkcp/lib/low/KeccakP-200/ref/KeccakP-200-SnP.h +43 -0
- data/ext/xkcp/lib/low/KeccakP-200/ref/KeccakP-200-reference.c +412 -0
- data/ext/xkcp/lib/low/KeccakP-200/ref/KeccakP-200-reference.h +23 -0
- data/ext/xkcp/lib/low/KeccakP-400/ARM/KeccakP-400-SnP.h +41 -0
- data/ext/xkcp/lib/low/KeccakP-400/ARM/KeccakP-400-armv6m-le-armcc.s +454 -0
- data/ext/xkcp/lib/low/KeccakP-400/ARM/KeccakP-400-armv6m-le-gcc.s +458 -0
- data/ext/xkcp/lib/low/KeccakP-400/ARM/KeccakP-400-armv7m-le-armcc.s +455 -0
- data/ext/xkcp/lib/low/KeccakP-400/ARM/KeccakP-400-armv7m-le-gcc.s +458 -0
- data/ext/xkcp/lib/low/KeccakP-400/AVR8/KeccakP-400-SnP.h +41 -0
- data/ext/xkcp/lib/low/KeccakP-400/AVR8/KeccakP-400-avr8-fast.s +728 -0
- data/ext/xkcp/lib/low/KeccakP-400/ref/KeccakP-400-SnP.h +43 -0
- data/ext/xkcp/lib/low/KeccakP-400/ref/KeccakP-400-reference.c +414 -0
- data/ext/xkcp/lib/low/KeccakP-400/ref/KeccakP-400-reference.h +23 -0
- data/ext/xkcp/lib/low/KeccakP-800/ARM/KeccakP-800-SnP.h +42 -0
- data/ext/xkcp/lib/low/KeccakP-800/ARM/KeccakP-800-u1-armv6m-le-armcc.s +527 -0
- data/ext/xkcp/lib/low/KeccakP-800/ARM/KeccakP-800-u1-armv6m-le-gcc.s +533 -0
- data/ext/xkcp/lib/low/KeccakP-800/ARM/KeccakP-800-u2-armv6m-le-armcc.s +528 -0
- data/ext/xkcp/lib/low/KeccakP-800/ARM/KeccakP-800-u2-armv6m-le-gcc.s +534 -0
- data/ext/xkcp/lib/low/KeccakP-800/ARM/KeccakP-800-u2-armv7a-le-armcc.s +521 -0
- data/ext/xkcp/lib/low/KeccakP-800/ARM/KeccakP-800-u2-armv7a-le-gcc.s +527 -0
- data/ext/xkcp/lib/low/KeccakP-800/ARM/KeccakP-800-u2-armv7m-le-armcc.s +517 -0
- data/ext/xkcp/lib/low/KeccakP-800/ARM/KeccakP-800-u2-armv7m-le-gcc.s +523 -0
- data/ext/xkcp/lib/low/KeccakP-800/ARM/KeccakP-800-uf-armv7m-le-armcc.s +550 -0
- data/ext/xkcp/lib/low/KeccakP-800/ARM/KeccakP-800-uf-armv7m-le-gcc.s +556 -0
- data/ext/xkcp/lib/low/KeccakP-800/ARMv8A/KeccakP-800-SnP.h +32 -0
- data/ext/xkcp/lib/low/KeccakP-800/ARMv8A/KeccakP-800-armv8a-neon.s +432 -0
- data/ext/xkcp/lib/low/KeccakP-800/AVR8/KeccakP-800-SnP.h +42 -0
- data/ext/xkcp/lib/low/KeccakP-800/AVR8/KeccakP-800-avr8-fast.s +929 -0
- data/ext/xkcp/lib/low/KeccakP-800/compact/KeccakP-800-SnP.h +40 -0
- data/ext/xkcp/lib/low/KeccakP-800/compact/KeccakP-800-compact.c +244 -0
- data/ext/xkcp/lib/low/KeccakP-800/plain/KeccakP-800-SnP.h +46 -0
- data/ext/xkcp/lib/low/KeccakP-800/plain/KeccakP-800-opt32-bis.macros +184 -0
- data/ext/xkcp/lib/low/KeccakP-800/plain/KeccakP-800-opt32.c +454 -0
- data/ext/xkcp/lib/low/KeccakP-800/plain/KeccakP-800-opt32.macros +459 -0
- data/ext/xkcp/lib/low/KeccakP-800/plain/KeccakP-800-unrolling-bis.macros +83 -0
- data/ext/xkcp/lib/low/KeccakP-800/plain/KeccakP-800-unrolling.macros +88 -0
- data/ext/xkcp/lib/low/KeccakP-800/plain/lcu2/KeccakP-800-opt32-config.h +7 -0
- data/ext/xkcp/lib/low/KeccakP-800/plain/lcua/KeccakP-800-opt32-config.h +7 -0
- data/ext/xkcp/lib/low/KeccakP-800/plain/u2/KeccakP-800-opt32-config.h +7 -0
- data/ext/xkcp/lib/low/KeccakP-800/plain/ua/KeccakP-800-opt32-config.h +7 -0
- data/ext/xkcp/lib/low/KeccakP-800/ref/KeccakP-800-SnP.h +44 -0
- data/ext/xkcp/lib/low/KeccakP-800/ref/KeccakP-800-reference.c +437 -0
- data/ext/xkcp/lib/low/KeccakP-800/ref/KeccakP-800-reference.h +23 -0
- data/ext/xkcp/lib/low/Ketje/OptimizedAsmARM/Ket.h +57 -0
- data/ext/xkcp/lib/low/Ketje/OptimizedAsmARM/KetjeJr-armv7m-le-armcc.s +475 -0
- data/ext/xkcp/lib/low/Ketje/OptimizedAsmARM/KetjeJr-armv7m-le-gcc.s +480 -0
- data/ext/xkcp/lib/low/Ketje/OptimizedAsmARM/KetjeSr-armv7m-le-armcc.s +590 -0
- data/ext/xkcp/lib/low/Ketje/OptimizedAsmARM/KetjeSr-armv7m-le-gcc.s +590 -0
- data/ext/xkcp/lib/low/Ketje/OptimizedLE/Ket.c +126 -0
- data/ext/xkcp/lib/low/Ketje/OptimizedLE/Ket.h +68 -0
- data/ext/xkcp/lib/low/Ketje/OptimizedLE/Ket.inc +174 -0
- data/ext/xkcp/lib/low/Ketje/SnP-compliant/Ket.c +80 -0
- data/ext/xkcp/lib/low/Ketje/SnP-compliant/Ket.h +68 -0
- data/ext/xkcp/lib/low/Ketje/SnP-compliant/Ket.inc +142 -0
- data/ext/xkcp/lib/low/Xoodoo/ARM/Xoodoo-SnP.h +55 -0
- data/ext/xkcp/lib/low/Xoodoo/ARM/Xoodoo-u1-armv6m-le-armcc.s +1086 -0
- data/ext/xkcp/lib/low/Xoodoo/ARM/Xoodoo-u1-armv6m-le-gcc.s +1092 -0
- data/ext/xkcp/lib/low/Xoodoo/ARM/Xoodoo-uf-armv6-le-armcc.s +721 -0
- data/ext/xkcp/lib/low/Xoodoo/ARM/Xoodoo-uf-armv6-le-gcc.s +726 -0
- data/ext/xkcp/lib/low/Xoodoo/ARM/Xoodoo-uf-armv7m-le-armcc.s +723 -0
- data/ext/xkcp/lib/low/Xoodoo/ARM/Xoodoo-uf-armv7m-le-gcc.s +729 -0
- data/ext/xkcp/lib/low/Xoodoo/ARM/Xoodyak-u1-armv6m-le-armcc.s +1164 -0
- data/ext/xkcp/lib/low/Xoodoo/ARM/Xoodyak-u1-armv6m-le-gcc.s +1165 -0
- data/ext/xkcp/lib/low/Xoodoo/ARM/Xoodyak-uf-armv6-le-armcc.s +562 -0
- data/ext/xkcp/lib/low/Xoodoo/ARM/Xoodyak-uf-armv6-le-gcc.s +563 -0
- data/ext/xkcp/lib/low/Xoodoo/ARM/Xoodyak-uf-armv7m-le-armcc.s +563 -0
- data/ext/xkcp/lib/low/Xoodoo/ARM/Xoodyak-uf-armv7m-le-gcc.s +565 -0
- data/ext/xkcp/lib/low/Xoodoo/ARMv7A-NEON/Xoodoo-SnP.h +55 -0
- data/ext/xkcp/lib/low/Xoodoo/ARMv7A-NEON/Xoodoo-uf-armv7a-neon-le-armcc.s +476 -0
- data/ext/xkcp/lib/low/Xoodoo/ARMv7A-NEON/Xoodoo-uf-armv7a-neon-le-gcc.s +485 -0
- data/ext/xkcp/lib/low/Xoodoo/ARMv7A-NEON/Xoodyak-uf-armv7a-neon-le-armcc.s +362 -0
- data/ext/xkcp/lib/low/Xoodoo/ARMv7A-NEON/Xoodyak-uf-armv7a-neon-le-gcc.s +367 -0
- data/ext/xkcp/lib/low/Xoodoo/AVR8/Xoodoo-SnP.h +43 -0
- data/ext/xkcp/lib/low/Xoodoo/AVR8/Xoodoo-avr8-u1.s +1341 -0
- data/ext/xkcp/lib/low/Xoodoo/AVX512/Xoodoo-SIMD512.c +581 -0
- data/ext/xkcp/lib/low/Xoodoo/AVX512/Xoodoo-SnP.h +58 -0
- data/ext/xkcp/lib/low/Xoodoo/AVX512/Xoodyak-full-block-SIMD512.c +332 -0
- data/ext/xkcp/lib/low/Xoodoo/SSE2/Xoodoo-SIMD128.c +329 -0
- data/ext/xkcp/lib/low/Xoodoo/SSE2/Xoodoo-SnP.h +53 -0
- data/ext/xkcp/lib/low/Xoodoo/SSE2/Xoodyak-full-block-SIMD128.c +355 -0
- data/ext/xkcp/lib/low/Xoodoo/Xoodoo.h +79 -0
- data/ext/xkcp/lib/low/Xoodoo/plain/Xoodoo-SnP.h +56 -0
- data/ext/xkcp/lib/low/Xoodoo/plain/Xoodoo-optimized.c +399 -0
- data/ext/xkcp/lib/low/Xoodoo/plain/Xoodyak-full-blocks.c +127 -0
- data/ext/xkcp/lib/low/Xoodoo/ref/Xoodoo-SnP.h +43 -0
- data/ext/xkcp/lib/low/Xoodoo/ref/Xoodoo-reference.c +253 -0
- data/ext/xkcp/lib/low/Xoodoo-times16/AVX512/Xoodoo-times16-SIMD512.c +1044 -0
- data/ext/xkcp/lib/low/Xoodoo-times16/AVX512/Xoodoo-times16-SnP.h +49 -0
- data/ext/xkcp/lib/low/Xoodoo-times16/fallback-on1/Xoodoo-times16-SnP.h +45 -0
- data/ext/xkcp/lib/low/Xoodoo-times16/fallback-on1/Xoodoo-times16-on1.c +37 -0
- data/ext/xkcp/lib/low/Xoodoo-times4/ARMv7A-NEON/Xoodoo-times4-ARMv7A.s +1587 -0
- data/ext/xkcp/lib/low/Xoodoo-times4/ARMv7A-NEON/Xoodoo-times4-SnP.h +48 -0
- data/ext/xkcp/lib/low/Xoodoo-times4/AVX512/Xoodoo-times4-SIMD512.c +1202 -0
- data/ext/xkcp/lib/low/Xoodoo-times4/AVX512/Xoodoo-times4-SnP.h +48 -0
- data/ext/xkcp/lib/low/Xoodoo-times4/SSSE3/Xoodoo-times4-SIMD128.c +484 -0
- data/ext/xkcp/lib/low/Xoodoo-times4/SSSE3/Xoodoo-times4-SnP.h +44 -0
- data/ext/xkcp/lib/low/Xoodoo-times4/fallback-on1/Xoodoo-times4-SnP.h +45 -0
- data/ext/xkcp/lib/low/Xoodoo-times4/fallback-on1/Xoodoo-times4-on1.c +37 -0
- data/ext/xkcp/lib/low/Xoodoo-times8/AVX2/Xoodoo-times8-SIMD256.c +939 -0
- data/ext/xkcp/lib/low/Xoodoo-times8/AVX2/Xoodoo-times8-SnP.h +49 -0
- data/ext/xkcp/lib/low/Xoodoo-times8/AVX512/Xoodoo-times8-SIMD512.c +1216 -0
- data/ext/xkcp/lib/low/Xoodoo-times8/AVX512/Xoodoo-times8-SnP.h +48 -0
- data/ext/xkcp/lib/low/Xoodoo-times8/fallback-on1/Xoodoo-times8-SnP.h +45 -0
- data/ext/xkcp/lib/low/Xoodoo-times8/fallback-on1/Xoodoo-times8-on1.c +37 -0
- data/ext/xkcp/lib/low/common/PlSnP-Fallback.inc +290 -0
- data/ext/xkcp/lib/low/common/SnP-Relaned.h +141 -0
- data/ext/xkcp/support/Build/ExpandProducts.xsl +79 -0
- data/ext/xkcp/support/Build/ToGlobalMakefile.xsl +206 -0
- data/ext/xkcp/support/Build/ToOneTarget.xsl +89 -0
- data/ext/xkcp/support/Build/ToTargetConfigFile.xsl +37 -0
- data/ext/xkcp/support/Build/ToTargetMakefile.xsl +298 -0
- data/ext/xkcp/support/Build/ToVCXProj.xsl +198 -0
- data/ext/xkcp/support/Kernel-PMU/Kernel-pmu.md +133 -0
- data/ext/xkcp/support/Kernel-PMU/Makefile +8 -0
- data/ext/xkcp/support/Kernel-PMU/enable_arm_pmu.c +129 -0
- data/ext/xkcp/support/Kernel-PMU/load-module +1 -0
- data/ext/xkcp/util/KeccakSum/KeccakSum.c +394 -0
- data/ext/xkcp/util/KeccakSum/base64.c +86 -0
- data/ext/xkcp/util/KeccakSum/base64.h +12 -0
- data/lib/sleeping_kangaroo12/binding.rb +15 -0
- data/lib/sleeping_kangaroo12/build/loader.rb +40 -0
- data/lib/sleeping_kangaroo12/build/platform.rb +37 -0
- data/lib/sleeping_kangaroo12/build.rb +4 -0
- data/lib/sleeping_kangaroo12/digest.rb +103 -0
- data/lib/sleeping_kangaroo12/version.rb +5 -0
- data/lib/sleeping_kangaroo12.rb +7 -0
- metadata +372 -0
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
;
|
|
2
|
+
; The eXtended Keccak Code Package (XKCP)
|
|
3
|
+
; https://github.com/XKCP/XKCP
|
|
4
|
+
;
|
|
5
|
+
; The Keccak-p permutations, designed by Guido Bertoni, Joan Daemen, Michaël Peeters and Gilles Van Assche.
|
|
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 Keccak-p[400] in a SnP-compatible way.
|
|
19
|
+
; Please refer to SnP-documentation.h for more details.
|
|
20
|
+
;
|
|
21
|
+
; This implementation comes with KeccakP-400-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
|
+
; WARNING: This implementation assumes a little endian CPU with ARMv7M architecture (e.g., Cortex-M3) and the ARMCC compiler.
|
|
26
|
+
|
|
27
|
+
PRESERVE8
|
|
28
|
+
THUMB
|
|
29
|
+
AREA |.text|, CODE, READONLY
|
|
30
|
+
|
|
31
|
+
;----------------------------------------------------------------------------
|
|
32
|
+
|
|
33
|
+
_ba equ 0*2
|
|
34
|
+
_be equ 1*2
|
|
35
|
+
_bi equ 2*2
|
|
36
|
+
_bo equ 3*2
|
|
37
|
+
_bu equ 4*2
|
|
38
|
+
_ga equ 5*2
|
|
39
|
+
_ge equ 6*2
|
|
40
|
+
_gi equ 7*2
|
|
41
|
+
_go equ 8*2
|
|
42
|
+
_gu equ 9*2
|
|
43
|
+
_ka equ 10*2
|
|
44
|
+
_ke equ 11*2
|
|
45
|
+
_ki equ 12*2
|
|
46
|
+
_ko equ 13*2
|
|
47
|
+
_ku equ 14*2
|
|
48
|
+
_ma equ 15*2
|
|
49
|
+
_me equ 16*2
|
|
50
|
+
_mi equ 17*2
|
|
51
|
+
_mo equ 18*2
|
|
52
|
+
_mu equ 19*2
|
|
53
|
+
_sa equ 20*2
|
|
54
|
+
_se equ 21*2
|
|
55
|
+
_si equ 22*2
|
|
56
|
+
_so equ 23*2
|
|
57
|
+
_su equ 24*2
|
|
58
|
+
|
|
59
|
+
MACRO
|
|
60
|
+
xor5 $result,$ptr,$b,$g,$k,$m,$rs
|
|
61
|
+
ldrh $result, [$ptr, #$b]
|
|
62
|
+
ldrh r6, [$ptr, #$g]
|
|
63
|
+
eor $result, $result, $rs
|
|
64
|
+
ldrh $rs, [$ptr, #$k]
|
|
65
|
+
eor $result, $result, r6
|
|
66
|
+
ldrh r6, [$ptr, #$m]
|
|
67
|
+
eor $result, $result, $rs
|
|
68
|
+
eor $result, $result, r6
|
|
69
|
+
MEND
|
|
70
|
+
|
|
71
|
+
MACRO
|
|
72
|
+
xor5D $resultL,$resultH,$ptr,$b,$g,$k,$m,$rsL,$rsH
|
|
73
|
+
bfi $rsL, $rsH, #16, #16
|
|
74
|
+
ldr $resultL, [$ptr, #$b]
|
|
75
|
+
ldr r6, [$ptr, #$g]
|
|
76
|
+
eor $resultL, $resultL, $rsL
|
|
77
|
+
ldr $rsL, [$ptr, #$k]
|
|
78
|
+
eor $resultL, $resultL, r6
|
|
79
|
+
ldr r6, [$ptr, #$m]
|
|
80
|
+
eor $resultL, $resultL, $rsL
|
|
81
|
+
eor $resultL, $resultL, r6
|
|
82
|
+
lsr $resultH, $resultL, #16
|
|
83
|
+
uxth $resultL, $resultL
|
|
84
|
+
MEND
|
|
85
|
+
|
|
86
|
+
MACRO
|
|
87
|
+
xorrol $b, $yy, $rr
|
|
88
|
+
eor $b, $b, $yy
|
|
89
|
+
if $rr != 8
|
|
90
|
+
lsl $b, $b, #$rr
|
|
91
|
+
orr $b, $b, $b, LSR #16
|
|
92
|
+
else
|
|
93
|
+
rev16 $b, $b
|
|
94
|
+
endif
|
|
95
|
+
MEND
|
|
96
|
+
|
|
97
|
+
MACRO
|
|
98
|
+
rolxor $d, $a, $b
|
|
99
|
+
eor $d, $a, $b, LSL #1
|
|
100
|
+
eor $d, $d, $b, LSR #15
|
|
101
|
+
uxth $d, $d
|
|
102
|
+
MEND
|
|
103
|
+
|
|
104
|
+
MACRO
|
|
105
|
+
xandnot $resptr, $resofs, $aa, $bb, $cc, $temp
|
|
106
|
+
bic $temp, $cc, $bb
|
|
107
|
+
eor $temp, $temp, $aa
|
|
108
|
+
strh $temp, [$resptr, #$resofs]
|
|
109
|
+
MEND
|
|
110
|
+
|
|
111
|
+
MACRO
|
|
112
|
+
xandnotRC $resptr, $resofs, $aa, $bb, $cc
|
|
113
|
+
ldrh r6, [r8], #2
|
|
114
|
+
bic $cc, $cc, $bb
|
|
115
|
+
eor $cc, $cc, r6
|
|
116
|
+
eor $cc, $cc, $aa
|
|
117
|
+
strh $cc, [$resptr, #$resofs]
|
|
118
|
+
MEND
|
|
119
|
+
|
|
120
|
+
MACRO
|
|
121
|
+
KeccakRound $sOut, $sIn
|
|
122
|
+
;prepTheta
|
|
123
|
+
xor5D r1, r2, $sIn, _ba, _ga, _ka, _ma, r9, r10
|
|
124
|
+
xor5D r3, r4, $sIn, _bi, _gi, _ki, _mi, r11, r12
|
|
125
|
+
rolxor r9, r7, r2
|
|
126
|
+
rolxor r10, r1, r3
|
|
127
|
+
rolxor r11, r2, r4
|
|
128
|
+
rolxor r12, r3, r7
|
|
129
|
+
rolxor lr, r4, r1
|
|
130
|
+
|
|
131
|
+
;thetaRhoPiChiIota
|
|
132
|
+
ldrh r1, [$sIn, #_ba]
|
|
133
|
+
ldrh r2, [$sIn, #_ge]
|
|
134
|
+
ldrh r3, [$sIn, #_ki]
|
|
135
|
+
ldrh r4, [$sIn, #_mo]
|
|
136
|
+
eor r1, r1, r9
|
|
137
|
+
xorrol r2, r10, 12
|
|
138
|
+
xorrol r3, r11, 11
|
|
139
|
+
xorrol r4, r12, 5
|
|
140
|
+
xorrol r5, lr, 14
|
|
141
|
+
xandnot $sOut, _be, r2, r3, r4, r6
|
|
142
|
+
xandnot $sOut, _bi, r3, r4, r5, r6
|
|
143
|
+
xandnot $sOut, _bo, r4, r5, r1, r6
|
|
144
|
+
xandnot $sOut, _bu, r5, r1, r2, r7
|
|
145
|
+
xandnotRC $sOut, _ba, r1, r2, r3
|
|
146
|
+
|
|
147
|
+
ldrh r1, [$sIn, #_bo]
|
|
148
|
+
ldrh r2, [$sIn, #_gu]
|
|
149
|
+
ldrh r3, [$sIn, #_ka]
|
|
150
|
+
ldrh r4, [$sIn, #_me]
|
|
151
|
+
ldrh r5, [$sIn, #_si]
|
|
152
|
+
xorrol r1, r12, 12
|
|
153
|
+
xorrol r2, lr, 4
|
|
154
|
+
xorrol r3, r9, 3
|
|
155
|
+
xorrol r4, r10, 13
|
|
156
|
+
xorrol r5, r11, 13
|
|
157
|
+
xandnot $sOut, _ga, r1, r2, r3, r6
|
|
158
|
+
xandnot $sOut, _ge, r2, r3, r4, r6
|
|
159
|
+
xandnot $sOut, _gi, r3, r4, r5, r6
|
|
160
|
+
xandnot $sOut, _go, r4, r5, r1, r6
|
|
161
|
+
xandnot $sOut, _gu, r5, r1, r2, r6
|
|
162
|
+
eor r7, r7, r6
|
|
163
|
+
|
|
164
|
+
ldrh r1, [$sIn, #_be]
|
|
165
|
+
ldrh r2, [$sIn, #_gi]
|
|
166
|
+
ldrh r3, [$sIn, #_ko]
|
|
167
|
+
ldrh r4, [$sIn, #_mu]
|
|
168
|
+
ldrh r5, [$sIn, #_sa]
|
|
169
|
+
xorrol r1, r10, 1
|
|
170
|
+
xorrol r2, r11, 6
|
|
171
|
+
xorrol r3, r12, 9
|
|
172
|
+
xorrol r4, lr, 8
|
|
173
|
+
xorrol r5, r9, 2
|
|
174
|
+
xandnot $sOut, _ka, r1, r2, r3, r6
|
|
175
|
+
xandnot $sOut, _ke, r2, r3, r4, r6
|
|
176
|
+
xandnot $sOut, _ki, r3, r4, r5, r6
|
|
177
|
+
xandnot $sOut, _ko, r4, r5, r1, r6
|
|
178
|
+
xandnot $sOut, _ku, r5, r1, r2, r6
|
|
179
|
+
eor r7, r7, r6
|
|
180
|
+
|
|
181
|
+
ldrh r1, [$sIn, #_bu]
|
|
182
|
+
ldrh r2, [$sIn, #_ga]
|
|
183
|
+
ldrh r3, [$sIn, #_ke]
|
|
184
|
+
ldrh r4, [$sIn, #_mi]
|
|
185
|
+
ldrh r5, [$sIn, #_so]
|
|
186
|
+
xorrol r1, lr, 11
|
|
187
|
+
xorrol r2, r9, 4
|
|
188
|
+
xorrol r3, r10, 10
|
|
189
|
+
xorrol r4, r11, 15
|
|
190
|
+
xorrol r5, r12, 8
|
|
191
|
+
xandnot $sOut, _ma, r1, r2, r3, r6
|
|
192
|
+
xandnot $sOut, _me, r2, r3, r4, r6
|
|
193
|
+
xandnot $sOut, _mi, r3, r4, r5, r6
|
|
194
|
+
xandnot $sOut, _mo, r4, r5, r1, r6
|
|
195
|
+
xandnot $sOut, _mu, r5, r1, r2, r6
|
|
196
|
+
eor r7, r7, r6
|
|
197
|
+
|
|
198
|
+
ldrh r1, [$sIn, #_bi]
|
|
199
|
+
ldrh r2, [$sIn, #_go]
|
|
200
|
+
ldrh r3, [$sIn, #_ku]
|
|
201
|
+
ldrh r4, [$sIn, #_ma]
|
|
202
|
+
ldrh r5, [$sIn, #_se]
|
|
203
|
+
xorrol r1, r11, 14
|
|
204
|
+
xorrol r2, r12, 7
|
|
205
|
+
xorrol r3, lr, 7
|
|
206
|
+
xorrol r4, r9, 9
|
|
207
|
+
xorrol r5, r10, 2
|
|
208
|
+
xandnot $sOut, _sa, r1, r2, r3, r9
|
|
209
|
+
xandnot $sOut, _se, r2, r3, r4, r10
|
|
210
|
+
xandnot $sOut, _si, r3, r4, r5, r11
|
|
211
|
+
xandnot $sOut, _so, r4, r5, r1, r12
|
|
212
|
+
bic r1, r2, r1
|
|
213
|
+
eor r5, r5, r1
|
|
214
|
+
eor r7, r7, r5
|
|
215
|
+
uxth r7, r7
|
|
216
|
+
strh r5, [$sOut, #_su]
|
|
217
|
+
uxth r5, r5
|
|
218
|
+
MEND
|
|
219
|
+
|
|
220
|
+
;----------------------------------------------------------------------------
|
|
221
|
+
;
|
|
222
|
+
; void KeccakP400_StaticInitialize( void )
|
|
223
|
+
;
|
|
224
|
+
ALIGN
|
|
225
|
+
EXPORT KeccakP400_StaticInitialize
|
|
226
|
+
KeccakP400_StaticInitialize PROC
|
|
227
|
+
bx lr
|
|
228
|
+
ENDP
|
|
229
|
+
|
|
230
|
+
;----------------------------------------------------------------------------
|
|
231
|
+
;
|
|
232
|
+
; void KeccakP400_Initialize(void *state)
|
|
233
|
+
;
|
|
234
|
+
ALIGN
|
|
235
|
+
EXPORT KeccakP400_Initialize
|
|
236
|
+
KeccakP400_Initialize PROC
|
|
237
|
+
movs r1, #0
|
|
238
|
+
movs r2, #0
|
|
239
|
+
movs r3, #0
|
|
240
|
+
stmia r0!, { r1 - r3 }
|
|
241
|
+
stmia r0!, { r1 - r3 }
|
|
242
|
+
stmia r0!, { r1 - r3 }
|
|
243
|
+
stmia r0!, { r1 - r3 }
|
|
244
|
+
strh r1, [r0]
|
|
245
|
+
bx lr
|
|
246
|
+
ENDP
|
|
247
|
+
|
|
248
|
+
; ----------------------------------------------------------------------------
|
|
249
|
+
;
|
|
250
|
+
; void KeccakP400_AddByte(void *state, unsigned char byte, unsigned int offset)
|
|
251
|
+
;
|
|
252
|
+
ALIGN
|
|
253
|
+
EXPORT KeccakP400_AddByte
|
|
254
|
+
KeccakP400_AddByte PROC
|
|
255
|
+
ldrb r3, [r0, r2]
|
|
256
|
+
eors r3, r3, r1
|
|
257
|
+
strb r3, [r0, r2]
|
|
258
|
+
bx lr
|
|
259
|
+
ENDP
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
;----------------------------------------------------------------------------
|
|
263
|
+
;
|
|
264
|
+
; void KeccakP400_AddBytes(void *state, const unsigned char *data, unsigned int offset, unsigned int length)
|
|
265
|
+
;
|
|
266
|
+
ALIGN
|
|
267
|
+
EXPORT KeccakP400_AddBytes
|
|
268
|
+
KeccakP400_AddBytes PROC
|
|
269
|
+
subs r3, r3, #1
|
|
270
|
+
bcc KeccakP400_AddBytes_Exit
|
|
271
|
+
adds r0, r0, r2
|
|
272
|
+
push {r4,lr}
|
|
273
|
+
KeccakP400_AddBytes_Loop
|
|
274
|
+
ldrb r2, [r1, r3]
|
|
275
|
+
ldrb r4, [r0, r3]
|
|
276
|
+
eors r2, r2, r4
|
|
277
|
+
strb r2, [r0, r3]
|
|
278
|
+
subs r3, r3, #1
|
|
279
|
+
bcs KeccakP400_AddBytes_Loop
|
|
280
|
+
pop {r4,pc}
|
|
281
|
+
KeccakP400_AddBytes_Exit
|
|
282
|
+
bx lr
|
|
283
|
+
ENDP
|
|
284
|
+
|
|
285
|
+
; ----------------------------------------------------------------------------
|
|
286
|
+
;
|
|
287
|
+
; void KeccakP400_OverwriteBytes(void *state, const unsigned char *data, unsigned int offset, unsigned int length)
|
|
288
|
+
;
|
|
289
|
+
ALIGN
|
|
290
|
+
EXPORT KeccakP400_OverwriteBytes
|
|
291
|
+
KeccakP400_OverwriteBytes PROC
|
|
292
|
+
subs r3, r3, #1
|
|
293
|
+
bcc KeccakP400_OverwriteBytes_Exit
|
|
294
|
+
adds r0, r0, r2
|
|
295
|
+
KeccakP400_OverwriteBytes_Loop
|
|
296
|
+
ldrb r2, [r1, r3]
|
|
297
|
+
strb r2, [r0, r3]
|
|
298
|
+
subs r3, r3, #1
|
|
299
|
+
bcs KeccakP400_OverwriteBytes_Loop
|
|
300
|
+
KeccakP400_OverwriteBytes_Exit
|
|
301
|
+
bx lr
|
|
302
|
+
ENDP
|
|
303
|
+
|
|
304
|
+
;----------------------------------------------------------------------------
|
|
305
|
+
;
|
|
306
|
+
; void KeccakP400_OverwriteWithZeroes(void *state, unsigned int byteCount)
|
|
307
|
+
;
|
|
308
|
+
ALIGN
|
|
309
|
+
EXPORT KeccakP400_OverwriteWithZeroes
|
|
310
|
+
KeccakP400_OverwriteWithZeroes PROC
|
|
311
|
+
movs r3, #0
|
|
312
|
+
lsrs r2, r1, #2
|
|
313
|
+
beq KeccakP400_OverwriteWithZeroes_Bytes
|
|
314
|
+
KeccakP400_OverwriteWithZeroes_Loop2Lanes
|
|
315
|
+
str r3, [r0], #4
|
|
316
|
+
subs r2, r2, #1
|
|
317
|
+
bne KeccakP400_OverwriteWithZeroes_Loop2Lanes
|
|
318
|
+
KeccakP400_OverwriteWithZeroes_Bytes
|
|
319
|
+
ands r1, #3
|
|
320
|
+
beq KeccakP400_OverwriteWithZeroes_Exit
|
|
321
|
+
KeccakP400_OverwriteWithZeroes_LoopBytes
|
|
322
|
+
strb r3, [r0], #1
|
|
323
|
+
subs r1, r1, #1
|
|
324
|
+
bne KeccakP400_OverwriteWithZeroes_LoopBytes
|
|
325
|
+
KeccakP400_OverwriteWithZeroes_Exit
|
|
326
|
+
bx lr
|
|
327
|
+
ENDP
|
|
328
|
+
|
|
329
|
+
; ----------------------------------------------------------------------------
|
|
330
|
+
;
|
|
331
|
+
; void KeccakP400_ExtractBytes(void *state, const unsigned char *data, unsigned int offset, unsigned int length)
|
|
332
|
+
;
|
|
333
|
+
ALIGN
|
|
334
|
+
EXPORT KeccakP400_ExtractBytes
|
|
335
|
+
KeccakP400_ExtractBytes PROC
|
|
336
|
+
subs r3, r3, #1
|
|
337
|
+
bcc KeccakP400_ExtractBytes_Exit
|
|
338
|
+
adds r0, r0, r2
|
|
339
|
+
KeccakP400_ExtractBytes_Loop
|
|
340
|
+
ldrb r2, [r0, r3]
|
|
341
|
+
strb r2, [r1, r3]
|
|
342
|
+
subs r3, r3, #1
|
|
343
|
+
bcs KeccakP400_ExtractBytes_Loop
|
|
344
|
+
KeccakP400_ExtractBytes_Exit
|
|
345
|
+
bx lr
|
|
346
|
+
ENDP
|
|
347
|
+
|
|
348
|
+
; ----------------------------------------------------------------------------
|
|
349
|
+
;
|
|
350
|
+
; void KeccakP400_ExtractAndAddBytes(void *state, const unsigned char *input, unsigned char *output, unsigned int offset, unsigned int length)
|
|
351
|
+
;
|
|
352
|
+
ALIGN
|
|
353
|
+
EXPORT KeccakP400_ExtractAndAddBytes
|
|
354
|
+
KeccakP400_ExtractAndAddBytes PROC
|
|
355
|
+
push {r4,r5}
|
|
356
|
+
adds r0, r0, r3 ; state += offset (offset register no longer needed, reuse for length)
|
|
357
|
+
ldr r3, [sp, #8] ; get length argument from stack
|
|
358
|
+
subs r3, r3, #1 ; if length != 0
|
|
359
|
+
bcc KeccakP400_ExtractAndAddBytes_Exit
|
|
360
|
+
KeccakP400_ExtractAndAddBytes_Loop
|
|
361
|
+
ldrb r5, [r0, r3]
|
|
362
|
+
ldrb r4, [r1, r3]
|
|
363
|
+
eors r5, r5, r4
|
|
364
|
+
strb r5, [r2, r3]
|
|
365
|
+
subs r3, r3, #1
|
|
366
|
+
bcs KeccakP400_ExtractAndAddBytes_Loop
|
|
367
|
+
KeccakP400_ExtractAndAddBytes_Exit
|
|
368
|
+
pop {r4,r5}
|
|
369
|
+
bx lr
|
|
370
|
+
ENDP
|
|
371
|
+
|
|
372
|
+
;----------------------------------------------------------------------------
|
|
373
|
+
;
|
|
374
|
+
; void KeccakP400_Permute_Nrounds( void *state, unsigned int nr )
|
|
375
|
+
;
|
|
376
|
+
ALIGN
|
|
377
|
+
EXPORT KeccakP400_Permute_Nrounds
|
|
378
|
+
KeccakP400_Permute_Nrounds PROC
|
|
379
|
+
push {r4-r12,lr}
|
|
380
|
+
sub sp, sp, #2*25+6
|
|
381
|
+
adr r8, KeccakP400_Permute_RoundConstants
|
|
382
|
+
sub r8, r8, r1, LSL #1
|
|
383
|
+
lsls r1, r1, #31
|
|
384
|
+
beq KeccakP400_PermuteIntern
|
|
385
|
+
mov r1, sp ; odd number of rounds
|
|
386
|
+
ldm r0!, { r2, r3, r4, r5, r11, r12 } ; copy state to stack
|
|
387
|
+
stm r1!, { r2, r3, r4, r5, r11, r12 }
|
|
388
|
+
ldm r0!, { r2, r3, r4, r5, r11, r12 }
|
|
389
|
+
stm r1!, { r2, r3, r4, r5, r11, r12 }
|
|
390
|
+
sub r0, r0, #2*24
|
|
391
|
+
ldrh lr, [r0, #_su]
|
|
392
|
+
strh lr, [sp, #_su]
|
|
393
|
+
uxth r9, r11
|
|
394
|
+
uxth r10, r11, ROR #16
|
|
395
|
+
uxth r11, r12
|
|
396
|
+
lsr r12, r12, #16
|
|
397
|
+
mov r5, lr
|
|
398
|
+
xor5 r7, r0, _bu, _gu, _ku, _mu, lr
|
|
399
|
+
b KeccakP400_Permute_RoundOdd
|
|
400
|
+
ENDP
|
|
401
|
+
|
|
402
|
+
;----------------------------------------------------------------------------
|
|
403
|
+
;
|
|
404
|
+
; void KeccakP400_Permute_20rounds( void *state )
|
|
405
|
+
;
|
|
406
|
+
ALIGN
|
|
407
|
+
EXPORT KeccakP400_Permute_20rounds
|
|
408
|
+
KeccakP400_Permute_20rounds PROC
|
|
409
|
+
push {r4-r12,lr}
|
|
410
|
+
sub sp, sp, #2*25+6
|
|
411
|
+
adr r8, KeccakP400_Permute_RoundConstants20
|
|
412
|
+
KeccakP400_PermuteIntern
|
|
413
|
+
ldrh r9, [r0, #_sa]
|
|
414
|
+
ldrh r10, [r0, #_se]
|
|
415
|
+
ldrh r11, [r0, #_si]
|
|
416
|
+
ldrh lr, [r0, #_su]
|
|
417
|
+
ldrh r12, [r0, #_so]
|
|
418
|
+
mov r5, lr
|
|
419
|
+
xor5 r7, r0, _bu, _gu, _ku, _mu, lr
|
|
420
|
+
KeccakP400_Permute_RoundLoop
|
|
421
|
+
KeccakRound sp, r0
|
|
422
|
+
KeccakP400_Permute_RoundOdd
|
|
423
|
+
KeccakRound r0, sp
|
|
424
|
+
ldrh r3, [r8]
|
|
425
|
+
cmp r3, #0
|
|
426
|
+
bne KeccakP400_Permute_RoundLoop
|
|
427
|
+
add sp,sp,#2*25+6
|
|
428
|
+
pop {r4-r12,pc}
|
|
429
|
+
ALIGN
|
|
430
|
+
KeccakP400_Permute_RoundConstants20
|
|
431
|
+
dcw 0x0001
|
|
432
|
+
dcw 0x8082
|
|
433
|
+
dcw 0x808a
|
|
434
|
+
dcw 0x8000
|
|
435
|
+
dcw 0x808b
|
|
436
|
+
dcw 0x0001
|
|
437
|
+
dcw 0x8081
|
|
438
|
+
dcw 0x8009
|
|
439
|
+
dcw 0x008a
|
|
440
|
+
dcw 0x0088
|
|
441
|
+
dcw 0x8009
|
|
442
|
+
dcw 0x000a
|
|
443
|
+
dcw 0x808b
|
|
444
|
+
dcw 0x008b
|
|
445
|
+
dcw 0x8089
|
|
446
|
+
dcw 0x8003
|
|
447
|
+
dcw 0x8002
|
|
448
|
+
dcw 0x0080
|
|
449
|
+
dcw 0x800a
|
|
450
|
+
dcw 0x000a
|
|
451
|
+
KeccakP400_Permute_RoundConstants
|
|
452
|
+
dcw 0 ; terminator
|
|
453
|
+
ENDP
|
|
454
|
+
|
|
455
|
+
END
|