Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,26 @@ CFLAGS = -Wall -Wextra -Wpedantic -O3 -g -march=native -fomit-frame-pointer -flt

%.o : %.cpp ; $(CPP) -c $(CFLAGS) $< -o $@

SOURCES = sphincs-fast.cpp sign.cpp xn_hash.cpp \
verify.cpp stl.cpp \
sha256_hash.cpp sha256_simple.cpp sha256_robust.cpp \
sha256.cpp mgf1_8x.cpp sha256avx.cpp \
SOURCES = slh-dsa-fast.cpp sign.cpp xn_hash.cpp \
verify.cpp stl.cpp prehash.cpp \
sha256_hash.cpp sha256_simple.cpp \
sha256.cpp sha256avx.cpp \
sha512_hash.cpp sha512.cpp mgf1_512_4x.cpp sha512avx.cpp \
sha512_simple.cpp sha512_robust.cpp \
shake256_hash.cpp shake256_simple.cpp shake256_robust.cpp \
sha512_simple.cpp \
shake256_hash.cpp shake256_simple.cpp \
fips202.cpp fips202x4.cpp \
keccak4x/KeccakP-1600-times4-SIMD256.o \
haraka_hash.cpp haraka_simple.cpp haraka_robust.cpp \
haraka.cpp \
rdrand.cpp \
wots.cpp geo.cpp address.cpp utils.cpp
OBJECTS = $(subst .cpp,.o,$(SOURCES))
HEADERS = api.h internal.h mgf1_8x.h sha256avx.h xn_internal.h \
HEADERS = api.h internal.h sha256avx.h xn_internal.h \
fips202.h fips202x4.h
TEST_SOURCES = test_sphincs.cpp test_keygen.cpp test_sign.cpp \
test_verify.cpp test_thread.cpp test_testvector.cpp \
test_sha512.cpp
test_verify.cpp test_thread.cpp test_testvector_sign.cpp \
test_testvector_keygen.cpp \
test_sha512.cpp test_context.cpp

TESTS = test PQCgenKAT_sign test_sphincs
TESTS = test test_slh_dsa

.PHONY: test

Expand All @@ -35,15 +34,19 @@ all: test

tests: $(TESTS)

sphincs-fast.a: $(OBJECTS)
slh-dsa-fast.a: $(OBJECTS)
ar rcs $@ $^

test: test.cpp $(OBJECTS)
$(CPP) $(CFLAGS) -o $@ $< $(OBJECTS) -lpthread

test_sphincs: $(TEST_SOURCES) $(OBJECTS)
test_slh_dsa: $(TEST_SOURCES) $(OBJECTS)
$(CPP) $(CFLAGS) -o $@ $(TEST_SOURCES) $(OBJECTS) -lpthread

# The github action expects 'test_sphincs'
test_sphincs: test_slh_dsa
cp test_slh_dsa test_sphincs

PQCgenKAT_sign: PQCgenKAT_sign.o nist/nist_api.cpp rng.o $(OBJECTS) $(DET_HEADERS)
$(CPP) $(CFLAGS) -o $@ $(OBJECTS) nist/nist_api.cpp rng.o $< -lcrypto -lpthread

Expand Down
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
## A multithreaded implementation of the Sphincs+ signature algorithm
## A multithreaded implementation of the SLH-DSA signature algorithm

This repository contains an alternative implementation of the Sphincs+ signature system (as of round 3 of the NIST competition
This repository contains an alternative implementation of the SLH-DSA signature system (FIPS 205)

The specific features that this implements (that the reference code doesn't):

- It is multithreaded; that is, it can split the job of producing a signature over several threads

- It can support multiple parameter sets at once

It does assume that you have the AVX2 and AES_NI instructions available, as well as the Posix multithreading API - if not, well, I'll refer you to the Sphincs+ reference code...
It does assume that you have the AVX2 instructions available, as well as the Posix multithreading API - if not, well, I'll refer you to the reference code...

If you're looking for an implementation of the Sphincs+ round 3 code, check out the consistent-basew branch

Interesting branches:
- fault - Attempts to protect against fault attacks (by performing the critical computations twice and comparing)
- sfluhrer-avx-512 - Uses the AVX-512 instruction set to accelerate things (if available, if not, it falls back to AVX-2)
- dwarf - Adds support for the proposed rls128cs1, rls192cs1, rls256cs1 parameter sets (both SHA2 and SHAKE)
4 changes: 2 additions & 2 deletions address.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/// \brief This contains the accessor functions for the addr_t fields
// at least, the ones that were complicated enough not to inline

namespace sphincs_plus {
namespace slh_dsa {

//
// Specify which Merkle tree within the level (the "tree address") we're working on
Expand Down Expand Up @@ -54,4 +54,4 @@ void key::set_tree_index(addr_t addr, uint32_t tree_index)
u32_to_bytes(&addr[offset_tree_index], tree_index );
}

} /* namespace sphincs_plus */
} /* namespace slh_dsa */
Loading
Loading