Skip to content

Commit

Permalink
Remove Keccak-f[200], [400] and [800]
Browse files Browse the repository at this point in the history
  • Loading branch information
gvanas committed Feb 23, 2024
1 parent fa7033a commit 239d0ac
Show file tree
Hide file tree
Showing 58 changed files with 25 additions and 15,423 deletions.
42 changes: 21 additions & 21 deletions Makefile.build
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ http://creativecommons.org/publicdomain/zero/1.0/
<!-- *** Targets *** -->

<!-- Reference implementations -->
<fragment name="reference" inherits="K200-ref K400-ref K800-ref K1600-ref-64bits Xoodoo-ref">
<fragment name="reference" inherits="K1600-ref-64bits Xoodoo-ref">
<c>tests/UnitTests/displayIntermediateValues.c</c>
<h>tests/UnitTests/displayIntermediateValues.h</h>
<define>KeccakReference</define>
Expand All @@ -121,7 +121,7 @@ http://creativecommons.org/publicdomain/zero/1.0/

<!-- Reference implementations dedicated to 32-bit platforms
(i.e., featuring bit interleaving for Keccak-p[1600]) -->
<fragment name="reference32bits" inherits="K200-ref K400-ref K800-ref K1600-ref-32bits Xoodoo-ref">
<fragment name="reference32bits" inherits="K1600-ref-32bits Xoodoo-ref">
<c>tests/UnitTests/displayIntermediateValues.c</c>
<h>tests/UnitTests/displayIntermediateValues.h</h>
<define>KeccakReference</define>
Expand All @@ -130,55 +130,55 @@ http://creativecommons.org/publicdomain/zero/1.0/
</fragment>

<!-- Compact implementations -->
<fragment name="compact" inherits="K200-compact K400-ref K800-compact K1600-compact Xoodoo-plain-ua"/>
<fragment name="compact" inherits="K1600-compact Xoodoo-plain-ua"/>

<!-- Generically optimized 32-bit implementations -->
<fragment name="generic32" inherits="K200-ref K400-ref K800-plain-u2 K1600-plain-32bits-inplace Xoodoo-plain-ua"/>
<fragment name="generic32" inherits="K1600-plain-32bits-inplace Xoodoo-plain-ua"/>
<!-- Generically optimized 32-bit implementations, featuring lane complementing -->
<fragment name="generic32lc" inherits="K200-ref K400-ref K800-plain-lcu2 K1600-plain-32bits-inplace Xoodoo-plain-ua"/>
<fragment name="generic32lc" inherits="K1600-plain-32bits-inplace Xoodoo-plain-ua"/>

<!-- Generically optimized 64-bit implementations -->
<fragment name="generic64" inherits="K200-ref K400-ref K800-plain-ua K1600-plain-64bits-ua Xoodoo-plain-ua"/>
<fragment name="generic64" inherits="K1600-plain-64bits-ua Xoodoo-plain-ua"/>
<!-- Generically optimized 64-bit implementations, featuring lane complementing -->
<fragment name="generic64lc" inherits="K200-ref K400-ref K800-plain-lcua K1600-plain-64bits-lcua Xoodoo-plain-ua"/>
<fragment name="generic64lc" inherits="K1600-plain-64bits-lcua Xoodoo-plain-ua"/>

<!-- Implementations selected for the processors that support the SSSE3 instruction set -->
<fragment name="SSSE3" inherits="K200-ref K400-ref K800-plain-lcua K1600-plain-64bits-lcua K1600x2-SSSE3-u2 Xoodoo-SSE2 Xoodoox4-SSSE3"/>
<fragment name="SSSE3" inherits="K1600-plain-64bits-lcua K1600x2-SSSE3-u2 Xoodoo-SSE2 Xoodoox4-SSSE3"/>

<!-- Implementations selected for processors that support the AVX instruction set (e.g., Sandy Bridge microarchitectures) -->
<fragment name="AVX" inherits="K200-ref K400-ref K800-plain-lcua K1600-plain-64bits-lcua-shld K1600x2-SSSE3-ua Xoodoo-SSE2 Xoodoox4-SSSE3">
<!-- Implementations selected for processors that support the AVX instruction set (e.g., Sandy Bridge microarchitectures) -->
<fragment name="AVX" inherits="K1600-plain-64bits-lcua-shld K1600x2-SSSE3-ua Xoodoo-SSE2 Xoodoox4-SSSE3">
<msvc>/arch:AVX</msvc>
</fragment>
<!-- Implementations selected for processors that support the XOP instruction set (e.g., Bulldozer microarchitecture) -->
<fragment name="XOP" inherits="K200-ref K400-ref K800-plain-lcua K1600-XOP-ua K1600x2-XOP-ua Xoodoo-SSE2 Xoodoox4-SSSE3"/>
<fragment name="XOP" inherits="K1600-XOP-ua K1600x2-XOP-ua Xoodoo-SSE2 Xoodoox4-SSSE3"/>
<!-- Implementations selected for processors that support the AVX2 instruction set (e.g., Haswell and Skylake microarchitectures) -->
<fragment name="AVX2" inherits="K200-ref K400-ref K800-plain-ua K1600-AVX2 K1600x2-SSSE3-u2 K1600x4-AVX2-u12 Xoodoo-SSE2 Xoodoox4-SSSE3 Xoodoox8-AVX2"/>
<fragment name="AVX2" inherits="K1600-AVX2 K1600x2-SSSE3-u2 K1600x4-AVX2-u12 Xoodoo-SSE2 Xoodoox4-SSSE3 Xoodoox8-AVX2"/>
<!-- Same, but without the assembly file (for MS Visual Studio) -->
<fragment name="AVX2noAsm" inherits="K200-ref K400-ref K800-plain-ua K1600-plain-64bits-ua K1600x2-SSSE3-u2 K1600x4-AVX2-u12 Xoodoo-SSE2 Xoodoox4-SSSE3 Xoodoox8-AVX2">
<fragment name="AVX2noAsm" inherits="K1600-plain-64bits-ua K1600x2-SSSE3-u2 K1600x4-AVX2-u12 Xoodoo-SSE2 Xoodoox4-SSSE3 Xoodoox8-AVX2">
<msvc>/arch:AVX2</msvc>
</fragment>

<!-- Implementations selected for the processors that support the AVX-512 instruction set (e.g., SkylakeX microarchitecture) -->
<fragment name="AVX512" inherits="K200-ref K400-ref K800-plain-ua K1600-AVX512 K1600x2-AVX512-u12 K1600x4-AVX512-u12 K1600x8-AVX512-u12 Xoodoo-AVX512 Xoodoox4-AVX512 Xoodoox8-AVX512 Xoodoox16-AVX512"/>
<fragment name="AVX512" inherits="K1600-AVX512 K1600x2-AVX512-u12 K1600x4-AVX512-u12 K1600x8-AVX512-u12 Xoodoo-AVX512 Xoodoox4-AVX512 Xoodoox8-AVX512 Xoodoox16-AVX512"/>
<!-- Same, but without the assembly file (for MS Visual Studio) -->
<fragment name="AVX512noAsm" inherits="K200-ref K400-ref K800-plain-ua K1600-AVX512-C K1600x2-AVX512-u12 K1600x4-AVX512-u12 K1600x8-AVX512-u12 Xoodoo-AVX512 Xoodoox4-AVX512 Xoodoox8-AVX512 Xoodoox16-AVX512">
<fragment name="AVX512noAsm" inherits="K1600-AVX512-C K1600x2-AVX512-u12 K1600x4-AVX512-u12 K1600x8-AVX512-u12 Xoodoo-AVX512 Xoodoox4-AVX512 Xoodoox8-AVX512 Xoodoox16-AVX512">
<msvc>/arch:AVX512</msvc>
</fragment>

<!-- Implementations selected for ARMv6 -->
<fragment name="ARMv6" inherits="K200-ARMv6M K400-ARMv6M K800-ARMv6M-u2 K1600-ARMv6M-u2 Xoodoo-ARMv6"/>
<fragment name="ARMv6" inherits="K1600-ARMv6M-u2 Xoodoo-ARMv6"/>
<!-- Implementations selected for ARMv6M -->
<fragment name="ARMv6M" inherits="K200-ARMv6M K400-ARMv6M K800-ARMv6M-u2 K1600-ARMv6M-u2 Xoodoo-ARMv6M"/>
<fragment name="ARMv6M" inherits="K1600-ARMv6M-u2 Xoodoo-ARMv6M"/>
<!-- Implementations selected for ARMv7M -->
<fragment name="ARMv7M" inherits="K200-ARMv7M K400-ARMv7M K800-ARMv7M-u2 K1600-ARMv7M-inplace Xoodoo-ARMv7M"/>
<fragment name="ARMv7M" inherits="K1600-ARMv7M-inplace Xoodoo-ARMv7M"/>
<!-- Implementations selected for ARMv7A -->
<fragment name="ARMv7A" inherits="K200-ref K400-ref K800-ARMv7A-u2 K1600-ARMv7A-NEON K1600x2-ARMv7A-NEON Xoodoo-ARMv7A-NEON Xoodoox4-ARMv7A-NEON"/>
<fragment name="ARMv7A" inherits="K1600-ARMv7A-NEON K1600x2-ARMv7A-NEON Xoodoo-ARMv7A-NEON Xoodoox4-ARMv7A-NEON"/>

<!-- Implementations selected for ARMv8A -->
<fragment name="ARMv8A" inherits="K200-ref K400-ref K800-plain-ua K1600-plain-64bits-ua Xoodoo-plain-ua"/>
<fragment name="ARMv8A" inherits="K1600-plain-64bits-ua Xoodoo-plain-ua"/>

<!-- Implementations selected for 8-bit AVR -->
<fragment name="AVR8" inherits="K200-AVR8 K400-AVR8 K800-AVR8 K1600-AVR8 Xoodoo-AVR8"/>
<fragment name="AVR8" inherits="K1600-AVR8 Xoodoo-AVR8"/>

<!-- Target names are of the form x/y where x is taken from the first set and y from the second set. -->
<group all="XKCP">
Expand Down
5 changes: 1 addition & 4 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,11 @@ When used as a library or directly from the sources, the XKCP offers the high-le

## Low-level services

The low-level services implement the different permutations Keccak-_f_[200 to 1600] and Keccak-_p_[200 to 1600]. Note that these two permutation families are closely related. In Keccak-_p_ the number of rounds is a parameter while in Keccak-_f_ it is fixed. As Keccak-_f_ are just instances of Keccak-_p_, we focus on the latter here.
The low-level services implement the different permutations Keccak-_f_[1600], Keccak-_p_[1600, 12 rounds] and Xoodoo.

The low-level services provide an opaque representation of the state together with functions to add data into and extract data from the state. Together with the permutations themselves, the low-level services implement what we call the **state and permutation** interface (abbreviated **SnP**). For parallelized implementation, we similarly use the **parallel** state and permutation interface or **PlSnP**.

* In [`lib/low/`](lib/low/), one can find implementations of the following permutations for different platforms.
+ [`lib/low/KeccakP-200/`](lib/low/KeccakP-200/) for Keccak-_p_[200].
+ [`lib/low/KeccakP-400/`](lib/low/KeccakP-400/), for Keccak-_p_[400].
+ [`lib/low/KeccakP-800/`](lib/low/KeccakP-800/), for Keccak-_p_[800].
+ [`lib/low/KeccakP-1600/`](lib/low/KeccakP-1600/), for Keccak-_p_[1600]. This is the one used in the six approved FIPS 202 instances.
+ [`lib/low/Xoodoo/`](lib/low/Xoodoo/), for Xoodoo.

Expand Down
9 changes: 0 additions & 9 deletions doc/HOWTO-customize.build
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ Please refer to lib/HighLevel.build for the list of supported cryptographic func
Then, identify the permutations that the chosen cryptographic functions need.
Each cryptographic function implemented in the XKCP depends on a given permutation. It interacts with the permutation through an interface called SnP. Some functions further can take advantage of a parallel implementation of the permutation, in which case the interface is called PlSnP. The choice of high-level services therefore determines what we need as low-level services:
* Those that require Keccak-p[200]: Keccak{Sponge, Duplex, PRG} with rate + capacity = 200
* Those that require Keccak-p[400]: Keccak{Sponge, Duplex, PRG} with rate + capacity = 400
* Those that require Keccak-p[800]: Keccak{Sponge, Duplex, PRG} with rate + capacity = 800
* Those that require Keccak-p[1600]: Kravatte, KangarooTwelve, FIPS202, SP800-185, Keccak{Sponge, Duplex, PRG} with rate + capacity = 1600
* Those that require Xoodoo: Xoofff, Xoodyak
Expand All @@ -64,12 +61,6 @@ Please refer to the file lib/LowLevel.build for the list of supported implementa

<!-- Examples -->

<!-- Type "make PRG-AVR8.pack" to get a tarball with the sources needed to compile a pseudo-random number generator on top of Keccak-f[200] for AVR8. -->
<target name="PRG-AVR8" inherits="KeccakPRG K200-AVR8"/>

<!-- Type "make libKeccak-16bits.a" to compile a library with Keccak sponge, duplex and PRG on top of Keccak-f[400], using plain reference code. Add ".pack" when invoking make to get a tarball with the source files instead. -->
<target name="libKeccak-16bits.a" inherits="KeccakSponge KeccakDuplex KeccakPRG K400-ref"/>

<!-- Type "make Xoodyak-ARMv7M.pack" to get a tarball with the sources needed to compile Xoodyak on ARMv7M. -->
<target name="Xoodyak-ARMv7M" inherits="Xoodyak Xoodoo-ARMv7M"/>

Expand Down
Binary file modified doc/figures/Layers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions doc/figures/Layers.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
166 changes: 0 additions & 166 deletions lib/LowLevel.build
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,6 @@ http://creativecommons.org/publicdomain/zero/1.0/
<!--
The fragments below allow to select the desired implementation of the permutations (a.k.a. low-level services below the SnP or PlSnP interface).
# For Keccak-p[200]:
* K200-ref: the unoptimized reference implementation
* K200-compact: an implementation aimed at minimizing code and memory sizes
* K200-ARMv6M: an assembly-optimized implementation for ARMv6M
* K200-ARMv7M: an assembly-optimized implementation for ARMv7M
* K200-AVR8: an assembly-optimized implementation for AVR8
# For Keccak-p[400]:
* K400-ref: the unoptimized reference implementation
* K400-ARMv6M: an assembly-optimized implementation for ARMv6M
* K400-ARMv7M: an assembly-optimized implementation for ARMv7M
* K400-AVR8: an assembly-optimized implementation for AVR8
# For Keccak-p[800]:
* K800-ref: the unoptimized reference implementation
* K800-compact: an implementation aimed at minimizing code and memory sizes
* K800-plain-u2: an optimized implementation for 32-bit platforms in plain C with 2 rounds unrolled
* K800-plain-ua: same as K800-plain-u2 but with all rounds unrolled
* K800-plain-lcu2: same as K800-plain-u2 but using the lane complementing technique, which is useful for platforms that do not have a "and not" instruction
* K800-plain-lcua: same as K800-plain-lcu2 but with all rounds unrolled
* K800-ARMv6M-u1: an assembly-optimized implementation for ARMv6M (no round unrolling)
* K800-ARMv6M-u2: same as K800-ARMv6M-u1 but with 2 rounds unrolled
* K800-ARMv7M-u2: an assembly-optimized implementation for ARMv7M with 2 rounds unrolled
* K800-ARMv7M-ua: same as K800-ARMv7M-u2 but with all rounds unrolled
* K800-ARMv7A-u2: an assembly-optimized implementation for ARMv7A with 2 rounds unrolled
* K800-ARMv8A: an assembly-optimized implementation for ARMv8A [obsolete: a plain C implementation is much faster]
* K800-AVR8: an assembly-optimized implementation for AVR8
# For Keccak-p[1600]:
* K1600-ref-64bits: the unoptimized reference implementation
Expand Down Expand Up @@ -153,141 +122,6 @@ The fragments below allow to select the desired implementation of the permutatio
<gcc>-mtune=native</gcc>
</fragment>

<!-- Keccak-p[200] -->

<fragment name="K200">
<config>XKCP_has_KeccakP200</config>
</fragment>

<fragment name="K200-ref" inherits="common K200">
<c>lib/low/KeccakP-200/ref/KeccakP-200-reference.c</c>
<h>lib/low/KeccakP-200/ref/KeccakP-200-reference.h</h>
<h>lib/low/KeccakP-200/ref/KeccakP-200-SnP.h</h>
</fragment>

<fragment name="K200-compact" inherits="common optimized K200">
<c>lib/low/KeccakP-200/compact/KeccakP-200-compact.c</c>
<h>lib/low/KeccakP-200/compact/KeccakP-200-SnP.h</h>
</fragment>

<fragment name="K200-ARMv6M" inherits="common optimized K200">
<s>lib/low/KeccakP-200/ARM/KeccakP-200-armv6m-le-gcc.s</s>
<h>lib/low/KeccakP-200/ARM/KeccakP-200-SnP.h</h>
</fragment>

<fragment name="K200-ARMv7M" inherits="common optimized K200">
<c>lib/low/KeccakP-200/ARM/KeccakP-200-armv7m-le-gcc.s</c>
<h>lib/low/KeccakP-200/ARM/KeccakP-200-SnP.h</h>
</fragment>

<fragment name="K200-AVR8" inherits="common optimized K200">
<s>lib/low/KeccakP-200/AVR8/KeccakP-200-avr8-fast.s</s>
<h>lib/low/KeccakP-200/AVR8/KeccakP-200-SnP.h</h>
</fragment>

<!-- Keccak-p[400] -->

<fragment name="K400">
<config>XKCP_has_KeccakP400</config>
</fragment>

<fragment name="K400-ref" inherits="common K400">
<c>lib/low/KeccakP-400/ref/KeccakP-400-reference.c</c>
<h>lib/low/KeccakP-400/ref/KeccakP-400-reference.h</h>
<h>lib/low/KeccakP-400/ref/KeccakP-400-SnP.h</h>
</fragment>

<fragment name="K400-ARMv6M" inherits="common optimized K400">
<s>lib/low/KeccakP-400/ARM/KeccakP-400-armv6m-le-gcc.s</s>
<h>lib/low/KeccakP-400/ARM/KeccakP-400-SnP.h</h>
</fragment>

<fragment name="K400-ARMv7M" inherits="common optimized K400">
<s>lib/low/KeccakP-400/ARM/KeccakP-400-armv7m-le-gcc.s</s>
<h>lib/low/KeccakP-400/ARM/KeccakP-400-SnP.h</h>
</fragment>

<fragment name="K400-AVR8" inherits="common optimized K400">
<s>lib/low/KeccakP-400/AVR8/KeccakP-400-avr8-fast.s</s>
<h>lib/low/KeccakP-400/AVR8/KeccakP-400-SnP.h</h>
</fragment>

<!-- Keccak-p[800] -->

<fragment name="K800">
<config>XKCP_has_KeccakP800</config>
</fragment>

<fragment name="K800-ref" inherits="common K800">
<c>lib/low/KeccakP-800/ref/KeccakP-800-reference.c</c>
<h>lib/low/KeccakP-800/ref/KeccakP-800-reference.h</h>
<h>lib/low/KeccakP-800/ref/KeccakP-800-SnP.h</h>
</fragment>

<fragment name="K800-compact" inherits="common optimized K800">
<c>lib/low/KeccakP-800/compact/KeccakP-800-compact.c</c>
<h>lib/low/KeccakP-800/compact/KeccakP-800-SnP.h</h>
</fragment>

<fragment name="K800-plain" inherits="K800 optimized">
<h>lib/low/KeccakP-800/plain/KeccakP-800-SnP.h</h>
<inc>lib/low/KeccakP-800/plain/KeccakP-800-opt32-bis.macros</inc>
<c>lib/low/KeccakP-800/plain/KeccakP-800-opt32.c</c>
<inc>lib/low/KeccakP-800/plain/KeccakP-800-opt32.macros</inc>
<inc>lib/low/KeccakP-800/plain/KeccakP-800-unrolling-bis.macros</inc>
<inc>lib/low/KeccakP-800/plain/KeccakP-800-unrolling.macros</inc>
</fragment>

<fragment name="K800-plain-u2" inherits="K800-plain">
<h>lib/low/KeccakP-800/plain/u2/KeccakP-800-opt32-config.h</h>
</fragment>

<fragment name="K800-plain-ua" inherits="K800-plain">
<h>lib/low/KeccakP-800/plain/ua/KeccakP-800-opt32-config.h</h>
</fragment>

<fragment name="K800-plain-lcu2" inherits="K800-plain">
<h>lib/low/KeccakP-800/plain/lcu2/KeccakP-800-opt32-config.h</h>
</fragment>

<fragment name="K800-plain-lcua" inherits="K800-plain">
<h>lib/low/KeccakP-800/plain/lcua/KeccakP-800-opt32-config.h</h>
</fragment>

<fragment name="K800-ARM" inherits="common optimized K800">
<h>lib/low/KeccakP-800/ARM/KeccakP-800-SnP.h</h>
</fragment>

<fragment name="K800-ARMv6M-u1" inherits="K800-ARM">
<s>lib/low/KeccakP-800/ARM/KeccakP-800-u1-armv6m-le-gcc.s</s>
</fragment>

<fragment name="K800-ARMv6M-u2" inherits="K800-ARM">
<s>lib/low/KeccakP-800/ARM/KeccakP-800-u2-armv6m-le-gcc.s</s>
</fragment>

<fragment name="K800-ARMv7M-u2" inherits="K800-ARM">
<s>lib/low/KeccakP-800/ARM/KeccakP-800-u2-armv7m-le-gcc.s</s>
</fragment>

<fragment name="K800-ARMv7M-ua" inherits="K800-ARM">
<s>lib/low/KeccakP-800/ARM/KeccakP-800-uf-armv7m-le-gcc.s</s>
</fragment>

<fragment name="K800-ARMv7A-u2" inherits="K800-ARM">
<s>lib/low/KeccakP-800/ARM/KeccakP-800-u2-armv7a-le-gcc.s</s>
</fragment>

<fragment name="K800-ARMv8A" inherits="common optimized K800">
<s>lib/low/KeccakP-800/ARMv8A/KeccakP-800-armv8a-neon.s</s>
<h>lib/low/KeccakP-800/ARMv8A/KeccakP-800-SnP.h</h>
</fragment>

<fragment name="K800-AVR8" inherits="common optimized K800">
<s>lib/low/KeccakP-800/AVR8/KeccakP-800-avr8-fast.s</s>
<h>lib/low/KeccakP-800/AVR8/KeccakP-800-SnP.h</h>
</fragment>

<!-- Keccak-p[1600] -->

<fragment name="K1600">
Expand Down
Loading

0 comments on commit 239d0ac

Please sign in to comment.