diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 00000000..236a34ae --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,24 @@ +{ + "configurations": [ + { + "name": "Win32", + "includePath": [ + "${workspaceFolder}/**", + "${workspaceFolder}/ref", + "${workspaceFolder}/ref/params" + + ], + "defines": [ + "_DEBUG", + "UNICODE", + "_UNICODE", + "PARAMS=sphincs-sha2-128f" // default value + ], + "compilerPath": "C:\\msys64\\ucrt64\\bin\\gcc.exe", + "cStandard": "c17", + "cppStandard": "gnu++17", + "intelliSenseMode": "windows-gcc-x64" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..06b08423 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "C_Cpp.dimInactiveRegions": false +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..edbd7862 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,30 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.html). + +### Summary +This version introduces modifications to the `ref` implementation for performance analysis and benchmarking purposes. The core cryptographic logic of the original SPHINCS+ algorithm remains unchanged. All modifications are confined to the `ref` directory, supplementary testing scripts, and configuration files. + +### Added +- **Performance Benchmarking Framework:** + - Introduced a `timing_info_t` struct in `ref/api.h` to capture execution time for key generation, signing, and verification steps. + - Added `print_timing_info()` function prototype in `ref/api.h` to display aggregated timing results. + - Added `run_test` function prototype in `ref/api.h` to facilitate running tests multiple times for stable performance metrics. +- **Automated Testing Support:** + - Added `ref/test/input.txt` to provide a consistent sample input for testing and debugging. +- **VS Code Configuration Support:** + - Added `.vscode/c_cpp_properties.json` to enhance development experience with debugging, code suggestions, and to fix all warnings. + - Configured include paths for all implementations (`ref`, `haraka-aesni`, `shake-avx2`, `sha2-avx2`) and parameter files. + - Defined default `PARAMS` macro for easier switching between parameter sets in the editor (note: this macro is only for code suggestions and does not affect the actual `make` process). + +### Changed +- **Makefile Adjustments:** + - Updated `Makefile` in `ref` to support new benchmarking and testing options. + +### Removed +- No changes in this version. + +This project is a fork of the official [SPHINCS+](https://github.com/sphincs/sphincsplus) repository. The modifications, available at [quannguyen247/sphincsplus-dev](https://github.com/quannguyen247/sphincsplus-dev), are focused on performance analysis, benchmarking, and development tooling. The core cryptographic logic of the original public domain implementation of SPHINCS+ remains unchanged. \ No newline at end of file diff --git a/README.md b/README.md index 5948b7d0..df97ec8f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,18 @@ +# Custom SPHINCS+ Implementation for PQC Research & Benchmarking + +This repository is a fork of the official [SPHINCS+](https://github.com/sphincs/sphincsplus) implementation, customized by **quannguyen247** for the purpose of experimenting with, modifying, and benchmarking Post-Quantum Cryptography (PQC) algorithms. + +## Purpose +The primary goal of this fork is to provide a flexible framework for research and detailed performance analysis. Key objectives include: +- **Algorithmic Experimentation:** Facilitating modifications to core components such as hash functions and tree structures to study their impact on security and efficiency. +- **Comparative Analysis:** Enabling side-by-side performance comparisons of different implementation strategies and optimizations. +- **Performance Metrics:** Precise execution time measurement for key generation, signing, and verification. + +## Key Modifications +Significant changes have been made to the `ref` implementation to support these goals. For a detailed list of all modifications, please refer to the [CHANGELOG.md](CHANGELOG.md) file. + +--- + ## SPHINCS+ This repository contains the software that accompanies the [SPHINCS+ submission](https://sphincs.org/) to [NIST's Post-Quantum Cryptography](https://csrc.nist.gov/Projects/Post-Quantum-Cryptography) project. diff --git a/ref/.gitignore b/ref/.gitignore index 67bcef99..ab2061cf 100644 --- a/ref/.gitignore +++ b/ref/.gitignore @@ -3,3 +3,5 @@ test/* PQCsignKAT_*.rsp PQCsignKAT_*.req PQCgenKAT_sign +!test/input.txt +test/output.txt \ No newline at end of file diff --git a/ref/Makefile b/ref/Makefile index a3aabad2..dade112f 100644 --- a/ref/Makefile +++ b/ref/Makefile @@ -1,10 +1,23 @@ -PARAMS = sphincs-haraka-128f -THASH = robust - -CC=/usr/bin/gcc -CFLAGS=-Wall -Wextra -Wpedantic -O3 -std=c99 -Wconversion -Wmissing-prototypes -DPARAMS=$(PARAMS) $(EXTRA_CFLAGS) +PARAMS = sphincs-sha2-128f +THASH = simple + +CC = gcc +CFLAGS= -Wall -Wextra -Wpedantic -Wmissing-prototypes -Wredundant-decls \ + -Wshadow -Wpointer-arith -Wconversion -O3 -DPARAMS=$(PARAMS) $(EXTRA_CFLAGS) -z noexecstack +ifeq ($(THASH),robust) + CFLAGS += -DSPX_ROBUST=1 +endif +LDLIBS = -lcrypto + +# OS-specific adjustments for randombytes +ifeq ($(OS),Windows_NT) + RANDOMBYTES_SRC = randombytes_win.c + LDLIBS += -lbcrypt +else + RANDOMBYTES_SRC = randombytes.c +endif -SOURCES = address.c randombytes.c merkle.c wots.c wotsx1.c utils.c utilsx1.c fors.c sign.c +SOURCES = address.c $(RANDOMBYTES_SRC) merkle.c wots.c wotsx1.c utils.c utilsx1.c fors.c sign.c HEADERS = params.h address.h randombytes.h merkle.h wots.h wotsx1.h utils.h utilsx1.h fors.h api.h hash.h thash.h ifneq (,$(findstring shake,$(PARAMS))) @@ -20,7 +33,8 @@ ifneq (,$(findstring sha2,$(PARAMS))) HEADERS += sha2.h endif -DET_SOURCES = $(SOURCES:randombytes.%=rng.%) +# For deterministic KAT generation, replace randombytes with rng.c +DET_SOURCES = $(filter-out $(RANDOMBYTES_SRC),$(SOURCES)) rng.c DET_HEADERS = $(HEADERS:randombytes.%=rng.%) TESTS = test/fors \ @@ -30,6 +44,9 @@ BENCHMARK = test/benchmark .PHONY: clean test benchmark +test_sphincsplus: test/test_sphincsplus.c $(SOURCES) $(HEADERS) Makefile + $(CC) $(CFLAGS) -o test/$@ $(SOURCES) $< $(LDLIBS) + default: PQCgenKAT_sign all: PQCgenKAT_sign tests benchmarks @@ -42,17 +59,17 @@ benchmarks: $(BENCHMARK) benchmark: $(BENCHMARK:=.exec) -PQCgenKAT_sign: PQCgenKAT_sign.c $(DET_SOURCES) $(DET_HEADERS) +PQCgenKAT_sign: PQCgenKAT_sign.c $(DET_SOURCES) $(DET_HEADERS) Makefile $(CC) $(CFLAGS) -o $@ $(DET_SOURCES) $< -lcrypto -test/benchmark: test/benchmark.c test/cycles.c $(SOURCES) $(HEADERS) - $(CC) $(CFLAGS) -o $@ test/cycles.c $(SOURCES) $< $(LDLIBS) +test/benchmark: test/benchmark.c test/cycles.c $(DET_SOURCES) $(DET_HEADERS) Makefile + $(CC) $(CFLAGS) -o $@ test/cycles.c $(DET_SOURCES) $< $(LDLIBS) -test/%: test/%.c $(SOURCES) $(HEADERS) - $(CC) $(CFLAGS) -o $@ $(SOURCES) $< $(LDLIBS) +test/%: test/%.c $(DET_SOURCES) $(DET_HEADERS) Makefile + $(CC) $(CFLAGS) -o $@ $(DET_SOURCES) $< $(LDLIBS) -test/haraka: test/haraka.c $(filter-out haraka.c,$(SOURCES)) $(HEADERS) - $(CC) $(CFLAGS) -o $@ $(filter-out haraka.c,$(SOURCES)) $< $(LDLIBS) +test/haraka: test/haraka.c $(filter-out haraka.c,$(DET_SOURCES)) $(DET_HEADERS) + $(CC) $(CFLAGS) -o $@ $(filter-out haraka.c,$(DET_SOURCES)) $< $(LDLIBS) test/%.exec: test/% @$< @@ -62,4 +79,4 @@ clean: -$(RM) $(BENCHMARK) -$(RM) PQCgenKAT_sign -$(RM) PQCsignKAT_*.rsp - -$(RM) PQCsignKAT_*.req + -$(RM) PQCsignKAT_*.req \ No newline at end of file diff --git a/ref/PQCgenKAT_sign.exe b/ref/PQCgenKAT_sign.exe new file mode 100644 index 00000000..7e7812bf Binary files /dev/null and b/ref/PQCgenKAT_sign.exe differ diff --git a/ref/api.h b/ref/api.h index d57a148f..5801cac2 100644 --- a/ref/api.h +++ b/ref/api.h @@ -6,6 +6,10 @@ #include "params.h" +// define macros +#define str(s) #s +#define xstr(s) str(s) + #define CRYPTO_ALGNAME "SPHINCS+" #define CRYPTO_SECRETKEYBYTES SPX_SK_BYTES @@ -74,4 +78,22 @@ int crypto_sign_open(unsigned char *m, unsigned long long *mlen, const unsigned char *sm, unsigned long long smlen, const unsigned char *pk); +// Timing struct for benchmarking +typedef struct { + double keygen; + double sign; + double verify; + double all; + double temp; +} timing_info_t; + +// Expose global timing variable for test aggregation +extern timing_info_t g_time; + +// Print and return timing info +timing_info_t print_timing_info(void); + +// add prototypes +void run_test(const unsigned char *m, unsigned long long mlen, int test_idx); + #endif diff --git a/ref/cpu_used_test.sh b/ref/cpu_used_test.sh new file mode 100644 index 00000000..c59afa70 --- /dev/null +++ b/ref/cpu_used_test.sh @@ -0,0 +1,23 @@ +#!/bin/bash +#use chmod +x cpu_used_test.sh then ./cpu_used_test.sh + +total_cpu=0 +count=0 + +for i in {1..1000} +do + # Extract the numeric value (removes the % sign) + cpu=$( /usr/bin/time -v test_sphincsplus.exe 2>&1 | grep "Percent of CPU this job got" | grep -o ' [0-9]\+' ) + + if [[ -n "$cpu" ]]; then + total_cpu=$((total_cpu + cpu)) + count=$((count + 1)) + fi +done + +if [ "$count" -gt 0 ]; then + average_cpu=$(echo "scale=2; $total_cpu / $count" | bc) + echo "Average CPU percent used: $average_cpu" +else + echo "Could not extract any CPU percent values!" +fi \ No newline at end of file diff --git a/ref/randombytes_win.c b/ref/randombytes_win.c new file mode 100644 index 00000000..927e2172 --- /dev/null +++ b/ref/randombytes_win.c @@ -0,0 +1,20 @@ +/* + * This is the Windows-specific implementation of randombytes, using BCryptGenRandom. + */ + +#include +#include +#include /* For fprintf, stderr */ +#include /* For exit */ +#include "randombytes.h" + +//#pragma comment(lib, "bcrypt.lib") + +void randombytes(unsigned char *x, unsigned long long xlen) +{ + NTSTATUS status = BCryptGenRandom(NULL, x, (ULONG)xlen, BCRYPT_USE_SYSTEM_PREFERRED_RNG); + if (status != 0) { /* STATUS_SUCCESS is 0 */ + fprintf(stderr, "Fatal error: BCryptGenRandom failed.\n"); + exit(1); + } +} diff --git a/ref/sha2.c b/ref/sha2.c index ef730470..8f54af1d 100644 --- a/ref/sha2.c +++ b/ref/sha2.c @@ -286,7 +286,8 @@ static size_t crypto_hashblocks_sha256(uint8_t *statebytes, return inlen; } -static int crypto_hashblocks_sha512(unsigned char *statebytes,const unsigned char *in,unsigned long long inlen) +// fix from int to unsigned long long +static unsigned long long crypto_hashblocks_sha512(unsigned char *statebytes,const unsigned char *in,unsigned long long inlen) { uint64_t state[8]; uint64_t a; @@ -635,13 +636,13 @@ void mgf1_256(unsigned char *out, unsigned long outlen, /* While we can fit in at least another full block of SHA256 output.. */ for (i = 0; (i+1)*SPX_SHA256_OUTPUT_BYTES <= outlen; i++) { - u32_to_bytes(inbuf + inlen, i); + u32_to_bytes(inbuf + inlen, (uint32_t)i); sha256(out, inbuf, inlen + 4); out += SPX_SHA256_OUTPUT_BYTES; } /* Until we cannot anymore, and we fill the remainder. */ if (outlen > i*SPX_SHA256_OUTPUT_BYTES) { - u32_to_bytes(inbuf + inlen, i); + u32_to_bytes(inbuf + inlen, (uint32_t)i); sha256(outbuf, inbuf, inlen + 4); memcpy(out, outbuf, outlen - i*SPX_SHA256_OUTPUT_BYTES); } @@ -661,13 +662,13 @@ void mgf1_512(unsigned char *out, unsigned long outlen, /* While we can fit in at least another full block of SHA512 output.. */ for (i = 0; (i+1)*SPX_SHA512_OUTPUT_BYTES <= outlen; i++) { - u32_to_bytes(inbuf + inlen, i); + u32_to_bytes(inbuf + inlen, (uint32_t)i); sha512(out, inbuf, inlen + 4); out += SPX_SHA512_OUTPUT_BYTES; } /* Until we cannot anymore, and we fill the remainder. */ if (outlen > i*SPX_SHA512_OUTPUT_BYTES) { - u32_to_bytes(inbuf + inlen, i); + u32_to_bytes(inbuf + inlen, (uint32_t)i); sha512(outbuf, inbuf, inlen + 4); memcpy(out, outbuf, outlen - i*SPX_SHA512_OUTPUT_BYTES); } diff --git a/ref/sign.c b/ref/sign.c index a8e0c3c3..668ca50b 100644 --- a/ref/sign.c +++ b/ref/sign.c @@ -1,7 +1,9 @@ +#define _POSIX_C_SOURCE 199309L // POSIX compliance +#include #include #include #include - +#include #include "api.h" #include "params.h" #include "wots.h" @@ -13,6 +15,9 @@ #include "utils.h" #include "merkle.h" +// global timing struct now defined in api.h +timing_info_t g_time = {0}; + /* * Returns the length of a secret key, in bytes */ @@ -55,7 +60,7 @@ int crypto_sign_seed_keypair(unsigned char *pk, unsigned char *sk, { spx_ctx ctx; - /* Initialize SK_SEED, SK_PRF and PUB_SEED from seed. */ + //printf("[STEP 2] Initialize SK_SEED, SK_PRF and PUB_SEED from seed.\n"); memcpy(sk, seed, CRYPTO_SEEDBYTES); memcpy(pk, sk + 2*SPX_N, SPX_N); @@ -67,9 +72,10 @@ int crypto_sign_seed_keypair(unsigned char *pk, unsigned char *sk, preparation or computation it needs, based on the public seed. */ initialize_hash_function(&ctx); - /* Compute root node of the top-most subtree. */ + //printf("[STEP 3] Compute root node of the top-most subtree 'pub_root'.\n"); merkle_gen_root(sk + 3*SPX_N, &ctx); + //printf("[STEP 4] Assemble the secret key and public key according to the required format.\n"); memcpy(pk + SPX_N, sk + 3*SPX_N, SPX_N); return 0; @@ -82,11 +88,22 @@ int crypto_sign_seed_keypair(unsigned char *pk, unsigned char *sk, */ int crypto_sign_keypair(unsigned char *pk, unsigned char *sk) { - unsigned char seed[CRYPTO_SEEDBYTES]; - randombytes(seed, CRYPTO_SEEDBYTES); - crypto_sign_seed_keypair(pk, sk, seed); + struct timespec start, end; + clock_gettime(CLOCK_MONOTONIC, &start); + + //printf("\n=========== KEY GENERATION STAGE ===========\n\n"); + //printf("[STEP 1] Generate random seed with randombytes\n"); + unsigned char seed[CRYPTO_SEEDBYTES]; + randombytes(seed, CRYPTO_SEEDBYTES); + crypto_sign_seed_keypair(pk, sk, seed); + //printf("[DONE] Key generation completed successfully.\n"); - return 0; + clock_gettime(CLOCK_MONOTONIC, &end); + double t = (double)(end.tv_sec - start.tv_sec) + ((double)(end.tv_nsec - start.tv_nsec)) / 1e9; + g_time.keygen += t; + g_time.all += t; + + return 0; } /** @@ -95,6 +112,9 @@ int crypto_sign_keypair(unsigned char *pk, unsigned char *sk) int crypto_sign_signature(uint8_t *sig, size_t *siglen, const uint8_t *m, size_t mlen, const uint8_t *sk) { + struct timespec start, end; + clock_gettime(CLOCK_MONOTONIC, &start); + spx_ctx ctx; const unsigned char *sk_prf = sk + SPX_N; @@ -122,21 +142,24 @@ int crypto_sign_signature(uint8_t *sig, size_t *siglen, /* Optionally, signing can be made non-deterministic using optrand. This can help counter side-channel attacks that would benefit from getting a large number of traces when the signer uses the same nodes. */ + //printf("\n============== SIGNING STAGE ==============\n\n"); + //printf("[STEP 1] Generate random value R for message digest randomization.\n"); randombytes(optrand, SPX_N); - /* Compute the digest randomization value. */ + //printf("[STEP 2] Compute the digest randomization value.\n"); gen_message_random(sig, sk_prf, optrand, m, mlen, &ctx); - /* Derive the message digest and leaf index from R, PK and M. */ + //printf("[STEP 2] Derive the message digest and leaf index from R, PK and M.\n"); hash_message(mhash, &tree, &idx_leaf, sig, pk, m, mlen, &ctx); sig += SPX_N; set_tree_addr(wots_addr, tree); set_keypair_addr(wots_addr, idx_leaf); - /* Sign the message hash using FORS. */ + //printf("[STEP 3] Sign the message hash using FORS.\n"); fors_sign(sig, root, mhash, &ctx, wots_addr); sig += SPX_FORS_BYTES; + //printf("[STEP 4] Initialize a for loop to sign the message hash across all layers of the Merkle tree.\n"); for (i = 0; i < SPX_D; i++) { set_layer_addr(tree_addr, i); set_tree_addr(tree_addr, tree); @@ -154,6 +177,10 @@ int crypto_sign_signature(uint8_t *sig, size_t *siglen, *siglen = SPX_BYTES; + clock_gettime(CLOCK_MONOTONIC, &end); + double t = (double)(end.tv_sec - start.tv_sec) + ((double)(end.tv_nsec - start.tv_nsec)) / 1e9; + g_time.sign += t; + return 0; } @@ -163,6 +190,9 @@ int crypto_sign_signature(uint8_t *sig, size_t *siglen, int crypto_sign_verify(const uint8_t *sig, size_t siglen, const uint8_t *m, size_t mlen, const uint8_t *pk) { + struct timespec start, end; + clock_gettime(CLOCK_MONOTONIC, &start); + spx_ctx ctx; const unsigned char *pub_root = pk + SPX_N; unsigned char mhash[SPX_FORS_MSG_BYTES]; @@ -190,7 +220,7 @@ int crypto_sign_verify(const uint8_t *sig, size_t siglen, set_type(tree_addr, SPX_ADDR_TYPE_HASHTREE); set_type(wots_pk_addr, SPX_ADDR_TYPE_WOTSPK); - /* Derive the message digest and leaf index from R || PK || M. */ + //printf("[STEP 1] Derive the message digest and leaf index from R || PK || M.\n"); /* The additional SPX_N is a result of the hash domain separator. */ hash_message(mhash, &tree, &idx_leaf, sig, pk, m, mlen, &ctx); sig += SPX_N; @@ -199,10 +229,12 @@ int crypto_sign_verify(const uint8_t *sig, size_t siglen, set_tree_addr(wots_addr, tree); set_keypair_addr(wots_addr, idx_leaf); + //printf("[STEP 2] Compute the FORS public key from the signature and message hash to verify.\n"); fors_pk_from_sig(root, sig, mhash, &ctx, wots_addr); sig += SPX_FORS_BYTES; /* For each subtree.. */ + //printf("[STEP 3] Initialize a for loop starting from the bottom layer up to the top layer of hypertree, for each Merkle subtree.\n"); for (i = 0; i < SPX_D; i++) { set_layer_addr(tree_addr, i); set_tree_addr(tree_addr, tree); @@ -231,8 +263,23 @@ int crypto_sign_verify(const uint8_t *sig, size_t siglen, tree = tree >> SPX_TREE_HEIGHT; } + + /* Print first 8 bytes of root and pub_root for debugging/visualization */ + /* printf("[Step 4] new_root (first 8 bytes): "); // recomputed root from signature + for (int i = 0; i < 8; i++) printf("%02X%s", root[i], i < 7 ? " " : ""); + printf(" ...\n"); + printf("[Step 4] pub_root (first 8 bytes): "); + for (int i = 0; i < 8; i++) printf("%02X%s", pub_root[i], i < 7 ? " " : ""); + printf(" ...\n"); */ + /* Check if the root node equals the root node in the public key. */ - if (memcmp(root, pub_root, SPX_N)) { + //printf("[STEP 4] Check if the root node equals the root node in the public key.\n"); + + clock_gettime(CLOCK_MONOTONIC, &end); + double t = (double)(end.tv_sec - start.tv_sec) + ((double)(end.tv_nsec - start.tv_nsec)) / 1e9; + g_time.verify += t; + + if (memcmp(root, pub_root, SPX_N)) { // timing ends before memcmp because memcmp is negligible return -1; } @@ -247,12 +294,21 @@ int crypto_sign(unsigned char *sm, unsigned long long *smlen, const unsigned char *m, unsigned long long mlen, const unsigned char *sk) { + struct timespec start, end; + clock_gettime(CLOCK_MONOTONIC, &start); + size_t siglen; crypto_sign_signature(sm, &siglen, m, (size_t)mlen, sk); + //printf("[STEP 5] Append the message M to the signature to form the final output.\n"); memmove(sm + SPX_BYTES, m, mlen); *smlen = siglen + mlen; + //printf("[DONE] Signature generated successfully.\n"); + + clock_gettime(CLOCK_MONOTONIC, &end); + double t = (double)(end.tv_sec - start.tv_sec) + ((double)(end.tv_nsec - start.tv_nsec)) / 1e9; + g_time.all += t; return 0; } @@ -264,24 +320,51 @@ int crypto_sign_open(unsigned char *m, unsigned long long *mlen, const unsigned char *sm, unsigned long long smlen, const unsigned char *pk) { + //printf("\n============= VERIFYING STAGE =============\n\n"); /* The API caller does not necessarily know what size a signature should be but SPHINCS+ signatures are always exactly SPX_BYTES. */ + //printf("[Auxiliary] Check signature length\n"); if (smlen < SPX_BYTES) { memset(m, 0, smlen); *mlen = 0; return -1; } - *mlen = smlen - SPX_BYTES; + struct timespec start, end; + clock_gettime(CLOCK_MONOTONIC, &start); + *mlen = smlen - SPX_BYTES; if (crypto_sign_verify(sm, SPX_BYTES, sm + SPX_BYTES, (size_t)*mlen, pk)) { memset(m, 0, smlen); *mlen = 0; + //printf("[DONE] Signature verification failed!\n"); + + clock_gettime(CLOCK_MONOTONIC, &end); + double t = (double)(end.tv_sec - start.tv_sec) + ((double)(end.tv_nsec - start.tv_nsec)) / 1e9; + g_time.all += t; + return -1; } /* If verification was successful, move the message to the right place. */ + //printf("[DONE] Signature verification successful!\n"); memmove(m, sm + SPX_BYTES, *mlen); + clock_gettime(CLOCK_MONOTONIC, &end); + double t = (double)(end.tv_sec - start.tv_sec) + ((double)(end.tv_nsec - start.tv_nsec)) / 1e9; + g_time.all += t; + return 0; } + +// For testing: print timing information and return timing struct +timing_info_t print_timing_info(void) +{ + g_time.temp = g_time.keygen + g_time.sign + g_time.verify; + /* printf("Total KeyGen time: %.6f seconds (%.2f ms)\n", g_time.keygen, g_time.keygen * 1000); + printf("Total Signing time: %.6f seconds (%.2f ms)\n", g_time.sign, g_time.sign * 1000); + printf("Total Verification time: %.6f seconds (%.2f ms)\n", g_time.verify, g_time.verify * 1000); + printf("Total time (not include packing and unpacking): %.6f seconds (%.2f ms)\n", g_time.temp, g_time.temp * 1000); + printf("Total time (NIST compliance): %.6f seconds (%.2f ms)\n", g_time.all, g_time.all * 1000); */ + return g_time; +} \ No newline at end of file diff --git a/ref/sign.c.old b/ref/sign.c.old new file mode 100644 index 00000000..ae23410e --- /dev/null +++ b/ref/sign.c.old @@ -0,0 +1,309 @@ +#include +#include +#include +#include +#include "api.h" +#include "params.h" +#include "wots.h" +#include "fors.h" +#include "hash.h" +#include "thash.h" +#include "address.h" +#include "randombytes.h" +#include "utils.h" +#include "merkle.h" + +/* + * Returns the length of a secret key, in bytes + */ +unsigned long long crypto_sign_secretkeybytes(void) +{ + return CRYPTO_SECRETKEYBYTES; +} + +/* + * Returns the length of a public key, in bytes + */ +unsigned long long crypto_sign_publickeybytes(void) +{ + return CRYPTO_PUBLICKEYBYTES; +} + +/* + * Returns the length of a signature, in bytes + */ +unsigned long long crypto_sign_bytes(void) +{ + return CRYPTO_BYTES; +} + +/* + * Returns the length of the seed required to generate a key pair, in bytes + */ +unsigned long long crypto_sign_seedbytes(void) +{ + return CRYPTO_SEEDBYTES; +} + +/* + * Generates an SPX key pair given a seed of length + * Format sk: [SK_SEED || SK_PRF || PUB_SEED || root] + * Format pk: [PUB_SEED || root] + */ +int crypto_sign_seed_keypair(unsigned char *pk, unsigned char *sk, + const unsigned char *seed) +{ + spx_ctx ctx; + + printf("[STEP 2] Initialize SK_SEED, SK_PRF and PUB_SEED from seed.\n"); + memcpy(sk, seed, CRYPTO_SEEDBYTES); + + memcpy(pk, sk + 2*SPX_N, SPX_N); + + memcpy(ctx.pub_seed, pk, SPX_N); + memcpy(ctx.sk_seed, sk, SPX_N); + + /* This hook allows the hash function instantiation to do whatever + preparation or computation it needs, based on the public seed. */ + initialize_hash_function(&ctx); + + printf("[STEP 3] Compute root node of the top-most subtree 'pub_root'.\n"); + merkle_gen_root(sk + 3*SPX_N, &ctx); + + printf("[STEP 4] Assemble the secret key and public key according to the required format.\n"); + memcpy(pk + SPX_N, sk + 3*SPX_N, SPX_N); + + return 0; +} + +/* + * Generates an SPX key pair. + * Format sk: [SK_SEED || SK_PRF || PUB_SEED || root] + * Format pk: [PUB_SEED || root] + */ +int crypto_sign_keypair(unsigned char *pk, unsigned char *sk) +{ + printf("\n=========== KEY GENERATION STAGE ===========\n\n"); + printf("[STEP 1] Generate random seed with randombytes\n"); + unsigned char seed[CRYPTO_SEEDBYTES]; + randombytes(seed, CRYPTO_SEEDBYTES); + crypto_sign_seed_keypair(pk, sk, seed); + printf("[DONE] Key generation completed successfully.\n"); + return 0; +} + +/** + * Returns an array containing a detached signature. + */ +int crypto_sign_signature(uint8_t *sig, size_t *siglen, + const uint8_t *m, size_t mlen, const uint8_t *sk) +{ + spx_ctx ctx; + + const unsigned char *sk_prf = sk + SPX_N; + const unsigned char *pk = sk + 2*SPX_N; + + unsigned char optrand[SPX_N]; + unsigned char mhash[SPX_FORS_MSG_BYTES]; + unsigned char root[SPX_N]; + uint32_t i; + uint64_t tree; + uint32_t idx_leaf; + uint32_t wots_addr[8] = {0}; + uint32_t tree_addr[8] = {0}; + + memcpy(ctx.sk_seed, sk, SPX_N); + memcpy(ctx.pub_seed, pk, SPX_N); + + /* This hook allows the hash function instantiation to do whatever + preparation or computation it needs, based on the public seed. */ + initialize_hash_function(&ctx); + + set_type(wots_addr, SPX_ADDR_TYPE_WOTS); + set_type(tree_addr, SPX_ADDR_TYPE_HASHTREE); + + /* Optionally, signing can be made non-deterministic using optrand. + This can help counter side-channel attacks that would benefit from + getting a large number of traces when the signer uses the same nodes. */ + printf("\n============== SIGNING STAGE ==============\n\n"); + printf("[STEP 1] Generate random value R for message digest randomization.\n"); + randombytes(optrand, SPX_N); + printf("[STEP 2] Compute the digest randomization value.\n"); + gen_message_random(sig, sk_prf, optrand, m, mlen, &ctx); + + printf("[STEP 2] Derive the message digest and leaf index from R, PK and M.\n"); + hash_message(mhash, &tree, &idx_leaf, sig, pk, m, mlen, &ctx); + sig += SPX_N; + + set_tree_addr(wots_addr, tree); + set_keypair_addr(wots_addr, idx_leaf); + + printf("[STEP 3] Sign the message hash using FORS.\n"); + fors_sign(sig, root, mhash, &ctx, wots_addr); + sig += SPX_FORS_BYTES; + + printf("[STEP 4] Initialize a for loop to sign the message hash across all layers of the Merkle tree.\n"); + for (i = 0; i < SPX_D; i++) { + set_layer_addr(tree_addr, i); + set_tree_addr(tree_addr, tree); + + copy_subtree_addr(wots_addr, tree_addr); + set_keypair_addr(wots_addr, idx_leaf); + + merkle_sign(sig, root, &ctx, wots_addr, tree_addr, idx_leaf); + sig += SPX_WOTS_BYTES + SPX_TREE_HEIGHT * SPX_N; + + /* Update the indices for the next layer. */ + idx_leaf = (tree & ((1 << SPX_TREE_HEIGHT)-1)); + tree = tree >> SPX_TREE_HEIGHT; + } + + *siglen = SPX_BYTES; + + return 0; +} + +/** + * Verifies a detached signature and message under a given public key. + */ +int crypto_sign_verify(const uint8_t *sig, size_t siglen, + const uint8_t *m, size_t mlen, const uint8_t *pk) +{ + spx_ctx ctx; + const unsigned char *pub_root = pk + SPX_N; + unsigned char mhash[SPX_FORS_MSG_BYTES]; + unsigned char wots_pk[SPX_WOTS_BYTES]; + unsigned char root[SPX_N]; + unsigned char leaf[SPX_N]; + unsigned int i; + uint64_t tree; + uint32_t idx_leaf; + uint32_t wots_addr[8] = {0}; + uint32_t tree_addr[8] = {0}; + uint32_t wots_pk_addr[8] = {0}; + + if (siglen != SPX_BYTES) { + return -1; + } + + memcpy(ctx.pub_seed, pk, SPX_N); + + /* This hook allows the hash function instantiation to do whatever + preparation or computation it needs, based on the public seed. */ + initialize_hash_function(&ctx); + + set_type(wots_addr, SPX_ADDR_TYPE_WOTS); + set_type(tree_addr, SPX_ADDR_TYPE_HASHTREE); + set_type(wots_pk_addr, SPX_ADDR_TYPE_WOTSPK); + + printf("[STEP 1] Derive the message digest and leaf index from R || PK || M.\n"); + /* The additional SPX_N is a result of the hash domain separator. */ + hash_message(mhash, &tree, &idx_leaf, sig, pk, m, mlen, &ctx); + sig += SPX_N; + + /* Layer correctly defaults to 0, so no need to set_layer_addr */ + set_tree_addr(wots_addr, tree); + set_keypair_addr(wots_addr, idx_leaf); + + printf("[STEP 2] Compute the FORS public key from the signature and message hash to verify.\n"); + fors_pk_from_sig(root, sig, mhash, &ctx, wots_addr); + sig += SPX_FORS_BYTES; + + /* For each subtree.. */ + printf("[STEP 3] Initialize a for loop starting from the bottom layer up to the top layer of hypertree, for each Merkle subtree.\n"); + for (i = 0; i < SPX_D; i++) { + set_layer_addr(tree_addr, i); + set_tree_addr(tree_addr, tree); + + copy_subtree_addr(wots_addr, tree_addr); + set_keypair_addr(wots_addr, idx_leaf); + + copy_keypair_addr(wots_pk_addr, wots_addr); + + /* The WOTS public key is only correct if the signature was correct. */ + /* Initially, root is the FORS pk, but on subsequent iterations it is + the root of the subtree below the currently processed subtree. */ + wots_pk_from_sig(wots_pk, sig, root, &ctx, wots_addr); + sig += SPX_WOTS_BYTES; + + /* Compute the leaf node using the WOTS public key. */ + thash(leaf, wots_pk, SPX_WOTS_LEN, &ctx, wots_pk_addr); + + /* Compute the root node of this subtree. */ + compute_root(root, leaf, idx_leaf, 0, sig, SPX_TREE_HEIGHT, + &ctx, tree_addr); + sig += SPX_TREE_HEIGHT * SPX_N; + + /* Update the indices for the next layer. */ + idx_leaf = (tree & ((1 << SPX_TREE_HEIGHT)-1)); + tree = tree >> SPX_TREE_HEIGHT; + } + + + /* Print first 8 bytes of root and pub_root for debugging/visualization */ + printf("[Step 4] new_root (first 8 bytes): "); // recomputed root from signature + for (int i = 0; i < 8; i++) printf("%02X%s", root[i], i < 7 ? " " : ""); + printf(" ...\n"); + printf("[Step 4] pub_root (first 8 bytes): "); + for (int i = 0; i < 8; i++) printf("%02X%s", pub_root[i], i < 7 ? " " : ""); + printf(" ...\n"); + + /* Check if the root node equals the root node in the public key. */ + printf("[STEP 4] Check if the root node equals the root node in the public key.\n"); + if (memcmp(root, pub_root, SPX_N)) { + return -1; + } + + return 0; +} + + +/** + * Returns an array containing the signature followed by the message. + */ +int crypto_sign(unsigned char *sm, unsigned long long *smlen, + const unsigned char *m, unsigned long long mlen, + const unsigned char *sk) +{ + size_t siglen; + + crypto_sign_signature(sm, &siglen, m, (size_t)mlen, sk); + + printf("[STEP 5] Append the message M to the signature to form the final output.\n"); + memmove(sm + SPX_BYTES, m, mlen); + *smlen = siglen + mlen; + printf("[DONE] Signature generated successfully.\n"); + return 0; +} + +/** + * Verifies a given signature-message pair under a given public key. + */ +int crypto_sign_open(unsigned char *m, unsigned long long *mlen, + const unsigned char *sm, unsigned long long smlen, + const unsigned char *pk) +{ + printf("\n============= VERIFYING STAGE =============\n\n"); + /* The API caller does not necessarily know what size a signature should be + but SPHINCS+ signatures are always exactly SPX_BYTES. */ + printf("[Auxiliary] Check signature length\n"); + if (smlen < SPX_BYTES) { + memset(m, 0, smlen); + *mlen = 0; + return -1; + } + + *mlen = smlen - SPX_BYTES; + if (crypto_sign_verify(sm, SPX_BYTES, sm + SPX_BYTES, (size_t)*mlen, pk)) { + memset(m, 0, smlen); + *mlen = 0; + printf("[DONE] Signature verification failed!\n"); + return -1; + } + + /* If verification was successful, move the message to the right place. */ + printf("[DONE] Signature verification successful!\n"); + memmove(m, sm + SPX_BYTES, *mlen); + + return 0; +} diff --git a/ref/test/Makefile b/ref/test/Makefile new file mode 100644 index 00000000..6fb5426c --- /dev/null +++ b/ref/test/Makefile @@ -0,0 +1,112 @@ +CC ?= gcc +CFLAGS ?= -Wall -Wextra -Wpedantic -Wmissing-prototypes -Wredundant-decls \ + -Wshadow -Wpointer-arith -O3 -fomit-frame-pointer + +ROOT := .. + +# SPHINCS+ parameters - adjust as needed +PARAMS ?= sphincs-sha2-128f +THASH ?= simple + +# OS-specific adjustments for randombytes +ifeq ($(OS),Windows_NT) + RANDOMBYTES_SRC = $(ROOT)/randombytes_win.c + LDLIBS += -lbcrypt +else + RANDOMBYTES_SRC = $(ROOT)/randombytes.c +endif + +SOURCES = $(ROOT)/address.c $(RANDOMBYTES_SRC) $(ROOT)/merkle.c $(ROOT)/wots.c $(ROOT)/wotsx1.c $(ROOT)/utils.c $(ROOT)/utilsx1.c $(ROOT)/fors.c $(ROOT)/sign.c +HEADERS = $(ROOT)/params.h $(ROOT)/address.h $(ROOT)/randombytes.h $(ROOT)/merkle.h $(ROOT)/wots.h $(ROOT)/wotsx1.h $(ROOT)/utils.h $(ROOT)/utilsx1.h $(ROOT)/fors.h $(ROOT)/api.h $(ROOT)/hash.h $(ROOT)/thash.h + +ifneq (,$(findstring shake,$(PARAMS))) + SOURCES += $(ROOT)/fips202.c $(ROOT)/hash_shake.c $(ROOT)/thash_shake_$(THASH).c + HEADERS += $(ROOT)/fips202.h +endif +ifneq (,$(findstring haraka,$(PARAMS))) + SOURCES += $(ROOT)/haraka.c $(ROOT)/hash_haraka.c $(ROOT)/thash_haraka_$(THASH).c + HEADERS += $(ROOT)/haraka.h +endif +ifneq (,$(findstring sha2,$(PARAMS))) + SOURCES += $(ROOT)/sha2.c $(ROOT)/hash_sha2.c $(ROOT)/thash_sha2_$(THASH).c + HEADERS += $(ROOT)/sha2.h +endif + +.PHONY: all run-server run-client stress keygen clean + +TARGET_IP ?= 192.168.4.85 +CONCURRENT_SESSIONS ?= 10 +BATCHES ?= 0 +BATCH_DELAY_SEC ?= 0 + +CLIENT_BIN := test_sphincsplus_client +SERVER_BIN := test_sphincsplus_server +STRESS_BIN := test_sphincsplus_stress +KEYGEN_BIN := test_sphincsplus_keygen +TEST_BIN := test_sphincsplus +SPEED_BIN := test_speed +VECTORS_BIN := test_vectors + +all: \ + test_sphincsplus_client \ + test_sphincsplus_server \ + test_sphincsplus_stress \ + test_sphincsplus_keygen \ + test_sphincsplus \ + test_speed \ + test_vectors + +test_sphincsplus_client: test_sphincsplus_client.c $(SOURCES) $(HEADERS) + $(CC) $(CFLAGS) -DPARAMS=$(PARAMS) -DSPX_ROBUST=0 \ + -o $@ $< $(SOURCES) $(LDLIBS) + +test_sphincsplus_server: test_sphincsplus_server.c $(SOURCES) $(HEADERS) + $(CC) $(CFLAGS) -DPARAMS=$(PARAMS) -DSPX_ROBUST=0 \ + -o $@ $< $(SOURCES) $(LDLIBS) + +test_sphincsplus_stress: test_sphincsplus_stress.c $(SOURCES) $(HEADERS) + $(CC) $(CFLAGS) -DPARAMS=$(PARAMS) -DSPX_ROBUST=0 \ + -o $@ $< $(SOURCES) $(LDLIBS) + +test_sphincsplus_keygen: test_sphincsplus_keygen.c $(SOURCES) $(HEADERS) + $(CC) $(CFLAGS) -DPARAMS=$(PARAMS) -DSPX_ROBUST=0 \ + -o $@ $< $(SOURCES) $(LDLIBS) + +test_sphincsplus: test_sphincsplus.c $(SOURCES) $(HEADERS) + $(CC) $(CFLAGS) -DPARAMS=$(PARAMS) -DSPX_ROBUST=0 \ + -o $@ $< $(SOURCES) $(LDLIBS) + +test_speed: test_speed.c $(SOURCES) $(HEADERS) + $(CC) $(CFLAGS) -DPARAMS=$(PARAMS) -DSPX_ROBUST=0 \ + -o $@ $< $(SOURCES) $(LDLIBS) + +test_vectors: test_vectors.c $(SOURCES) $(HEADERS) + $(CC) $(CFLAGS) -DPARAMS=$(PARAMS) -DSPX_ROBUST=0 \ + -o $@ $< $(SOURCES) $(LDLIBS) + +run-server: $(SERVER_BIN) + @echo "[RUN] Server on port 5000" + @./$(SERVER_BIN) + +run-client: $(CLIENT_BIN) + @echo "[RUN] Client -> $(TARGET_IP)" + @./$(CLIENT_BIN) $(TARGET_IP) + +stress: $(STRESS_BIN) + @echo "[STRESS] TARGET_IP=$(TARGET_IP) CONCURRENT=$(CONCURRENT_SESSIONS)" + @TARGET_IP=$(TARGET_IP) CONCURRENT_SESSIONS=$(CONCURRENT_SESSIONS) \ + BATCHES=$(BATCHES) BATCH_DELAY_SEC=$(BATCH_DELAY_SEC) \ + ./$(STRESS_BIN) + +keygen: $(KEYGEN_BIN) + @echo "[KEYGEN]" + @./$(KEYGEN_BIN) + +clean: + rm -f test_sphincsplus_client + rm -f test_sphincsplus_server + rm -f test_sphincsplus_stress + rm -f test_sphincsplus_keygen + rm -f test_sphincsplus + rm -f test_speed + rm -f test_vectors \ No newline at end of file diff --git a/ref/test/cpucycles.c b/ref/test/cpucycles.c new file mode 100644 index 00000000..c43923f1 --- /dev/null +++ b/ref/test/cpucycles.c @@ -0,0 +1,17 @@ +#include +#include "cpucycles.h" + +uint64_t cpucycles_overhead(void) { + uint64_t t0, t1, overhead = -1LL; + unsigned int i; + + for(i=0;i<100000;i++) { + t0 = cpucycles(); + __asm__ volatile(""); + t1 = cpucycles(); + if(t1 - t0 < overhead) + overhead = t1 - t0; + } + + return overhead; +} \ No newline at end of file diff --git a/ref/test/cpucycles.h b/ref/test/cpucycles.h new file mode 100644 index 00000000..9bc58b9e --- /dev/null +++ b/ref/test/cpucycles.h @@ -0,0 +1,33 @@ +#ifndef CPUCYCLES_H +#define CPUCYCLES_H + +#include + +#ifdef USE_RDPMC /* Needs echo 2 > /sys/devices/cpu/rdpmc */ + +static inline uint64_t cpucycles(void) { + const uint32_t ecx = (1U << 30) + 1; + uint64_t result; + + __asm__ volatile ("rdpmc; shlq $32,%%rdx; orq %%rdx,%%rax" + : "=a" (result) : "c" (ecx) : "rdx"); + + return result; +} + +#else + +static inline uint64_t cpucycles(void) { + uint64_t result; + + __asm__ volatile ("rdtsc; shlq $32,%%rdx; orq %%rdx,%%rax" + : "=a" (result) : : "%rdx"); + + return result; +} + +#endif + +uint64_t cpucycles_overhead(void); + +#endif \ No newline at end of file diff --git a/ref/test/input.txt b/ref/test/input.txt new file mode 100644 index 00000000..e69de29b diff --git a/ref/test/log_sphincsplus_clientv2.txt b/ref/test/log_sphincsplus_clientv2.txt new file mode 100644 index 00000000..f819f330 --- /dev/null +++ b/ref/test/log_sphincsplus_clientv2.txt @@ -0,0 +1,618 @@ + +CONCURRENT_SESSIONS=10 BATCHES=10 ./test_sphincsplus_stress + +sha2-128s simple +log: + +pid=3498 status=OK elapsed_ms=136189 cpu_user_ms=11439.653 cpu_sys_ms=0.000 rss_kb=608 challenge=32 sig=7856 +pid=3497 status=OK elapsed_ms=136193 cpu_user_ms=11423.610 cpu_sys_ms=15.036 rss_kb=608 challenge=32 sig=7856 +pid=3504 status=OK elapsed_ms=136206 cpu_user_ms=11428.664 cpu_sys_ms=11.172 rss_kb=608 challenge=32 sig=7856 +pid=3500 status=OK elapsed_ms=136211 cpu_user_ms=11411.334 cpu_sys_ms=26.250 rss_kb=608 challenge=32 sig=7856 +pid=3502 status=OK elapsed_ms=136190 cpu_user_ms=11437.204 cpu_sys_ms=3.708 rss_kb=608 challenge=32 sig=7856 +pid=3499 status=OK elapsed_ms=136225 cpu_user_ms=11435.253 cpu_sys_ms=7.463 rss_kb=608 challenge=32 sig=7856 +pid=3501 status=OK elapsed_ms=136220 cpu_user_ms=11435.954 cpu_sys_ms=3.747 rss_kb=608 challenge=32 sig=7856 +pid=3503 status=OK elapsed_ms=136235 cpu_user_ms=11444.764 cpu_sys_ms=0.000 rss_kb=608 challenge=32 sig=7856 +pid=3506 status=OK elapsed_ms=136215 cpu_user_ms=11428.396 cpu_sys_ms=11.255 rss_kb=608 challenge=32 sig=7856 +pid=3505 status=OK elapsed_ms=136236 cpu_user_ms=11436.014 cpu_sys_ms=7.497 rss_kb=608 challenge=32 sig=7856 +pid=3692 status=OK elapsed_ms=135925 cpu_user_ms=11416.670 cpu_sys_ms=14.961 rss_kb=608 challenge=32 sig=7856 +pid=3696 status=OK elapsed_ms=135970 cpu_user_ms=11422.230 cpu_sys_ms=7.554 rss_kb=608 challenge=32 sig=7856 +pid=3690 status=OK elapsed_ms=135972 cpu_user_ms=11424.450 cpu_sys_ms=7.467 rss_kb=608 challenge=32 sig=7856 +pid=3694 status=OK elapsed_ms=135992 cpu_user_ms=11421.781 cpu_sys_ms=11.172 rss_kb=608 challenge=32 sig=7856 +pid=3697 status=OK elapsed_ms=135999 cpu_user_ms=11422.038 cpu_sys_ms=11.136 rss_kb=608 challenge=32 sig=7856 +pid=3691 status=OK elapsed_ms=135991 cpu_user_ms=11415.391 cpu_sys_ms=18.513 rss_kb=608 challenge=32 sig=7856 +pid=3699 status=OK elapsed_ms=135996 cpu_user_ms=11431.595 cpu_sys_ms=3.713 rss_kb=608 challenge=32 sig=7856 +pid=3698 status=OK elapsed_ms=135995 cpu_user_ms=11418.892 cpu_sys_ms=14.995 rss_kb=608 challenge=32 sig=7856 +pid=3693 status=OK elapsed_ms=136011 cpu_user_ms=11417.911 cpu_sys_ms=18.795 rss_kb=608 challenge=32 sig=7856 +pid=3695 status=OK elapsed_ms=136024 cpu_user_ms=11416.124 cpu_sys_ms=22.482 rss_kb=608 challenge=32 sig=7856 +pid=3887 status=OK elapsed_ms=136148 cpu_user_ms=11439.450 cpu_sys_ms=7.543 rss_kb=608 challenge=32 sig=7856 +pid=3893 status=OK elapsed_ms=136173 cpu_user_ms=11438.302 cpu_sys_ms=14.993 rss_kb=608 challenge=32 sig=7856 +pid=3885 status=OK elapsed_ms=136178 cpu_user_ms=11451.950 cpu_sys_ms=0.000 rss_kb=608 challenge=32 sig=7856 +pid=3886 status=OK elapsed_ms=136189 cpu_user_ms=11452.399 cpu_sys_ms=0.000 rss_kb=608 challenge=32 sig=7856 +pid=3892 status=OK elapsed_ms=136165 cpu_user_ms=11440.812 cpu_sys_ms=11.270 rss_kb=608 challenge=32 sig=7856 +pid=3884 status=OK elapsed_ms=136195 cpu_user_ms=11449.350 cpu_sys_ms=3.746 rss_kb=608 challenge=32 sig=7856 +pid=3891 status=OK elapsed_ms=136169 cpu_user_ms=11446.668 cpu_sys_ms=7.484 rss_kb=608 challenge=32 sig=7856 +pid=3889 status=OK elapsed_ms=136207 cpu_user_ms=11456.666 cpu_sys_ms=0.000 rss_kb=608 challenge=32 sig=7856 +pid=3890 status=OK elapsed_ms=136208 cpu_user_ms=11451.585 cpu_sys_ms=3.750 rss_kb=608 challenge=32 sig=7856 +pid=3888 status=OK elapsed_ms=136202 cpu_user_ms=11450.313 cpu_sys_ms=7.418 rss_kb=608 challenge=32 sig=7856 +pid=4080 status=OK elapsed_ms=135646 cpu_user_ms=11391.324 cpu_sys_ms=11.316 rss_kb=608 challenge=32 sig=7856 +pid=4082 status=OK elapsed_ms=135649 cpu_user_ms=11393.983 cpu_sys_ms=11.296 rss_kb=608 challenge=32 sig=7856 +pid=4079 status=OK elapsed_ms=135668 cpu_user_ms=11397.868 cpu_sys_ms=7.491 rss_kb=608 challenge=32 sig=7856 +pid=4081 status=OK elapsed_ms=135677 cpu_user_ms=11397.181 cpu_sys_ms=7.498 rss_kb=608 challenge=32 sig=7856 +pid=4085 status=OK elapsed_ms=135682 cpu_user_ms=11396.296 cpu_sys_ms=11.127 rss_kb=608 challenge=32 sig=7856 +pid=4078 status=OK elapsed_ms=135688 cpu_user_ms=11404.950 cpu_sys_ms=3.770 rss_kb=608 challenge=32 sig=7856 +pid=4084 status=OK elapsed_ms=135694 cpu_user_ms=11406.662 cpu_sys_ms=3.740 rss_kb=608 challenge=32 sig=7856 +pid=4077 status=OK elapsed_ms=135698 cpu_user_ms=11394.469 cpu_sys_ms=15.001 rss_kb=608 challenge=32 sig=7856 +pid=4083 status=OK elapsed_ms=135698 cpu_user_ms=11397.182 cpu_sys_ms=11.329 rss_kb=608 challenge=32 sig=7856 +pid=4076 status=OK elapsed_ms=135706 cpu_user_ms=11396.109 cpu_sys_ms=14.896 rss_kb=608 challenge=32 sig=7856 +pid=482 status=OK elapsed_ms=135532 cpu_user_ms=11388.788 cpu_sys_ms=11.299 rss_kb=608 challenge=32 sig=7856 +pid=476 status=OK elapsed_ms=135530 cpu_user_ms=11395.932 cpu_sys_ms=3.763 rss_kb=608 challenge=32 sig=7856 +pid=478 status=OK elapsed_ms=135547 cpu_user_ms=11402.110 cpu_sys_ms=0.000 rss_kb=608 challenge=32 sig=7856 +pid=479 status=OK elapsed_ms=135557 cpu_user_ms=11396.262 cpu_sys_ms=7.537 rss_kb=608 challenge=32 sig=7856 +pid=477 status=OK elapsed_ms=135555 cpu_user_ms=11398.502 cpu_sys_ms=3.750 rss_kb=608 challenge=32 sig=7856 +pid=480 status=OK elapsed_ms=135566 cpu_user_ms=11395.473 cpu_sys_ms=7.546 rss_kb=608 challenge=32 sig=7856 +pid=483 status=OK elapsed_ms=135574 cpu_user_ms=11400.807 cpu_sys_ms=3.779 rss_kb=608 challenge=32 sig=7856 +pid=481 status=OK elapsed_ms=135575 cpu_user_ms=11394.154 cpu_sys_ms=11.174 rss_kb=608 challenge=32 sig=7856 +pid=485 status=OK elapsed_ms=135551 cpu_user_ms=11397.384 cpu_sys_ms=7.513 rss_kb=608 challenge=32 sig=7856 +pid=484 status=OK elapsed_ms=135567 cpu_user_ms=11389.403 cpu_sys_ms=14.946 rss_kb=608 challenge=32 sig=7856 +pid=679 status=OK elapsed_ms=135769 cpu_user_ms=11395.619 cpu_sys_ms=18.756 rss_kb=608 challenge=32 sig=7856 +pid=675 status=OK elapsed_ms=135772 cpu_user_ms=11408.270 cpu_sys_ms=7.538 rss_kb=608 challenge=32 sig=7856 +pid=677 status=OK elapsed_ms=135777 cpu_user_ms=11416.364 cpu_sys_ms=0.000 rss_kb=608 challenge=32 sig=7856 +pid=681 status=OK elapsed_ms=135780 cpu_user_ms=11405.750 cpu_sys_ms=11.255 rss_kb=608 challenge=32 sig=7856 +pid=678 status=OK elapsed_ms=135784 cpu_user_ms=11397.610 cpu_sys_ms=18.690 rss_kb=608 challenge=32 sig=7856 +pid=676 status=OK elapsed_ms=135789 cpu_user_ms=11412.538 cpu_sys_ms=3.739 rss_kb=608 challenge=32 sig=7856 +pid=680 status=OK elapsed_ms=135792 cpu_user_ms=11402.865 cpu_sys_ms=15.029 rss_kb=608 challenge=32 sig=7856 +pid=672 status=OK elapsed_ms=135798 cpu_user_ms=11414.261 cpu_sys_ms=3.770 rss_kb=608 challenge=32 sig=7856 +pid=673 status=OK elapsed_ms=135803 cpu_user_ms=11404.565 cpu_sys_ms=14.960 rss_kb=608 challenge=32 sig=7856 +pid=674 status=OK elapsed_ms=135807 cpu_user_ms=11406.444 cpu_sys_ms=14.976 rss_kb=608 challenge=32 sig=7856 +pid=867 status=OK elapsed_ms=136365 cpu_user_ms=11434.959 cpu_sys_ms=11.291 rss_kb=608 challenge=32 sig=7856 +pid=869 status=OK elapsed_ms=136365 cpu_user_ms=11437.605 cpu_sys_ms=11.243 rss_kb=608 challenge=32 sig=7856 +pid=874 status=OK elapsed_ms=136379 cpu_user_ms=11444.566 cpu_sys_ms=3.759 rss_kb=608 challenge=32 sig=7856 +pid=866 status=OK elapsed_ms=136377 cpu_user_ms=11418.123 cpu_sys_ms=30.008 rss_kb=608 challenge=32 sig=7856 +pid=870 status=OK elapsed_ms=136391 cpu_user_ms=11445.883 cpu_sys_ms=7.464 rss_kb=608 challenge=32 sig=7856 +pid=873 status=OK elapsed_ms=136390 cpu_user_ms=11443.612 cpu_sys_ms=7.473 rss_kb=608 challenge=32 sig=7856 +pid=871 status=OK elapsed_ms=136398 cpu_user_ms=11428.109 cpu_sys_ms=22.457 rss_kb=608 challenge=32 sig=7856 +pid=868 status=OK elapsed_ms=136380 cpu_user_ms=11441.525 cpu_sys_ms=7.507 rss_kb=608 challenge=32 sig=7856 +pid=875 status=OK elapsed_ms=136405 cpu_user_ms=11443.432 cpu_sys_ms=7.455 rss_kb=608 challenge=32 sig=7856 +pid=872 status=OK elapsed_ms=136401 cpu_user_ms=11430.889 cpu_sys_ms=22.329 rss_kb=608 challenge=32 sig=7856 +pid=1068 status=OK elapsed_ms=136129 cpu_user_ms=11428.479 cpu_sys_ms=7.505 rss_kb=608 challenge=32 sig=7856 +pid=1067 status=OK elapsed_ms=136134 cpu_user_ms=11432.769 cpu_sys_ms=7.452 rss_kb=608 challenge=32 sig=7856 +pid=1062 status=OK elapsed_ms=136159 cpu_user_ms=11425.880 cpu_sys_ms=14.929 rss_kb=608 challenge=32 sig=7856 +pid=1063 status=OK elapsed_ms=136140 cpu_user_ms=11435.232 cpu_sys_ms=3.725 rss_kb=608 challenge=32 sig=7856 +pid=1066 status=OK elapsed_ms=136149 cpu_user_ms=11422.194 cpu_sys_ms=15.072 rss_kb=608 challenge=32 sig=7856 +pid=1065 status=OK elapsed_ms=136140 cpu_user_ms=11425.462 cpu_sys_ms=11.217 rss_kb=608 challenge=32 sig=7856 +pid=1060 status=OK elapsed_ms=136158 cpu_user_ms=11425.130 cpu_sys_ms=14.901 rss_kb=608 challenge=32 sig=7856 +pid=1061 status=OK elapsed_ms=136162 cpu_user_ms=11433.921 cpu_sys_ms=7.483 rss_kb=608 challenge=32 sig=7856 +pid=1069 status=OK elapsed_ms=136171 cpu_user_ms=11427.481 cpu_sys_ms=14.898 rss_kb=608 challenge=32 sig=7856 +pid=1064 status=OK elapsed_ms=136199 cpu_user_ms=11433.817 cpu_sys_ms=11.239 rss_kb=608 challenge=32 sig=7856 +pid=1266 status=OK elapsed_ms=135762 cpu_user_ms=11426.816 cpu_sys_ms=7.485 rss_kb=608 challenge=32 sig=7856 +pid=1265 status=OK elapsed_ms=135929 cpu_user_ms=11410.406 cpu_sys_ms=15.073 rss_kb=608 challenge=32 sig=7856 +pid=1260 status=OK elapsed_ms=135958 cpu_user_ms=11422.927 cpu_sys_ms=7.469 rss_kb=608 challenge=32 sig=7856 +pid=1261 status=OK elapsed_ms=135959 cpu_user_ms=11415.571 cpu_sys_ms=15.004 rss_kb=608 challenge=32 sig=7856 +pid=1262 status=OK elapsed_ms=135961 cpu_user_ms=11415.729 cpu_sys_ms=14.922 rss_kb=608 challenge=32 sig=7856 +pid=1267 status=OK elapsed_ms=135967 cpu_user_ms=11427.744 cpu_sys_ms=3.762 rss_kb=608 challenge=32 sig=7856 +pid=1264 status=OK elapsed_ms=135967 cpu_user_ms=11427.369 cpu_sys_ms=3.767 rss_kb=608 challenge=32 sig=7856 +pid=1263 status=OK elapsed_ms=135972 cpu_user_ms=11420.667 cpu_sys_ms=11.200 rss_kb=608 challenge=32 sig=7856 +pid=1259 status=OK elapsed_ms=135983 cpu_user_ms=11422.881 cpu_sys_ms=11.156 rss_kb=608 challenge=32 sig=7856 +pid=1268 status=OK elapsed_ms=135980 cpu_user_ms=11408.857 cpu_sys_ms=26.201 rss_kb=608 challenge=32 sig=7856 +pid=1459 status=OK elapsed_ms=135337 cpu_user_ms=11382.209 cpu_sys_ms=3.761 rss_kb=608 challenge=32 sig=7856 +pid=1454 status=OK elapsed_ms=135347 cpu_user_ms=11374.521 cpu_sys_ms=11.338 rss_kb=608 challenge=32 sig=7856 +pid=1452 status=OK elapsed_ms=135354 cpu_user_ms=11385.174 cpu_sys_ms=3.738 rss_kb=608 challenge=32 sig=7856 +pid=1460 status=OK elapsed_ms=135363 cpu_user_ms=11381.337 cpu_sys_ms=7.513 rss_kb=608 challenge=32 sig=7856 +pid=1461 status=OK elapsed_ms=135364 cpu_user_ms=11382.049 cpu_sys_ms=7.439 rss_kb=608 challenge=32 sig=7856 +pid=1458 status=OK elapsed_ms=135360 cpu_user_ms=11381.735 cpu_sys_ms=7.471 rss_kb=608 challenge=32 sig=7856 +pid=1456 status=OK elapsed_ms=135368 cpu_user_ms=11380.766 cpu_sys_ms=7.480 rss_kb=608 challenge=32 sig=7856 +pid=1455 status=OK elapsed_ms=135370 cpu_user_ms=11373.858 cpu_sys_ms=14.922 rss_kb=608 challenge=32 sig=7856 +pid=1457 status=OK elapsed_ms=135375 cpu_user_ms=11377.364 cpu_sys_ms=15.001 rss_kb=608 challenge=32 sig=7856 +pid=1453 status=OK elapsed_ms=135389 cpu_user_ms=11386.574 cpu_sys_ms=7.470 rss_kb=608 challenge=32 sig=7856 + +sha2-192s simple +log: +pid=2770 status=OK elapsed_ms=292922 cpu_user_ms=24655.677 cpu_sys_ms=15.004 rss_kb=620 challenge=32 sig=16224 +pid=2769 status=OK elapsed_ms=292931 cpu_user_ms=24636.819 cpu_sys_ms=26.217 rss_kb=620 challenge=32 sig=16224 +pid=2775 status=OK elapsed_ms=292951 cpu_user_ms=24658.942 cpu_sys_ms=7.469 rss_kb=620 challenge=32 sig=16224 +pid=2774 status=OK elapsed_ms=292965 cpu_user_ms=24647.079 cpu_sys_ms=22.449 rss_kb=620 challenge=32 sig=16224 +pid=2772 status=OK elapsed_ms=292977 cpu_user_ms=24650.982 cpu_sys_ms=18.605 rss_kb=620 challenge=32 sig=16224 +pid=2771 status=OK elapsed_ms=292954 cpu_user_ms=24649.723 cpu_sys_ms=18.708 rss_kb=620 challenge=32 sig=16224 +pid=2773 status=OK elapsed_ms=292980 cpu_user_ms=24652.003 cpu_sys_ms=18.726 rss_kb=620 challenge=32 sig=16224 +pid=2777 status=OK elapsed_ms=292985 cpu_user_ms=24653.675 cpu_sys_ms=18.620 rss_kb=620 challenge=32 sig=16224 +pid=2776 status=OK elapsed_ms=292987 cpu_user_ms=24648.252 cpu_sys_ms=22.387 rss_kb=620 challenge=32 sig=16224 +pid=2768 status=OK elapsed_ms=292989 cpu_user_ms=24644.101 cpu_sys_ms=29.849 rss_kb=620 challenge=32 sig=16224 +pid=3544 status=OK elapsed_ms=43810 cpu_user_ms=26622.468 cpu_sys_ms=18.635 rss_kb=2368 challenge=32 sig=16224 +pid=1879 status=OK elapsed_ms=314371 cpu_user_ms=26355.509 cpu_sys_ms=30.006 rss_kb=620 challenge=32 sig=16224 +pid=1878 status=OK elapsed_ms=314397 cpu_user_ms=26359.537 cpu_sys_ms=26.050 rss_kb=620 challenge=32 sig=16224 +pid=1880 status=OK elapsed_ms=314414 cpu_user_ms=26362.978 cpu_sys_ms=26.120 rss_kb=620 challenge=32 sig=16224 +pid=1881 status=OK elapsed_ms=314442 cpu_user_ms=26357.837 cpu_sys_ms=33.620 rss_kb=620 challenge=32 sig=16224 +pid=1885 status=OK elapsed_ms=314443 cpu_user_ms=26368.984 cpu_sys_ms=22.243 rss_kb=620 challenge=32 sig=16224 +pid=1876 status=OK elapsed_ms=314422 cpu_user_ms=26369.189 cpu_sys_ms=22.318 rss_kb=620 challenge=32 sig=16224 +pid=1877 status=OK elapsed_ms=314454 cpu_user_ms=26368.773 cpu_sys_ms=26.171 rss_kb=620 challenge=32 sig=16224 +pid=1882 status=OK elapsed_ms=314465 cpu_user_ms=26361.046 cpu_sys_ms=33.661 rss_kb=620 challenge=32 sig=16224 +pid=1883 status=OK elapsed_ms=314469 cpu_user_ms=26371.831 cpu_sys_ms=26.011 rss_kb=620 challenge=32 sig=16224 +pid=1884 status=OK elapsed_ms=314471 cpu_user_ms=26382.447 cpu_sys_ms=14.920 rss_kb=620 challenge=32 sig=16224 +pid=2563 status=OK elapsed_ms=311907 cpu_user_ms=26225.240 cpu_sys_ms=22.338 rss_kb=620 challenge=32 sig=16224 +pid=2567 status=OK elapsed_ms=312027 cpu_user_ms=26214.050 cpu_sys_ms=40.994 rss_kb=620 challenge=32 sig=16224 +pid=2566 status=OK elapsed_ms=312088 cpu_user_ms=26246.558 cpu_sys_ms=14.935 rss_kb=620 challenge=32 sig=16224 +pid=2562 status=OK elapsed_ms=312098 cpu_user_ms=26227.535 cpu_sys_ms=33.599 rss_kb=620 challenge=32 sig=16224 +pid=2564 status=OK elapsed_ms=312101 cpu_user_ms=26230.460 cpu_sys_ms=29.849 rss_kb=620 challenge=32 sig=16224 +pid=2560 status=OK elapsed_ms=312112 cpu_user_ms=26232.539 cpu_sys_ms=29.839 rss_kb=620 challenge=32 sig=16224 +pid=2561 status=OK elapsed_ms=312116 cpu_user_ms=26236.274 cpu_sys_ms=26.193 rss_kb=620 challenge=32 sig=16224 +pid=2558 status=OK elapsed_ms=312125 cpu_user_ms=26209.879 cpu_sys_ms=52.005 rss_kb=620 challenge=32 sig=16224 +pid=2565 status=OK elapsed_ms=312114 cpu_user_ms=26237.775 cpu_sys_ms=29.771 rss_kb=620 challenge=32 sig=16224 +pid=2559 status=OK elapsed_ms=312166 cpu_user_ms=26240.865 cpu_sys_ms=29.831 rss_kb=620 challenge=32 sig=16224 +pid=3270 status=OK elapsed_ms=313394 cpu_user_ms=26291.255 cpu_sys_ms=29.827 rss_kb=620 challenge=32 sig=16224 +pid=3267 status=OK elapsed_ms=313369 cpu_user_ms=26272.107 cpu_sys_ms=41.255 rss_kb=620 challenge=32 sig=16224 +pid=3275 status=OK elapsed_ms=313428 cpu_user_ms=26252.911 cpu_sys_ms=67.313 rss_kb=620 challenge=32 sig=16224 +pid=3268 status=OK elapsed_ms=313426 cpu_user_ms=26287.245 cpu_sys_ms=29.757 rss_kb=620 challenge=32 sig=16224 +pid=3269 status=OK elapsed_ms=313431 cpu_user_ms=26283.008 cpu_sys_ms=33.672 rss_kb=620 challenge=32 sig=16224 +pid=3272 status=OK elapsed_ms=313450 cpu_user_ms=26275.154 cpu_sys_ms=44.902 rss_kb=620 challenge=32 sig=16224 +pid=3273 status=OK elapsed_ms=313457 cpu_user_ms=26281.479 cpu_sys_ms=40.981 rss_kb=620 challenge=32 sig=16224 +pid=3276 status=OK elapsed_ms=313434 cpu_user_ms=26285.665 cpu_sys_ms=29.853 rss_kb=620 challenge=32 sig=16224 +pid=3271 status=OK elapsed_ms=313447 cpu_user_ms=26294.790 cpu_sys_ms=26.039 rss_kb=620 challenge=32 sig=16224 +pid=3274 status=OK elapsed_ms=313488 cpu_user_ms=26274.705 cpu_sys_ms=52.139 rss_kb=620 challenge=32 sig=16224 +pid=3947 status=OK elapsed_ms=313609 cpu_user_ms=26310.622 cpu_sys_ms=22.480 rss_kb=620 challenge=32 sig=16224 +pid=3951 status=OK elapsed_ms=313590 cpu_user_ms=26304.975 cpu_sys_ms=26.301 rss_kb=620 challenge=32 sig=16224 +pid=3945 status=OK elapsed_ms=313604 cpu_user_ms=26304.985 cpu_sys_ms=33.552 rss_kb=620 challenge=32 sig=16224 +pid=3950 status=OK elapsed_ms=313607 cpu_user_ms=26324.766 cpu_sys_ms=11.200 rss_kb=620 challenge=32 sig=16224 +pid=3949 status=OK elapsed_ms=313669 cpu_user_ms=26308.677 cpu_sys_ms=29.695 rss_kb=620 challenge=32 sig=16224 +pid=3948 status=OK elapsed_ms=313660 cpu_user_ms=26331.199 cpu_sys_ms=7.509 rss_kb=620 challenge=32 sig=16224 +pid=3944 status=OK elapsed_ms=313645 cpu_user_ms=26311.567 cpu_sys_ms=26.085 rss_kb=620 challenge=32 sig=16224 +pid=3942 status=OK elapsed_ms=313664 cpu_user_ms=26315.548 cpu_sys_ms=26.073 rss_kb=620 challenge=32 sig=16224 +pid=3943 status=OK elapsed_ms=313672 cpu_user_ms=26309.245 cpu_sys_ms=33.715 rss_kb=620 challenge=32 sig=16224 +pid=3946 status=OK elapsed_ms=313676 cpu_user_ms=26305.242 cpu_sys_ms=40.849 rss_kb=620 challenge=32 sig=16224 +pid=824 status=OK elapsed_ms=313080 cpu_user_ms=26249.416 cpu_sys_ms=37.044 rss_kb=620 challenge=32 sig=16224 +pid=823 status=OK elapsed_ms=313111 cpu_user_ms=26264.467 cpu_sys_ms=26.027 rss_kb=620 challenge=32 sig=16224 +pid=819 status=OK elapsed_ms=313145 cpu_user_ms=26262.177 cpu_sys_ms=29.808 rss_kb=620 challenge=32 sig=16224 +pid=821 status=OK elapsed_ms=313149 cpu_user_ms=26273.457 cpu_sys_ms=18.631 rss_kb=620 challenge=32 sig=16224 +pid=822 status=OK elapsed_ms=313158 cpu_user_ms=26263.841 cpu_sys_ms=30.006 rss_kb=620 challenge=32 sig=16224 +pid=820 status=OK elapsed_ms=313178 cpu_user_ms=26265.597 cpu_sys_ms=29.704 rss_kb=620 challenge=32 sig=16224 +pid=817 status=OK elapsed_ms=313160 cpu_user_ms=26268.313 cpu_sys_ms=26.171 rss_kb=620 challenge=32 sig=16224 +pid=825 status=OK elapsed_ms=313171 cpu_user_ms=26253.191 cpu_sys_ms=41.196 rss_kb=620 challenge=32 sig=16224 +pid=816 status=OK elapsed_ms=313179 cpu_user_ms=26252.191 cpu_sys_ms=48.305 rss_kb=620 challenge=32 sig=16224 +pid=818 status=OK elapsed_ms=313206 cpu_user_ms=26289.509 cpu_sys_ms=15.049 rss_kb=620 challenge=32 sig=16224 +pid=1491 status=OK elapsed_ms=312849 cpu_user_ms=26225.840 cpu_sys_ms=33.690 rss_kb=620 challenge=32 sig=16224 +pid=1492 status=OK elapsed_ms=312963 cpu_user_ms=26223.952 cpu_sys_ms=44.722 rss_kb=620 challenge=32 sig=16224 +pid=1490 status=OK elapsed_ms=312964 cpu_user_ms=26237.667 cpu_sys_ms=29.839 rss_kb=620 challenge=32 sig=16224 +pid=1497 status=OK elapsed_ms=312969 cpu_user_ms=26223.394 cpu_sys_ms=44.660 rss_kb=620 challenge=32 sig=16224 +pid=1489 status=OK elapsed_ms=312972 cpu_user_ms=26241.985 cpu_sys_ms=29.703 rss_kb=620 challenge=32 sig=16224 +pid=1488 status=OK elapsed_ms=312990 cpu_user_ms=26241.265 cpu_sys_ms=29.838 rss_kb=620 challenge=32 sig=16224 +pid=1493 status=OK elapsed_ms=313011 cpu_user_ms=26230.158 cpu_sys_ms=45.085 rss_kb=620 challenge=32 sig=16224 +pid=1495 status=OK elapsed_ms=313002 cpu_user_ms=26251.587 cpu_sys_ms=22.302 rss_kb=620 challenge=32 sig=16224 +pid=1494 status=OK elapsed_ms=313039 cpu_user_ms=26233.139 cpu_sys_ms=44.548 rss_kb=620 challenge=32 sig=16224 +pid=1496 status=OK elapsed_ms=313054 cpu_user_ms=26229.657 cpu_sys_ms=48.399 rss_kb=620 challenge=32 sig=16224 +pid=2165 status=OK elapsed_ms=313136 cpu_user_ms=26255.599 cpu_sys_ms=41.113 rss_kb=620 challenge=32 sig=16224 +pid=2163 status=OK elapsed_ms=313122 cpu_user_ms=26266.762 cpu_sys_ms=29.869 rss_kb=620 challenge=32 sig=16224 +pid=2160 status=OK elapsed_ms=313172 cpu_user_ms=26261.413 cpu_sys_ms=37.553 rss_kb=620 challenge=32 sig=16224 +pid=2157 status=OK elapsed_ms=313172 cpu_user_ms=26263.249 cpu_sys_ms=37.385 rss_kb=620 challenge=32 sig=16224 +pid=2164 status=OK elapsed_ms=313180 cpu_user_ms=26244.116 cpu_sys_ms=55.854 rss_kb=620 challenge=32 sig=16224 +pid=2159 status=OK elapsed_ms=313193 cpu_user_ms=26280.943 cpu_sys_ms=22.336 rss_kb=620 challenge=32 sig=16224 +pid=2158 status=OK elapsed_ms=313226 cpu_user_ms=26271.307 cpu_sys_ms=33.710 rss_kb=620 challenge=32 sig=16224 +pid=2162 status=OK elapsed_ms=313238 cpu_user_ms=26285.665 cpu_sys_ms=22.271 rss_kb=620 challenge=32 sig=16224 +pid=2161 status=OK elapsed_ms=313254 cpu_user_ms=26287.431 cpu_sys_ms=22.289 rss_kb=620 challenge=32 sig=16224 +pid=2156 status=OK elapsed_ms=313269 cpu_user_ms=26267.682 cpu_sys_ms=44.616 rss_kb=620 challenge=32 sig=16224 +pid=2836 status=OK elapsed_ms=312749 cpu_user_ms=26185.749 cpu_sys_ms=59.277 rss_kb=620 challenge=32 sig=16224 +pid=2837 status=OK elapsed_ms=312781 cpu_user_ms=26207.408 cpu_sys_ms=37.371 rss_kb=620 challenge=32 sig=16224 +pid=2838 status=OK elapsed_ms=312764 cpu_user_ms=26208.216 cpu_sys_ms=37.409 rss_kb=620 challenge=32 sig=16224 +pid=2835 status=OK elapsed_ms=312846 cpu_user_ms=26219.147 cpu_sys_ms=33.580 rss_kb=620 challenge=32 sig=16224 +pid=2831 status=OK elapsed_ms=312829 cpu_user_ms=26212.232 cpu_sys_ms=37.237 rss_kb=620 challenge=32 sig=16224 +pid=2834 status=OK elapsed_ms=312865 cpu_user_ms=26231.204 cpu_sys_ms=22.337 rss_kb=620 challenge=32 sig=16224 +pid=2840 status=OK elapsed_ms=312867 cpu_user_ms=26234.754 cpu_sys_ms=22.346 rss_kb=620 challenge=32 sig=16224 +pid=2832 status=OK elapsed_ms=312862 cpu_user_ms=26227.927 cpu_sys_ms=26.092 rss_kb=620 challenge=32 sig=16224 +pid=2833 status=OK elapsed_ms=312879 cpu_user_ms=26218.710 cpu_sys_ms=40.854 rss_kb=620 challenge=32 sig=16224 +pid=2839 status=OK elapsed_ms=312877 cpu_user_ms=26237.278 cpu_sys_ms=22.386 rss_kb=620 challenge=32 sig=16224 +pid=3507 status=OK elapsed_ms=315045 cpu_user_ms=26378.608 cpu_sys_ms=26.091 rss_kb=620 challenge=32 sig=16224 +pid=3503 status=OK elapsed_ms=315115 cpu_user_ms=26401.104 cpu_sys_ms=14.903 rss_kb=620 challenge=32 sig=16224 +pid=3506 status=OK elapsed_ms=315122 cpu_user_ms=26381.063 cpu_sys_ms=37.271 rss_kb=620 challenge=32 sig=16224 +pid=3501 status=OK elapsed_ms=315146 cpu_user_ms=26375.723 cpu_sys_ms=41.098 rss_kb=620 challenge=32 sig=16224 +pid=3508 status=OK elapsed_ms=315164 cpu_user_ms=26399.177 cpu_sys_ms=22.379 rss_kb=620 challenge=32 sig=16224 +pid=3505 status=OK elapsed_ms=315152 cpu_user_ms=26375.545 cpu_sys_ms=41.169 rss_kb=620 challenge=32 sig=16224 +pid=3502 status=OK elapsed_ms=315186 cpu_user_ms=26389.350 cpu_sys_ms=33.583 rss_kb=620 challenge=32 sig=16224 +pid=3500 status=OK elapsed_ms=315180 cpu_user_ms=26367.568 cpu_sys_ms=52.338 rss_kb=620 challenge=32 sig=16224 +pid=3504 status=OK elapsed_ms=315188 cpu_user_ms=26385.968 cpu_sys_ms=33.423 rss_kb=620 challenge=32 sig=16224 +pid=3499 status=OK elapsed_ms=315184 cpu_user_ms=26411.009 cpu_sys_ms=11.187 rss_kb=620 challenge=32 sig=16224 +pid=382 status=OK elapsed_ms=313253 cpu_user_ms=26255.518 cpu_sys_ms=33.497 rss_kb=620 challenge=32 sig=16224 +pid=380 status=OK elapsed_ms=313263 cpu_user_ms=26246.687 cpu_sys_ms=41.145 rss_kb=620 challenge=32 sig=16224 +pid=384 status=OK elapsed_ms=313417 cpu_user_ms=26245.380 cpu_sys_ms=55.723 rss_kb=620 challenge=32 sig=16224 +pid=381 status=OK elapsed_ms=313438 cpu_user_ms=26286.514 cpu_sys_ms=14.987 rss_kb=620 challenge=32 sig=16224 +pid=378 status=OK elapsed_ms=313426 cpu_user_ms=26262.358 cpu_sys_ms=37.109 rss_kb=620 challenge=32 sig=16224 +pid=383 status=OK elapsed_ms=313449 cpu_user_ms=26279.010 cpu_sys_ms=25.949 rss_kb=620 challenge=32 sig=16224 +pid=387 status=OK elapsed_ms=313435 cpu_user_ms=26260.840 cpu_sys_ms=41.025 rss_kb=620 challenge=32 sig=16224 +pid=379 status=OK elapsed_ms=313460 cpu_user_ms=26266.765 cpu_sys_ms=37.338 rss_kb=620 challenge=32 sig=16224 +pid=385 status=OK elapsed_ms=313466 cpu_user_ms=26269.660 cpu_sys_ms=33.759 rss_kb=620 challenge=32 sig=16224 +pid=377 status=OK elapsed_ms=313460 cpu_user_ms=26277.326 cpu_sys_ms=26.161 rss_kb=620 challenge=32 sig=16224 +sha2-256s simple +log: +pid=1258 status=OK elapsed_ms=295854 cpu_user_ms=24837.537 cpu_sys_ms=26.131 rss_kb=568 challenge=32 sig=29792 +pid=1257 status=OK elapsed_ms=295863 cpu_user_ms=24820.793 cpu_sys_ms=44.735 rss_kb=568 challenge=32 sig=29792 +pid=1263 status=OK elapsed_ms=295849 cpu_user_ms=24824.440 cpu_sys_ms=37.479 rss_kb=568 challenge=32 sig=29792 +pid=1255 status=OK elapsed_ms=295867 cpu_user_ms=24857.979 cpu_sys_ms=7.484 rss_kb=568 challenge=32 sig=29792 +pid=1259 status=OK elapsed_ms=295867 cpu_user_ms=24828.861 cpu_sys_ms=37.063 rss_kb=568 challenge=32 sig=29792 +pid=1260 status=OK elapsed_ms=295861 cpu_user_ms=24826.822 cpu_sys_ms=37.372 rss_kb=568 challenge=32 sig=29792 +pid=1254 status=OK elapsed_ms=295894 cpu_user_ms=24830.413 cpu_sys_ms=37.232 rss_kb=568 challenge=32 sig=29792 +pid=1261 status=OK elapsed_ms=295916 cpu_user_ms=24830.596 cpu_sys_ms=44.634 rss_kb=568 challenge=32 sig=29792 +pid=1256 status=OK elapsed_ms=295928 cpu_user_ms=24857.336 cpu_sys_ms=22.303 rss_kb=568 challenge=32 sig=29792 +pid=1262 status=OK elapsed_ms=295921 cpu_user_ms=24854.068 cpu_sys_ms=22.254 rss_kb=568 challenge=32 sig=29792 +pid=1670 status=OK elapsed_ms=295114 cpu_user_ms=24777.069 cpu_sys_ms=18.652 rss_kb=568 challenge=32 sig=29792 +pid=1673 status=OK elapsed_ms=295114 cpu_user_ms=24762.074 cpu_sys_ms=33.651 rss_kb=568 challenge=32 sig=29792 +pid=1666 status=OK elapsed_ms=295118 cpu_user_ms=24760.004 cpu_sys_ms=37.252 rss_kb=568 challenge=32 sig=29792 +pid=1669 status=OK elapsed_ms=295184 cpu_user_ms=24753.042 cpu_sys_ms=52.245 rss_kb=568 challenge=32 sig=29792 +pid=1665 status=OK elapsed_ms=295187 cpu_user_ms=24785.910 cpu_sys_ms=18.685 rss_kb=568 challenge=32 sig=29792 +pid=1668 status=OK elapsed_ms=295192 cpu_user_ms=24782.133 cpu_sys_ms=22.329 rss_kb=568 challenge=32 sig=29792 +pid=1672 status=OK elapsed_ms=295196 cpu_user_ms=24781.781 cpu_sys_ms=22.320 rss_kb=568 challenge=32 sig=29792 +pid=1671 status=OK elapsed_ms=295230 cpu_user_ms=24788.939 cpu_sys_ms=18.680 rss_kb=568 challenge=32 sig=29792 +pid=1664 status=OK elapsed_ms=295235 cpu_user_ms=24777.855 cpu_sys_ms=33.720 rss_kb=568 challenge=32 sig=29792 +pid=1667 status=OK elapsed_ms=295266 cpu_user_ms=24796.081 cpu_sys_ms=18.626 rss_kb=568 challenge=32 sig=29792 +pid=2080 status=OK elapsed_ms=296369 cpu_user_ms=24840.438 cpu_sys_ms=41.064 rss_kb=568 challenge=32 sig=29792 +pid=2081 status=OK elapsed_ms=296463 cpu_user_ms=24875.533 cpu_sys_ms=14.946 rss_kb=568 challenge=32 sig=29792 +pid=2078 status=OK elapsed_ms=296448 cpu_user_ms=24870.926 cpu_sys_ms=18.685 rss_kb=568 challenge=32 sig=29792 +pid=2075 status=OK elapsed_ms=296509 cpu_user_ms=24851.468 cpu_sys_ms=41.226 rss_kb=568 challenge=32 sig=29792 +pid=2073 status=OK elapsed_ms=296538 cpu_user_ms=24860.155 cpu_sys_ms=33.579 rss_kb=568 challenge=32 sig=29792 +pid=2079 status=OK elapsed_ms=296543 cpu_user_ms=24859.027 cpu_sys_ms=37.337 rss_kb=568 challenge=32 sig=29792 +pid=2076 status=OK elapsed_ms=296555 cpu_user_ms=24841.552 cpu_sys_ms=55.997 rss_kb=568 challenge=32 sig=29792 +pid=2077 status=OK elapsed_ms=296583 cpu_user_ms=24873.805 cpu_sys_ms=26.049 rss_kb=568 challenge=32 sig=29792 +pid=2074 status=OK elapsed_ms=296615 cpu_user_ms=24897.455 cpu_sys_ms=7.517 rss_kb=568 challenge=32 sig=29792 +pid=2072 status=OK elapsed_ms=296624 cpu_user_ms=24884.028 cpu_sys_ms=22.328 rss_kb=568 challenge=32 sig=29792 +pid=2491 status=OK elapsed_ms=296494 cpu_user_ms=24848.304 cpu_sys_ms=48.475 rss_kb=568 challenge=32 sig=29792 +pid=2487 status=OK elapsed_ms=296528 cpu_user_ms=24861.696 cpu_sys_ms=37.374 rss_kb=568 challenge=32 sig=29792 +pid=2483 status=OK elapsed_ms=296554 cpu_user_ms=24862.184 cpu_sys_ms=37.330 rss_kb=568 challenge=32 sig=29792 +pid=2488 status=OK elapsed_ms=296616 cpu_user_ms=24869.333 cpu_sys_ms=41.174 rss_kb=568 challenge=32 sig=29792 +pid=2486 status=OK elapsed_ms=296662 cpu_user_ms=24872.450 cpu_sys_ms=37.396 rss_kb=568 challenge=32 sig=29792 +pid=2485 status=OK elapsed_ms=296678 cpu_user_ms=24872.943 cpu_sys_ms=40.926 rss_kb=568 challenge=32 sig=29792 +pid=2482 status=OK elapsed_ms=296679 cpu_user_ms=24879.872 cpu_sys_ms=33.472 rss_kb=568 challenge=32 sig=29792 +pid=2484 status=OK elapsed_ms=296695 cpu_user_ms=24870.298 cpu_sys_ms=44.657 rss_kb=568 challenge=32 sig=29792 +pid=2490 status=OK elapsed_ms=296723 cpu_user_ms=24877.925 cpu_sys_ms=40.897 rss_kb=568 challenge=32 sig=29792 +pid=2489 status=OK elapsed_ms=296745 cpu_user_ms=24885.151 cpu_sys_ms=40.960 rss_kb=568 challenge=32 sig=29792 +pid=2895 status=OK elapsed_ms=295134 cpu_user_ms=24749.258 cpu_sys_ms=52.245 rss_kb=568 challenge=32 sig=29792 +pid=2899 status=OK elapsed_ms=295139 cpu_user_ms=24780.336 cpu_sys_ms=22.450 rss_kb=568 challenge=32 sig=29792 +pid=2898 status=OK elapsed_ms=295152 cpu_user_ms=24778.055 cpu_sys_ms=26.184 rss_kb=568 challenge=32 sig=29792 +pid=2900 status=OK elapsed_ms=295212 cpu_user_ms=24770.266 cpu_sys_ms=37.237 rss_kb=568 challenge=32 sig=29792 +pid=2894 status=OK elapsed_ms=295228 cpu_user_ms=24770.462 cpu_sys_ms=40.850 rss_kb=568 challenge=32 sig=29792 +pid=2893 status=OK elapsed_ms=295244 cpu_user_ms=24772.133 cpu_sys_ms=41.130 rss_kb=568 challenge=32 sig=29792 +pid=2902 status=OK elapsed_ms=295252 cpu_user_ms=24784.988 cpu_sys_ms=29.734 rss_kb=568 challenge=32 sig=29792 +pid=2901 status=OK elapsed_ms=295260 cpu_user_ms=24762.220 cpu_sys_ms=51.780 rss_kb=568 challenge=32 sig=29792 +pid=2897 status=OK elapsed_ms=295278 cpu_user_ms=24799.589 cpu_sys_ms=18.671 rss_kb=568 challenge=32 sig=29792 +pid=2896 status=OK elapsed_ms=295295 cpu_user_ms=24779.145 cpu_sys_ms=41.026 rss_kb=568 challenge=32 sig=29792 +pid=3308 status=OK elapsed_ms=295587 cpu_user_ms=24798.869 cpu_sys_ms=18.749 rss_kb=568 challenge=32 sig=29792 +pid=3309 status=OK elapsed_ms=295639 cpu_user_ms=24788.014 cpu_sys_ms=33.778 rss_kb=568 challenge=32 sig=29792 +pid=3302 status=OK elapsed_ms=295639 cpu_user_ms=24773.492 cpu_sys_ms=48.359 rss_kb=568 challenge=32 sig=29792 +pid=3304 status=OK elapsed_ms=295660 cpu_user_ms=24788.819 cpu_sys_ms=37.470 rss_kb=568 challenge=32 sig=29792 +pid=3306 status=OK elapsed_ms=295611 cpu_user_ms=24793.484 cpu_sys_ms=29.986 rss_kb=568 challenge=32 sig=29792 +pid=3310 status=OK elapsed_ms=295673 cpu_user_ms=24795.079 cpu_sys_ms=29.779 rss_kb=568 challenge=32 sig=29792 +pid=3307 status=OK elapsed_ms=295689 cpu_user_ms=24777.669 cpu_sys_ms=48.397 rss_kb=568 challenge=32 sig=29792 +pid=3303 status=OK elapsed_ms=295695 cpu_user_ms=24803.289 cpu_sys_ms=24.285 rss_kb=568 challenge=32 sig=29792 +pid=3305 status=OK elapsed_ms=295712 cpu_user_ms=24810.706 cpu_sys_ms=22.434 rss_kb=568 challenge=32 sig=29792 +pid=3311 status=OK elapsed_ms=295725 cpu_user_ms=24804.563 cpu_sys_ms=29.880 rss_kb=568 challenge=32 sig=29792 +pid=3712 status=OK elapsed_ms=296183 cpu_user_ms=24819.436 cpu_sys_ms=52.477 rss_kb=568 challenge=32 sig=29792 +pid=3718 status=OK elapsed_ms=296198 cpu_user_ms=24862.467 cpu_sys_ms=11.208 rss_kb=568 challenge=32 sig=29792 +pid=3711 status=OK elapsed_ms=296198 cpu_user_ms=24828.777 cpu_sys_ms=44.512 rss_kb=568 challenge=32 sig=29792 +pid=3714 status=OK elapsed_ms=296233 cpu_user_ms=24839.845 cpu_sys_ms=37.490 rss_kb=568 challenge=32 sig=29792 +pid=3717 status=OK elapsed_ms=296259 cpu_user_ms=24836.510 cpu_sys_ms=44.509 rss_kb=568 challenge=32 sig=29792 +pid=3713 status=OK elapsed_ms=296263 cpu_user_ms=24878.034 cpu_sys_ms=3.736 rss_kb=568 challenge=32 sig=29792 +pid=3715 status=OK elapsed_ms=296267 cpu_user_ms=24848.060 cpu_sys_ms=33.751 rss_kb=568 challenge=32 sig=29792 +pid=3710 status=OK elapsed_ms=296267 cpu_user_ms=24856.263 cpu_sys_ms=26.205 rss_kb=568 challenge=32 sig=29792 +pid=3719 status=OK elapsed_ms=296274 cpu_user_ms=24868.928 cpu_sys_ms=14.920 rss_kb=568 challenge=32 sig=29792 +pid=3716 status=OK elapsed_ms=296280 cpu_user_ms=24852.204 cpu_sys_ms=33.563 rss_kb=568 challenge=32 sig=29792 +pid=331 status=OK elapsed_ms=296105 cpu_user_ms=24816.172 cpu_sys_ms=37.172 rss_kb=568 challenge=32 sig=29792 +pid=332 status=OK elapsed_ms=296124 cpu_user_ms=24810.421 cpu_sys_ms=44.959 rss_kb=568 challenge=32 sig=29792 +pid=327 status=OK elapsed_ms=296178 cpu_user_ms=24841.516 cpu_sys_ms=18.734 rss_kb=568 challenge=32 sig=29792 +pid=328 status=OK elapsed_ms=296288 cpu_user_ms=24839.079 cpu_sys_ms=29.729 rss_kb=568 challenge=32 sig=29792 +pid=325 status=OK elapsed_ms=296317 cpu_user_ms=24833.799 cpu_sys_ms=37.369 rss_kb=568 challenge=32 sig=29792 +pid=324 status=OK elapsed_ms=296322 cpu_user_ms=24820.681 cpu_sys_ms=48.347 rss_kb=568 challenge=32 sig=29792 +pid=333 status=OK elapsed_ms=296325 cpu_user_ms=24824.733 cpu_sys_ms=44.715 rss_kb=568 challenge=32 sig=29792 +pid=326 status=OK elapsed_ms=296335 cpu_user_ms=24831.030 cpu_sys_ms=40.942 rss_kb=568 challenge=32 sig=29792 +pid=329 status=OK elapsed_ms=296359 cpu_user_ms=24834.221 cpu_sys_ms=41.060 rss_kb=568 challenge=32 sig=29792 +pid=334 status=OK elapsed_ms=296381 cpu_user_ms=24850.250 cpu_sys_ms=29.944 rss_kb=568 challenge=32 sig=29792 +pid=748 status=OK elapsed_ms=296739 cpu_user_ms=24892.377 cpu_sys_ms=22.393 rss_kb=568 challenge=32 sig=29792 +pid=740 status=OK elapsed_ms=296740 cpu_user_ms=24911.948 cpu_sys_ms=3.735 rss_kb=568 challenge=32 sig=29792 +pid=746 status=OK elapsed_ms=296784 cpu_user_ms=24892.701 cpu_sys_ms=29.988 rss_kb=568 challenge=32 sig=29792 +pid=747 status=OK elapsed_ms=296797 cpu_user_ms=24888.280 cpu_sys_ms=33.824 rss_kb=568 challenge=32 sig=29792 +pid=741 status=OK elapsed_ms=296801 cpu_user_ms=24887.953 cpu_sys_ms=33.637 rss_kb=568 challenge=32 sig=29792 +pid=744 status=OK elapsed_ms=296824 cpu_user_ms=24894.682 cpu_sys_ms=29.876 rss_kb=568 challenge=32 sig=29792 +pid=743 status=OK elapsed_ms=296814 cpu_user_ms=24869.390 cpu_sys_ms=56.020 rss_kb=568 challenge=32 sig=29792 +pid=742 status=OK elapsed_ms=296839 cpu_user_ms=24887.822 cpu_sys_ms=41.219 rss_kb=568 challenge=32 sig=29792 +pid=749 status=OK elapsed_ms=296831 cpu_user_ms=24898.714 cpu_sys_ms=29.928 rss_kb=568 challenge=32 sig=29792 +pid=745 status=OK elapsed_ms=296832 cpu_user_ms=24902.101 cpu_sys_ms=26.130 rss_kb=568 challenge=32 sig=29792 +pid=1155 status=OK elapsed_ms=296412 cpu_user_ms=24853.441 cpu_sys_ms=22.501 rss_kb=568 challenge=32 sig=29792 +pid=1151 status=OK elapsed_ms=296517 cpu_user_ms=24849.334 cpu_sys_ms=37.295 rss_kb=568 challenge=32 sig=29792 +pid=1154 status=OK elapsed_ms=296519 cpu_user_ms=24845.843 cpu_sys_ms=41.075 rss_kb=568 challenge=32 sig=29792 +pid=1160 status=OK elapsed_ms=296604 cpu_user_ms=24834.810 cpu_sys_ms=60.056 rss_kb=568 challenge=32 sig=29792 +pid=1156 status=OK elapsed_ms=296645 cpu_user_ms=24879.688 cpu_sys_ms=18.675 rss_kb=568 challenge=32 sig=29792 +pid=1158 status=OK elapsed_ms=296639 cpu_user_ms=24877.432 cpu_sys_ms=22.419 rss_kb=568 challenge=32 sig=29792 +pid=1157 status=OK elapsed_ms=296651 cpu_user_ms=24873.322 cpu_sys_ms=26.096 rss_kb=568 challenge=32 sig=29792 +pid=1153 status=OK elapsed_ms=296640 cpu_user_ms=24876.789 cpu_sys_ms=22.506 rss_kb=568 challenge=32 sig=29792 +pid=1152 status=OK elapsed_ms=296647 cpu_user_ms=24872.034 cpu_sys_ms=29.894 rss_kb=568 challenge=32 sig=29792 +pid=1159 status=OK elapsed_ms=296654 cpu_user_ms=24872.658 cpu_sys_ms=29.989 rss_kb=568 challenge=32 sig=29792 +shake-128s simple +log: +pid=3759 status=OK elapsed_ms=296682 cpu_user_ms=24965.625 cpu_sys_ms=18.742 rss_kb=512 challenge=32 sig=7856 +pid=3763 status=OK elapsed_ms=296683 cpu_user_ms=24962.095 cpu_sys_ms=22.353 rss_kb=512 challenge=32 sig=7856 +pid=3760 status=OK elapsed_ms=296702 cpu_user_ms=24960.870 cpu_sys_ms=26.290 rss_kb=512 challenge=32 sig=7856 +pid=3758 status=OK elapsed_ms=296712 cpu_user_ms=24971.079 cpu_sys_ms=18.570 rss_kb=512 challenge=32 sig=7856 +pid=3761 status=OK elapsed_ms=296728 cpu_user_ms=24984.158 cpu_sys_ms=7.469 rss_kb=512 challenge=32 sig=7856 +pid=3766 status=OK elapsed_ms=296725 cpu_user_ms=24976.559 cpu_sys_ms=7.486 rss_kb=512 challenge=32 sig=7856 +pid=3762 status=OK elapsed_ms=296743 cpu_user_ms=24979.708 cpu_sys_ms=14.873 rss_kb=512 challenge=32 sig=7856 +pid=3764 status=OK elapsed_ms=296764 cpu_user_ms=24963.533 cpu_sys_ms=25.888 rss_kb=512 challenge=32 sig=7856 +pid=3757 status=OK elapsed_ms=296751 cpu_user_ms=24957.179 cpu_sys_ms=33.514 rss_kb=512 challenge=32 sig=7856 +pid=3765 status=OK elapsed_ms=296773 cpu_user_ms=24963.656 cpu_sys_ms=29.837 rss_kb=512 challenge=32 sig=7856 +pid=371 status=OK elapsed_ms=295702 cpu_user_ms=24868.697 cpu_sys_ms=18.614 rss_kb=512 challenge=32 sig=7856 +pid=378 status=OK elapsed_ms=295721 cpu_user_ms=24865.735 cpu_sys_ms=26.125 rss_kb=512 challenge=32 sig=7856 +pid=373 status=OK elapsed_ms=295722 cpu_user_ms=24870.303 cpu_sys_ms=22.358 rss_kb=512 challenge=32 sig=7856 +pid=372 status=OK elapsed_ms=295702 cpu_user_ms=24869.578 cpu_sys_ms=22.343 rss_kb=512 challenge=32 sig=7856 +pid=374 status=OK elapsed_ms=295766 cpu_user_ms=24881.103 cpu_sys_ms=14.935 rss_kb=512 challenge=32 sig=7856 +pid=376 status=OK elapsed_ms=295728 cpu_user_ms=24876.699 cpu_sys_ms=18.584 rss_kb=512 challenge=32 sig=7856 +pid=377 status=OK elapsed_ms=295783 cpu_user_ms=24878.196 cpu_sys_ms=18.579 rss_kb=512 challenge=32 sig=7856 +pid=380 status=OK elapsed_ms=295799 cpu_user_ms=24886.349 cpu_sys_ms=14.911 rss_kb=512 challenge=32 sig=7856 +pid=379 status=OK elapsed_ms=295793 cpu_user_ms=24892.201 cpu_sys_ms=7.419 rss_kb=512 challenge=32 sig=7856 +pid=375 status=OK elapsed_ms=295815 cpu_user_ms=24869.671 cpu_sys_ms=33.560 rss_kb=512 challenge=32 sig=7856 +pid=787 status=OK elapsed_ms=296526 cpu_user_ms=24931.323 cpu_sys_ms=18.670 rss_kb=512 challenge=32 sig=7856 +pid=788 status=OK elapsed_ms=296529 cpu_user_ms=24942.923 cpu_sys_ms=7.512 rss_kb=512 challenge=32 sig=7856 +pid=792 status=OK elapsed_ms=296537 cpu_user_ms=24925.699 cpu_sys_ms=29.754 rss_kb=512 challenge=32 sig=7856 +pid=791 status=OK elapsed_ms=296543 cpu_user_ms=24929.593 cpu_sys_ms=22.321 rss_kb=512 challenge=32 sig=7856 +pid=786 status=OK elapsed_ms=296583 cpu_user_ms=24936.345 cpu_sys_ms=18.664 rss_kb=512 challenge=32 sig=7856 +pid=790 status=OK elapsed_ms=296585 cpu_user_ms=24937.074 cpu_sys_ms=18.593 rss_kb=512 challenge=32 sig=7856 +pid=789 status=OK elapsed_ms=296569 cpu_user_ms=24940.441 cpu_sys_ms=14.898 rss_kb=512 challenge=32 sig=7856 +pid=793 status=OK elapsed_ms=296598 cpu_user_ms=24940.787 cpu_sys_ms=18.506 rss_kb=512 challenge=32 sig=7856 +pid=784 status=OK elapsed_ms=296603 cpu_user_ms=24941.962 cpu_sys_ms=18.535 rss_kb=512 challenge=32 sig=7856 +pid=785 status=OK elapsed_ms=296614 cpu_user_ms=24944.962 cpu_sys_ms=14.872 rss_kb=512 challenge=32 sig=7856 +pid=1199 status=OK elapsed_ms=296049 cpu_user_ms=24874.756 cpu_sys_ms=26.070 rss_kb=512 challenge=32 sig=7856 +pid=1198 status=OK elapsed_ms=296060 cpu_user_ms=24881.418 cpu_sys_ms=18.721 rss_kb=512 challenge=32 sig=7856 +pid=1201 status=OK elapsed_ms=296076 cpu_user_ms=24885.949 cpu_sys_ms=18.608 rss_kb=512 challenge=32 sig=7856 +pid=1197 status=OK elapsed_ms=296109 cpu_user_ms=24887.918 cpu_sys_ms=18.730 rss_kb=512 challenge=32 sig=7856 +pid=1202 status=OK elapsed_ms=296114 cpu_user_ms=24886.979 cpu_sys_ms=22.306 rss_kb=512 challenge=32 sig=7856 +pid=1203 status=OK elapsed_ms=296122 cpu_user_ms=24889.756 cpu_sys_ms=18.595 rss_kb=512 challenge=32 sig=7856 +pid=1195 status=OK elapsed_ms=296104 cpu_user_ms=24893.402 cpu_sys_ms=14.878 rss_kb=512 challenge=32 sig=7856 +pid=1200 status=OK elapsed_ms=296137 cpu_user_ms=24891.329 cpu_sys_ms=18.550 rss_kb=512 challenge=32 sig=7856 +pid=1204 status=OK elapsed_ms=296150 cpu_user_ms=24900.683 cpu_sys_ms=14.976 rss_kb=512 challenge=32 sig=7856 +pid=1196 status=OK elapsed_ms=296151 cpu_user_ms=24885.346 cpu_sys_ms=29.845 rss_kb=512 challenge=32 sig=7856 +pid=1608 status=OK elapsed_ms=296083 cpu_user_ms=24871.794 cpu_sys_ms=26.173 rss_kb=512 challenge=32 sig=7856 +pid=1615 status=OK elapsed_ms=296079 cpu_user_ms=24875.154 cpu_sys_ms=22.407 rss_kb=512 challenge=32 sig=7856 +pid=1614 status=OK elapsed_ms=296100 cpu_user_ms=24872.147 cpu_sys_ms=29.718 rss_kb=512 challenge=32 sig=7856 +pid=1609 status=OK elapsed_ms=296100 cpu_user_ms=24883.421 cpu_sys_ms=18.771 rss_kb=512 challenge=32 sig=7856 +pid=1612 status=OK elapsed_ms=296108 cpu_user_ms=24875.193 cpu_sys_ms=25.994 rss_kb=512 challenge=32 sig=7856 +pid=1607 status=OK elapsed_ms=296087 cpu_user_ms=24889.255 cpu_sys_ms=11.232 rss_kb=512 challenge=32 sig=7856 +pid=1610 status=OK elapsed_ms=296137 cpu_user_ms=24899.490 cpu_sys_ms=7.448 rss_kb=512 challenge=32 sig=7856 +pid=1611 status=OK elapsed_ms=296141 cpu_user_ms=24888.586 cpu_sys_ms=18.692 rss_kb=512 challenge=32 sig=7856 +pid=1613 status=OK elapsed_ms=296132 cpu_user_ms=24879.080 cpu_sys_ms=26.035 rss_kb=512 challenge=32 sig=7856 +pid=1606 status=OK elapsed_ms=296130 cpu_user_ms=24880.293 cpu_sys_ms=26.064 rss_kb=512 challenge=32 sig=7856 +pid=2019 status=OK elapsed_ms=296630 cpu_user_ms=24917.444 cpu_sys_ms=26.056 rss_kb=512 challenge=32 sig=7856 +pid=2024 status=OK elapsed_ms=296642 cpu_user_ms=24921.221 cpu_sys_ms=22.441 rss_kb=512 challenge=32 sig=7856 +pid=2022 status=OK elapsed_ms=296647 cpu_user_ms=24919.521 cpu_sys_ms=26.075 rss_kb=512 challenge=32 sig=7856 +pid=2023 status=OK elapsed_ms=296647 cpu_user_ms=24923.855 cpu_sys_ms=22.263 rss_kb=512 challenge=32 sig=7856 +pid=2018 status=OK elapsed_ms=296674 cpu_user_ms=24934.458 cpu_sys_ms=14.896 rss_kb=512 challenge=32 sig=7856 +pid=2017 status=OK elapsed_ms=296668 cpu_user_ms=24921.700 cpu_sys_ms=22.478 rss_kb=512 challenge=32 sig=7856 +pid=2021 status=OK elapsed_ms=296699 cpu_user_ms=24944.993 cpu_sys_ms=7.421 rss_kb=512 challenge=32 sig=7856 +pid=2020 status=OK elapsed_ms=296702 cpu_user_ms=24926.487 cpu_sys_ms=26.302 rss_kb=512 challenge=32 sig=7856 +pid=2025 status=OK elapsed_ms=296717 cpu_user_ms=24921.981 cpu_sys_ms=33.325 rss_kb=512 challenge=32 sig=7856 +pid=2016 status=OK elapsed_ms=296736 cpu_user_ms=24934.561 cpu_sys_ms=25.991 rss_kb=512 challenge=32 sig=7856 +pid=2432 status=OK elapsed_ms=297258 cpu_user_ms=24944.705 cpu_sys_ms=26.133 rss_kb=512 challenge=32 sig=7856 +pid=2428 status=OK elapsed_ms=297348 cpu_user_ms=24966.728 cpu_sys_ms=11.173 rss_kb=512 challenge=32 sig=7856 +pid=2431 status=OK elapsed_ms=297363 cpu_user_ms=24950.046 cpu_sys_ms=29.760 rss_kb=512 challenge=32 sig=7856 +pid=2429 status=OK elapsed_ms=297366 cpu_user_ms=24957.593 cpu_sys_ms=22.359 rss_kb=512 challenge=32 sig=7856 +pid=2434 status=OK elapsed_ms=297357 cpu_user_ms=24964.010 cpu_sys_ms=11.189 rss_kb=512 challenge=32 sig=7856 +pid=2425 status=OK elapsed_ms=297364 cpu_user_ms=24948.549 cpu_sys_ms=26.050 rss_kb=512 challenge=32 sig=7856 +pid=2433 status=OK elapsed_ms=297382 cpu_user_ms=24958.653 cpu_sys_ms=22.326 rss_kb=512 challenge=32 sig=7856 +pid=2430 status=OK elapsed_ms=297370 cpu_user_ms=24954.372 cpu_sys_ms=25.991 rss_kb=512 challenge=32 sig=7856 +pid=2426 status=OK elapsed_ms=297385 cpu_user_ms=24955.647 cpu_sys_ms=26.100 rss_kb=512 challenge=32 sig=7856 +pid=2427 status=OK elapsed_ms=297451 cpu_user_ms=24964.536 cpu_sys_ms=22.262 rss_kb=512 challenge=32 sig=7856 +pid=2838 status=OK elapsed_ms=297543 cpu_user_ms=24946.575 cpu_sys_ms=29.885 rss_kb=512 challenge=32 sig=7856 +pid=2844 status=OK elapsed_ms=297570 cpu_user_ms=24960.280 cpu_sys_ms=18.676 rss_kb=512 challenge=32 sig=7856 +pid=2840 status=OK elapsed_ms=297583 cpu_user_ms=24948.116 cpu_sys_ms=33.412 rss_kb=512 challenge=32 sig=7856 +pid=2846 status=OK elapsed_ms=297571 cpu_user_ms=24957.320 cpu_sys_ms=22.266 rss_kb=512 challenge=32 sig=7856 +pid=2845 status=OK elapsed_ms=297587 cpu_user_ms=24958.797 cpu_sys_ms=22.334 rss_kb=512 challenge=32 sig=7856 +pid=2841 status=OK elapsed_ms=297599 cpu_user_ms=24964.829 cpu_sys_ms=18.622 rss_kb=512 challenge=32 sig=7856 +pid=2847 status=OK elapsed_ms=297599 cpu_user_ms=24955.716 cpu_sys_ms=26.044 rss_kb=512 challenge=32 sig=7856 +pid=2839 status=OK elapsed_ms=297629 cpu_user_ms=24961.436 cpu_sys_ms=29.759 rss_kb=512 challenge=32 sig=7856 +pid=2842 status=OK elapsed_ms=297633 cpu_user_ms=24968.101 cpu_sys_ms=18.525 rss_kb=512 challenge=32 sig=7856 +pid=2843 status=OK elapsed_ms=297642 cpu_user_ms=24982.777 cpu_sys_ms=11.077 rss_kb=512 challenge=32 sig=7856 +pid=3257 status=OK elapsed_ms=297539 cpu_user_ms=24967.443 cpu_sys_ms=14.934 rss_kb=512 challenge=32 sig=7856 +pid=3256 status=OK elapsed_ms=297541 cpu_user_ms=24955.220 cpu_sys_ms=29.890 rss_kb=512 challenge=32 sig=7856 +pid=3254 status=OK elapsed_ms=297568 cpu_user_ms=24963.376 cpu_sys_ms=26.108 rss_kb=512 challenge=32 sig=7856 +pid=3258 status=OK elapsed_ms=297587 cpu_user_ms=24963.888 cpu_sys_ms=26.163 rss_kb=512 challenge=32 sig=7856 +pid=3253 status=OK elapsed_ms=297613 cpu_user_ms=24970.375 cpu_sys_ms=22.321 rss_kb=512 challenge=32 sig=7856 +pid=3255 status=OK elapsed_ms=297612 cpu_user_ms=24973.888 cpu_sys_ms=18.654 rss_kb=512 challenge=32 sig=7856 +pid=3250 status=OK elapsed_ms=297600 cpu_user_ms=24988.134 cpu_sys_ms=3.706 rss_kb=512 challenge=32 sig=7856 +pid=3252 status=OK elapsed_ms=297605 cpu_user_ms=24963.870 cpu_sys_ms=29.666 rss_kb=512 challenge=32 sig=7856 +pid=3251 status=OK elapsed_ms=297621 cpu_user_ms=24981.171 cpu_sys_ms=14.903 rss_kb=512 challenge=32 sig=7856 +pid=3249 status=OK elapsed_ms=297624 cpu_user_ms=24995.948 cpu_sys_ms=0.000 rss_kb=512 challenge=32 sig=7856 +pid=3666 status=OK elapsed_ms=298104 cpu_user_ms=25014.394 cpu_sys_ms=18.575 rss_kb=512 challenge=32 sig=7856 +pid=3669 status=OK elapsed_ms=298112 cpu_user_ms=24997.774 cpu_sys_ms=33.826 rss_kb=512 challenge=32 sig=7856 +pid=3667 status=OK elapsed_ms=298139 cpu_user_ms=25033.552 cpu_sys_ms=3.739 rss_kb=512 challenge=32 sig=7856 +pid=3668 status=OK elapsed_ms=298156 cpu_user_ms=24984.959 cpu_sys_ms=52.184 rss_kb=512 challenge=32 sig=7856 +pid=3662 status=OK elapsed_ms=298147 cpu_user_ms=24991.596 cpu_sys_ms=44.564 rss_kb=512 challenge=32 sig=7856 +pid=3665 status=OK elapsed_ms=298171 cpu_user_ms=25022.526 cpu_sys_ms=14.938 rss_kb=512 challenge=32 sig=7856 +pid=3660 status=OK elapsed_ms=298177 cpu_user_ms=25025.256 cpu_sys_ms=14.965 rss_kb=512 challenge=32 sig=7856 +pid=3663 status=OK elapsed_ms=298192 cpu_user_ms=24992.117 cpu_sys_ms=48.204 rss_kb=512 challenge=32 sig=7856 +pid=3664 status=OK elapsed_ms=298196 cpu_user_ms=25019.788 cpu_sys_ms=22.306 rss_kb=512 challenge=32 sig=7856 +pid=3661 status=OK elapsed_ms=298201 cpu_user_ms=25018.279 cpu_sys_ms=29.692 rss_kb=512 challenge=32 sig=7856 +shake-192s simple +log: +pid=3166 status=OK elapsed_ms=516954 cpu_user_ms=43325.789 cpu_sys_ms=33.716 rss_kb=584 challenge=32 sig=16224 +pid=3172 status=OK elapsed_ms=517023 cpu_user_ms=43334.626 cpu_sys_ms=26.159 rss_kb=584 challenge=32 sig=16224 +pid=3171 status=OK elapsed_ms=517079 cpu_user_ms=43338.592 cpu_sys_ms=29.829 rss_kb=584 challenge=32 sig=16224 +pid=3167 status=OK elapsed_ms=517138 cpu_user_ms=43355.833 cpu_sys_ms=22.407 rss_kb=584 challenge=32 sig=16224 +pid=3168 status=OK elapsed_ms=517152 cpu_user_ms=43350.508 cpu_sys_ms=26.084 rss_kb=584 challenge=32 sig=16224 +pid=3164 status=OK elapsed_ms=517122 cpu_user_ms=43317.909 cpu_sys_ms=51.975 rss_kb=584 challenge=32 sig=16224 +pid=3165 status=OK elapsed_ms=517193 cpu_user_ms=43337.343 cpu_sys_ms=44.670 rss_kb=584 challenge=32 sig=16224 +pid=3173 status=OK elapsed_ms=517181 cpu_user_ms=43348.980 cpu_sys_ms=33.518 rss_kb=584 challenge=32 sig=16224 +pid=3169 status=OK elapsed_ms=517224 cpu_user_ms=43352.413 cpu_sys_ms=37.376 rss_kb=584 challenge=32 sig=16224 +pid=3170 status=OK elapsed_ms=517204 cpu_user_ms=43319.427 cpu_sys_ms=63.158 rss_kb=584 challenge=32 sig=16224 +pid=3877 status=OK elapsed_ms=516125 cpu_user_ms=43280.493 cpu_sys_ms=40.850 rss_kb=584 challenge=32 sig=16224 +pid=3880 status=OK elapsed_ms=517104 cpu_user_ms=43264.794 cpu_sys_ms=48.591 rss_kb=584 challenge=32 sig=16224 +pid=3873 status=OK elapsed_ms=517151 cpu_user_ms=43284.407 cpu_sys_ms=33.463 rss_kb=584 challenge=32 sig=16224 +pid=3874 status=OK elapsed_ms=517162 cpu_user_ms=43259.446 cpu_sys_ms=60.040 rss_kb=584 challenge=32 sig=16224 +pid=3875 status=OK elapsed_ms=517188 cpu_user_ms=43293.560 cpu_sys_ms=29.895 rss_kb=584 challenge=32 sig=16224 +pid=3878 status=OK elapsed_ms=517215 cpu_user_ms=43294.831 cpu_sys_ms=33.563 rss_kb=584 challenge=32 sig=16224 +pid=3879 status=OK elapsed_ms=517267 cpu_user_ms=43307.397 cpu_sys_ms=22.479 rss_kb=584 challenge=32 sig=16224 +pid=3872 status=OK elapsed_ms=517273 cpu_user_ms=43283.354 cpu_sys_ms=48.460 rss_kb=584 challenge=32 sig=16224 +pid=3871 status=OK elapsed_ms=517275 cpu_user_ms=43288.978 cpu_sys_ms=44.467 rss_kb=584 challenge=32 sig=16224 +pid=3876 status=OK elapsed_ms=517286 cpu_user_ms=43278.536 cpu_sys_ms=59.410 rss_kb=584 challenge=32 sig=16224 +pid=797 status=OK elapsed_ms=525480 cpu_user_ms=43353.405 cpu_sys_ms=55.853 rss_kb=584 challenge=32 sig=16224 +pid=795 status=OK elapsed_ms=525487 cpu_user_ms=43367.899 cpu_sys_ms=44.777 rss_kb=584 challenge=32 sig=16224 +pid=794 status=OK elapsed_ms=525529 cpu_user_ms=43358.027 cpu_sys_ms=55.890 rss_kb=584 challenge=32 sig=16224 +pid=793 status=OK elapsed_ms=525535 cpu_user_ms=43355.361 cpu_sys_ms=59.471 rss_kb=584 challenge=32 sig=16224 +pid=791 status=OK elapsed_ms=525561 cpu_user_ms=43371.923 cpu_sys_ms=44.745 rss_kb=584 challenge=32 sig=16224 +pid=789 status=OK elapsed_ms=525562 cpu_user_ms=43376.361 cpu_sys_ms=40.796 rss_kb=584 challenge=32 sig=16224 +pid=790 status=OK elapsed_ms=525566 cpu_user_ms=43387.594 cpu_sys_ms=29.843 rss_kb=584 challenge=32 sig=16224 +pid=792 status=OK elapsed_ms=525572 cpu_user_ms=43386.121 cpu_sys_ms=33.421 rss_kb=584 challenge=32 sig=16224 +pid=798 status=OK elapsed_ms=525577 cpu_user_ms=43368.103 cpu_sys_ms=51.992 rss_kb=584 challenge=32 sig=16224 +pid=796 status=OK elapsed_ms=525580 cpu_user_ms=43403.338 cpu_sys_ms=14.879 rss_kb=584 challenge=32 sig=16224 +pid=1521 status=OK elapsed_ms=517664 cpu_user_ms=43335.410 cpu_sys_ms=52.260 rss_kb=584 challenge=32 sig=16224 +pid=1524 status=OK elapsed_ms=517827 cpu_user_ms=43373.773 cpu_sys_ms=22.372 rss_kb=584 challenge=32 sig=16224 +pid=1522 status=OK elapsed_ms=517880 cpu_user_ms=43355.241 cpu_sys_ms=44.768 rss_kb=584 challenge=32 sig=16224 +pid=1525 status=OK elapsed_ms=517901 cpu_user_ms=43357.171 cpu_sys_ms=44.797 rss_kb=584 challenge=32 sig=16224 +pid=1523 status=OK elapsed_ms=517944 cpu_user_ms=43377.369 cpu_sys_ms=29.872 rss_kb=584 challenge=32 sig=16224 +pid=1527 status=OK elapsed_ms=517969 cpu_user_ms=43374.735 cpu_sys_ms=33.542 rss_kb=584 challenge=32 sig=16224 +pid=1519 status=OK elapsed_ms=517970 cpu_user_ms=43359.901 cpu_sys_ms=48.558 rss_kb=584 challenge=32 sig=16224 +pid=1520 status=OK elapsed_ms=517974 cpu_user_ms=43335.641 cpu_sys_ms=71.032 rss_kb=584 challenge=32 sig=16224 +pid=1526 status=OK elapsed_ms=518002 cpu_user_ms=43375.128 cpu_sys_ms=40.986 rss_kb=584 challenge=32 sig=16224 +pid=1528 status=OK elapsed_ms=517978 cpu_user_ms=43386.939 cpu_sys_ms=22.548 rss_kb=584 challenge=32 sig=16224 +pid=2225 status=OK elapsed_ms=518866 cpu_user_ms=43395.320 cpu_sys_ms=63.536 rss_kb=584 challenge=32 sig=16224 +pid=2224 status=OK elapsed_ms=518868 cpu_user_ms=43413.940 cpu_sys_ms=44.948 rss_kb=584 challenge=32 sig=16224 +pid=2226 status=OK elapsed_ms=518886 cpu_user_ms=43437.749 cpu_sys_ms=26.216 rss_kb=584 challenge=32 sig=16224 +pid=2228 status=OK elapsed_ms=518921 cpu_user_ms=43395.592 cpu_sys_ms=71.078 rss_kb=584 challenge=32 sig=16224 +pid=2227 status=OK elapsed_ms=518955 cpu_user_ms=43387.765 cpu_sys_ms=82.324 rss_kb=584 challenge=32 sig=16224 +pid=2223 status=OK elapsed_ms=518965 cpu_user_ms=43413.939 cpu_sys_ms=56.020 rss_kb=584 challenge=32 sig=16224 +pid=2230 status=OK elapsed_ms=518968 cpu_user_ms=43426.756 cpu_sys_ms=44.677 rss_kb=584 challenge=32 sig=16224 +pid=2231 status=OK elapsed_ms=518972 cpu_user_ms=43424.883 cpu_sys_ms=48.441 rss_kb=584 challenge=32 sig=16224 +pid=2229 status=OK elapsed_ms=518979 cpu_user_ms=43436.503 cpu_sys_ms=40.870 rss_kb=584 challenge=32 sig=16224 +pid=2232 status=OK elapsed_ms=519000 cpu_user_ms=43444.318 cpu_sys_ms=40.983 rss_kb=584 challenge=32 sig=16224 +pid=2943 status=OK elapsed_ms=517442 cpu_user_ms=43266.372 cpu_sys_ms=52.385 rss_kb=584 challenge=32 sig=16224 +pid=2941 status=OK elapsed_ms=517461 cpu_user_ms=43282.195 cpu_sys_ms=41.156 rss_kb=584 challenge=32 sig=16224 +pid=2940 status=OK elapsed_ms=517470 cpu_user_ms=43278.127 cpu_sys_ms=44.790 rss_kb=584 challenge=32 sig=16224 +pid=2938 status=OK elapsed_ms=517521 cpu_user_ms=43289.642 cpu_sys_ms=37.398 rss_kb=584 challenge=32 sig=16224 +pid=2935 status=OK elapsed_ms=517520 cpu_user_ms=43265.172 cpu_sys_ms=59.706 rss_kb=584 challenge=32 sig=16224 +pid=2939 status=OK elapsed_ms=517546 cpu_user_ms=43287.034 cpu_sys_ms=40.892 rss_kb=584 challenge=32 sig=16224 +pid=2942 status=OK elapsed_ms=517554 cpu_user_ms=43318.299 cpu_sys_ms=14.949 rss_kb=584 challenge=32 sig=16224 +pid=2944 status=OK elapsed_ms=517563 cpu_user_ms=43276.664 cpu_sys_ms=55.975 rss_kb=584 challenge=32 sig=16224 +pid=2937 status=OK elapsed_ms=517565 cpu_user_ms=43298.178 cpu_sys_ms=33.603 rss_kb=584 challenge=32 sig=16224 +pid=2936 status=OK elapsed_ms=517574 cpu_user_ms=43272.032 cpu_sys_ms=63.285 rss_kb=584 challenge=32 sig=16224 +pid=3646 status=OK elapsed_ms=517420 cpu_user_ms=43351.649 cpu_sys_ms=56.031 rss_kb=584 challenge=32 sig=16224 +pid=3645 status=OK elapsed_ms=517425 cpu_user_ms=43398.057 cpu_sys_ms=14.973 rss_kb=584 challenge=32 sig=16224 +pid=3647 status=OK elapsed_ms=517438 cpu_user_ms=43386.264 cpu_sys_ms=29.779 rss_kb=584 challenge=32 sig=16224 +pid=3643 status=OK elapsed_ms=517444 cpu_user_ms=43398.396 cpu_sys_ms=18.624 rss_kb=584 challenge=32 sig=16224 +pid=3649 status=OK elapsed_ms=517455 cpu_user_ms=43393.133 cpu_sys_ms=26.082 rss_kb=584 challenge=32 sig=16224 +pid=3651 status=OK elapsed_ms=517456 cpu_user_ms=43390.700 cpu_sys_ms=26.112 rss_kb=584 challenge=32 sig=16224 +pid=3648 status=OK elapsed_ms=517468 cpu_user_ms=43373.469 cpu_sys_ms=44.766 rss_kb=584 challenge=32 sig=16224 +pid=3650 status=OK elapsed_ms=517506 cpu_user_ms=43373.332 cpu_sys_ms=48.406 rss_kb=584 challenge=32 sig=16224 +pid=3644 status=OK elapsed_ms=517532 cpu_user_ms=43400.834 cpu_sys_ms=29.808 rss_kb=584 challenge=32 sig=16224 +pid=3642 status=OK elapsed_ms=517537 cpu_user_ms=43400.813 cpu_sys_ms=33.462 rss_kb=584 challenge=32 sig=16224 +pid=1171 status=OK elapsed_ms=515720 cpu_user_ms=43349.072 cpu_sys_ms=29.865 rss_kb=584 challenge=32 sig=16224 +pid=1173 status=OK elapsed_ms=515769 cpu_user_ms=43376.343 cpu_sys_ms=7.436 rss_kb=584 challenge=32 sig=16224 +pid=1169 status=OK elapsed_ms=515795 cpu_user_ms=43353.267 cpu_sys_ms=29.792 rss_kb=584 challenge=32 sig=16224 +pid=1174 status=OK elapsed_ms=515804 cpu_user_ms=43363.725 cpu_sys_ms=22.352 rss_kb=584 challenge=32 sig=16224 +pid=1168 status=OK elapsed_ms=515757 cpu_user_ms=43364.944 cpu_sys_ms=14.981 rss_kb=584 challenge=32 sig=16224 +pid=1175 status=OK elapsed_ms=515780 cpu_user_ms=43365.249 cpu_sys_ms=18.686 rss_kb=584 challenge=32 sig=16224 +pid=1167 status=OK elapsed_ms=515814 cpu_user_ms=43349.635 cpu_sys_ms=37.315 rss_kb=584 challenge=32 sig=16224 +pid=1172 status=OK elapsed_ms=515820 cpu_user_ms=43355.661 cpu_sys_ms=29.828 rss_kb=584 challenge=32 sig=16224 +pid=1176 status=OK elapsed_ms=515775 cpu_user_ms=43350.542 cpu_sys_ms=37.266 rss_kb=584 challenge=32 sig=16224 +pid=1170 status=OK elapsed_ms=515866 cpu_user_ms=43363.758 cpu_sys_ms=37.206 rss_kb=584 challenge=32 sig=16224 +pid=1877 status=OK elapsed_ms=515193 cpu_user_ms=43302.023 cpu_sys_ms=29.920 rss_kb=584 challenge=32 sig=16224 +pid=1875 status=OK elapsed_ms=515225 cpu_user_ms=43314.348 cpu_sys_ms=22.296 rss_kb=584 challenge=32 sig=16224 +pid=1881 status=OK elapsed_ms=515242 cpu_user_ms=43301.711 cpu_sys_ms=37.257 rss_kb=584 challenge=32 sig=16224 +pid=1883 status=OK elapsed_ms=515251 cpu_user_ms=43318.369 cpu_sys_ms=22.376 rss_kb=584 challenge=32 sig=16224 +pid=1878 status=OK elapsed_ms=515248 cpu_user_ms=43316.012 cpu_sys_ms=22.368 rss_kb=584 challenge=32 sig=16224 +pid=1874 status=OK elapsed_ms=515251 cpu_user_ms=43307.405 cpu_sys_ms=33.364 rss_kb=584 challenge=32 sig=16224 +pid=1879 status=OK elapsed_ms=515272 cpu_user_ms=43312.188 cpu_sys_ms=29.868 rss_kb=584 challenge=32 sig=16224 +pid=1876 status=OK elapsed_ms=515304 cpu_user_ms=43309.572 cpu_sys_ms=41.037 rss_kb=584 challenge=32 sig=16224 +pid=1882 status=OK elapsed_ms=515314 cpu_user_ms=43320.515 cpu_sys_ms=33.524 rss_kb=584 challenge=32 sig=16224 +pid=1880 status=OK elapsed_ms=515330 cpu_user_ms=43335.007 cpu_sys_ms=22.348 rss_kb=584 challenge=32 sig=16224 +shake-256s simple +log: +pid=445 status=OK elapsed_ms=449691 cpu_user_ms=37729.704 cpu_sys_ms=40.909 rss_kb=660 challenge=32 sig=29792 +pid=450 status=OK elapsed_ms=449764 cpu_user_ms=37751.824 cpu_sys_ms=22.297 rss_kb=660 challenge=32 sig=29792 +pid=444 status=OK elapsed_ms=449771 cpu_user_ms=37754.252 cpu_sys_ms=22.328 rss_kb=660 challenge=32 sig=29792 +pid=452 status=OK elapsed_ms=449785 cpu_user_ms=37740.836 cpu_sys_ms=37.248 rss_kb=660 challenge=32 sig=29792 +pid=449 status=OK elapsed_ms=449797 cpu_user_ms=37758.558 cpu_sys_ms=18.644 rss_kb=660 challenge=32 sig=29792 +pid=447 status=OK elapsed_ms=449809 cpu_user_ms=37750.582 cpu_sys_ms=37.035 rss_kb=660 challenge=32 sig=29792 +pid=448 status=OK elapsed_ms=449812 cpu_user_ms=37761.333 cpu_sys_ms=25.957 rss_kb=660 challenge=32 sig=29792 +pid=446 status=OK elapsed_ms=449840 cpu_user_ms=37763.358 cpu_sys_ms=26.045 rss_kb=660 challenge=32 sig=29792 +pid=451 status=OK elapsed_ms=449843 cpu_user_ms=37759.972 cpu_sys_ms=29.723 rss_kb=660 challenge=32 sig=29792 +pid=453 status=OK elapsed_ms=449853 cpu_user_ms=37756.620 cpu_sys_ms=33.451 rss_kb=660 challenge=32 sig=29792 +pid=1071 status=OK elapsed_ms=450959 cpu_user_ms=37748.644 cpu_sys_ms=48.150 rss_kb=660 challenge=32 sig=29792 +pid=1069 status=OK elapsed_ms=450993 cpu_user_ms=37747.716 cpu_sys_ms=48.251 rss_kb=660 challenge=32 sig=29792 +pid=1070 status=OK elapsed_ms=451044 cpu_user_ms=37763.883 cpu_sys_ms=37.217 rss_kb=660 challenge=32 sig=29792 +pid=1067 status=OK elapsed_ms=451052 cpu_user_ms=37773.239 cpu_sys_ms=33.407 rss_kb=660 challenge=32 sig=29792 +pid=1062 status=OK elapsed_ms=451058 cpu_user_ms=37754.597 cpu_sys_ms=48.256 rss_kb=660 challenge=32 sig=29792 +pid=1066 status=OK elapsed_ms=451053 cpu_user_ms=37750.028 cpu_sys_ms=59.589 rss_kb=660 challenge=32 sig=29792 +pid=1063 status=OK elapsed_ms=451079 cpu_user_ms=37782.601 cpu_sys_ms=26.074 rss_kb=660 challenge=32 sig=29792 +pid=1064 status=OK elapsed_ms=451068 cpu_user_ms=37770.203 cpu_sys_ms=37.106 rss_kb=660 challenge=32 sig=29792 +pid=1068 status=OK elapsed_ms=451096 cpu_user_ms=37782.633 cpu_sys_ms=29.723 rss_kb=660 challenge=32 sig=29792 +pid=1065 status=OK elapsed_ms=451110 cpu_user_ms=37783.242 cpu_sys_ms=33.403 rss_kb=660 challenge=32 sig=29792 +pid=1689 status=OK elapsed_ms=449538 cpu_user_ms=37706.255 cpu_sys_ms=14.807 rss_kb=660 challenge=32 sig=29792 +pid=1692 status=OK elapsed_ms=449542 cpu_user_ms=37690.312 cpu_sys_ms=33.552 rss_kb=660 challenge=32 sig=29792 +pid=1688 status=OK elapsed_ms=449557 cpu_user_ms=37693.980 cpu_sys_ms=26.155 rss_kb=660 challenge=32 sig=29792 +pid=1687 status=OK elapsed_ms=449564 cpu_user_ms=37689.818 cpu_sys_ms=33.565 rss_kb=660 challenge=32 sig=29792 +pid=1691 status=OK elapsed_ms=449598 cpu_user_ms=37699.059 cpu_sys_ms=29.849 rss_kb=660 challenge=32 sig=29792 +pid=1693 status=OK elapsed_ms=449602 cpu_user_ms=37702.459 cpu_sys_ms=29.816 rss_kb=660 challenge=32 sig=29792 +pid=1685 status=OK elapsed_ms=449603 cpu_user_ms=37679.530 cpu_sys_ms=44.564 rss_kb=660 challenge=32 sig=29792 +pid=1684 status=OK elapsed_ms=449614 cpu_user_ms=37692.971 cpu_sys_ms=33.520 rss_kb=660 challenge=32 sig=29792 +pid=1690 status=OK elapsed_ms=449657 cpu_user_ms=37708.260 cpu_sys_ms=29.455 rss_kb=660 challenge=32 sig=29792 +pid=1686 status=OK elapsed_ms=449683 cpu_user_ms=37729.937 cpu_sys_ms=11.148 rss_kb=660 challenge=32 sig=29792 +pid=2303 status=OK elapsed_ms=451168 cpu_user_ms=37817.220 cpu_sys_ms=41.236 rss_kb=660 challenge=32 sig=29792 +pid=2301 status=OK elapsed_ms=451200 cpu_user_ms=37837.508 cpu_sys_ms=22.378 rss_kb=660 challenge=32 sig=29792 +pid=2307 status=OK elapsed_ms=451216 cpu_user_ms=37828.668 cpu_sys_ms=33.432 rss_kb=660 challenge=32 sig=29792 +pid=2304 status=OK elapsed_ms=451253 cpu_user_ms=37838.167 cpu_sys_ms=29.915 rss_kb=660 challenge=32 sig=29792 +pid=2308 status=OK elapsed_ms=451269 cpu_user_ms=37836.747 cpu_sys_ms=33.491 rss_kb=660 challenge=32 sig=29792 +pid=2302 status=OK elapsed_ms=451240 cpu_user_ms=37840.013 cpu_sys_ms=26.018 rss_kb=660 challenge=32 sig=29792 +pid=2305 status=OK elapsed_ms=451300 cpu_user_ms=37836.637 cpu_sys_ms=37.037 rss_kb=660 challenge=32 sig=29792 +pid=2299 status=OK elapsed_ms=451308 cpu_user_ms=37850.167 cpu_sys_ms=22.324 rss_kb=660 challenge=32 sig=29792 +pid=2300 status=OK elapsed_ms=451316 cpu_user_ms=37802.719 cpu_sys_ms=70.701 rss_kb=660 challenge=32 sig=29792 +pid=2306 status=OK elapsed_ms=451306 cpu_user_ms=37858.075 cpu_sys_ms=18.586 rss_kb=660 challenge=32 sig=29792 +pid=2922 status=OK elapsed_ms=450609 cpu_user_ms=37820.208 cpu_sys_ms=18.667 rss_kb=660 challenge=32 sig=29792 +pid=2926 status=OK elapsed_ms=450662 cpu_user_ms=37802.362 cpu_sys_ms=41.281 rss_kb=660 challenge=32 sig=29792 +pid=2920 status=OK elapsed_ms=450680 cpu_user_ms=37822.783 cpu_sys_ms=25.981 rss_kb=660 challenge=32 sig=29792 +pid=2919 status=OK elapsed_ms=450701 cpu_user_ms=37810.796 cpu_sys_ms=37.200 rss_kb=660 challenge=32 sig=29792 +pid=2925 status=OK elapsed_ms=450739 cpu_user_ms=37828.647 cpu_sys_ms=26.162 rss_kb=660 challenge=32 sig=29792 +pid=2923 status=OK elapsed_ms=450767 cpu_user_ms=37828.007 cpu_sys_ms=29.909 rss_kb=660 challenge=32 sig=29792 +pid=2928 status=OK elapsed_ms=450769 cpu_user_ms=37821.402 cpu_sys_ms=33.486 rss_kb=660 challenge=32 sig=29792 +pid=2921 status=OK elapsed_ms=450778 cpu_user_ms=37819.023 cpu_sys_ms=37.106 rss_kb=660 challenge=32 sig=29792 +pid=2924 status=OK elapsed_ms=450788 cpu_user_ms=37813.084 cpu_sys_ms=44.639 rss_kb=660 challenge=32 sig=29792 +pid=2927 status=OK elapsed_ms=450787 cpu_user_ms=37830.099 cpu_sys_ms=29.801 rss_kb=660 challenge=32 sig=29792 +pid=3542 status=OK elapsed_ms=449467 cpu_user_ms=37732.422 cpu_sys_ms=29.848 rss_kb=660 challenge=32 sig=29792 +pid=3535 status=OK elapsed_ms=449483 cpu_user_ms=37712.316 cpu_sys_ms=48.715 rss_kb=660 challenge=32 sig=29792 +pid=3536 status=OK elapsed_ms=449499 cpu_user_ms=37747.181 cpu_sys_ms=18.607 rss_kb=660 challenge=32 sig=29792 +pid=3534 status=OK elapsed_ms=449549 cpu_user_ms=37725.644 cpu_sys_ms=44.661 rss_kb=660 challenge=32 sig=29792 +pid=3541 status=OK elapsed_ms=449564 cpu_user_ms=37736.240 cpu_sys_ms=33.463 rss_kb=660 challenge=32 sig=29792 +pid=3538 status=OK elapsed_ms=449569 cpu_user_ms=37732.015 cpu_sys_ms=37.216 rss_kb=660 challenge=32 sig=29792 +pid=3539 status=OK elapsed_ms=449574 cpu_user_ms=37749.148 cpu_sys_ms=22.464 rss_kb=660 challenge=32 sig=29792 +pid=3543 status=OK elapsed_ms=449612 cpu_user_ms=37752.278 cpu_sys_ms=22.405 rss_kb=660 challenge=32 sig=29792 +pid=3537 status=OK elapsed_ms=449640 cpu_user_ms=37720.202 cpu_sys_ms=59.875 rss_kb=660 challenge=32 sig=29792 +pid=3540 status=OK elapsed_ms=449645 cpu_user_ms=37753.266 cpu_sys_ms=26.072 rss_kb=660 challenge=32 sig=29792 +pid=357 status=OK elapsed_ms=450690 cpu_user_ms=37765.231 cpu_sys_ms=22.417 rss_kb=660 challenge=32 sig=29792 +pid=362 status=OK elapsed_ms=450752 cpu_user_ms=37760.173 cpu_sys_ms=33.662 rss_kb=660 challenge=32 sig=29792 +pid=356 status=OK elapsed_ms=450768 cpu_user_ms=37773.700 cpu_sys_ms=22.306 rss_kb=660 challenge=32 sig=29792 +pid=355 status=OK elapsed_ms=450755 cpu_user_ms=37768.644 cpu_sys_ms=26.055 rss_kb=660 challenge=32 sig=29792 +pid=360 status=OK elapsed_ms=450780 cpu_user_ms=37755.354 cpu_sys_ms=41.027 rss_kb=660 challenge=32 sig=29792 +pid=363 status=OK elapsed_ms=450796 cpu_user_ms=37764.957 cpu_sys_ms=37.117 rss_kb=660 challenge=32 sig=29792 +pid=358 status=OK elapsed_ms=450820 cpu_user_ms=37757.934 cpu_sys_ms=44.767 rss_kb=660 challenge=32 sig=29792 +pid=359 status=OK elapsed_ms=450835 cpu_user_ms=37768.674 cpu_sys_ms=40.854 rss_kb=660 challenge=32 sig=29792 +pid=354 status=OK elapsed_ms=450843 cpu_user_ms=37765.186 cpu_sys_ms=44.643 rss_kb=660 challenge=32 sig=29792 +pid=361 status=OK elapsed_ms=450847 cpu_user_ms=37772.431 cpu_sys_ms=37.225 rss_kb=660 challenge=32 sig=29792 +pid=978 status=OK elapsed_ms=449752 cpu_user_ms=37721.644 cpu_sys_ms=26.270 rss_kb=660 challenge=32 sig=29792 +pid=983 status=OK elapsed_ms=449756 cpu_user_ms=37729.745 cpu_sys_ms=18.705 rss_kb=660 challenge=32 sig=29792 +pid=974 status=OK elapsed_ms=449787 cpu_user_ms=37721.288 cpu_sys_ms=29.903 rss_kb=660 challenge=32 sig=29792 +pid=979 status=OK elapsed_ms=449852 cpu_user_ms=37732.047 cpu_sys_ms=26.119 rss_kb=660 challenge=32 sig=29792 +pid=981 status=OK elapsed_ms=449864 cpu_user_ms=37710.224 cpu_sys_ms=51.901 rss_kb=660 challenge=32 sig=29792 +pid=980 status=OK elapsed_ms=449873 cpu_user_ms=37730.933 cpu_sys_ms=33.492 rss_kb=660 challenge=32 sig=29792 +pid=976 status=OK elapsed_ms=449887 cpu_user_ms=37723.806 cpu_sys_ms=37.269 rss_kb=660 challenge=32 sig=29792 +pid=975 status=OK elapsed_ms=449899 cpu_user_ms=37731.299 cpu_sys_ms=29.785 rss_kb=660 challenge=32 sig=29792 +pid=982 status=OK elapsed_ms=449904 cpu_user_ms=37741.310 cpu_sys_ms=22.266 rss_kb=660 challenge=32 sig=29792 +pid=977 status=OK elapsed_ms=449927 cpu_user_ms=37734.125 cpu_sys_ms=33.298 rss_kb=660 challenge=32 sig=29792 +pid=1598 status=OK elapsed_ms=449701 cpu_user_ms=37706.646 cpu_sys_ms=29.869 rss_kb=660 challenge=32 sig=29792 +pid=1604 status=OK elapsed_ms=449785 cpu_user_ms=37703.750 cpu_sys_ms=41.061 rss_kb=660 challenge=32 sig=29792 +pid=1596 status=OK elapsed_ms=449779 cpu_user_ms=37690.541 cpu_sys_ms=51.999 rss_kb=660 challenge=32 sig=29792 +pid=1603 status=OK elapsed_ms=449785 cpu_user_ms=37703.131 cpu_sys_ms=40.997 rss_kb=660 challenge=32 sig=29792 +pid=1595 status=OK elapsed_ms=449796 cpu_user_ms=37715.475 cpu_sys_ms=29.732 rss_kb=660 challenge=32 sig=29792 +pid=1602 status=OK elapsed_ms=449824 cpu_user_ms=37699.588 cpu_sys_ms=52.219 rss_kb=660 challenge=32 sig=29792 +pid=1601 status=OK elapsed_ms=449839 cpu_user_ms=37726.714 cpu_sys_ms=22.365 rss_kb=660 challenge=32 sig=29792 +pid=1597 status=OK elapsed_ms=449842 cpu_user_ms=37712.902 cpu_sys_ms=37.232 rss_kb=660 challenge=32 sig=29792 +pid=1599 status=OK elapsed_ms=449852 cpu_user_ms=37704.136 cpu_sys_ms=48.329 rss_kb=660 challenge=32 sig=29792 +pid=1600 status=OK elapsed_ms=449869 cpu_user_ms=37725.628 cpu_sys_ms=33.487 rss_kb=660 challenge=32 sig=29792 +pid=2212 status=OK elapsed_ms=451890 cpu_user_ms=37837.407 cpu_sys_ms=29.760 rss_kb=660 challenge=32 sig=29792 +pid=2218 status=OK elapsed_ms=451893 cpu_user_ms=37819.954 cpu_sys_ms=48.422 rss_kb=660 challenge=32 sig=29792 +pid=2217 status=OK elapsed_ms=451903 cpu_user_ms=37814.904 cpu_sys_ms=52.261 rss_kb=660 challenge=32 sig=29792 +pid=2219 status=OK elapsed_ms=451899 cpu_user_ms=37858.749 cpu_sys_ms=7.475 rss_kb=660 challenge=32 sig=29792 +pid=2213 status=OK elapsed_ms=451935 cpu_user_ms=37829.287 cpu_sys_ms=41.069 rss_kb=660 challenge=32 sig=29792 +pid=2215 status=OK elapsed_ms=451998 cpu_user_ms=37819.907 cpu_sys_ms=55.815 rss_kb=660 challenge=32 sig=29792 +pid=2211 status=OK elapsed_ms=452015 cpu_user_ms=37846.103 cpu_sys_ms=29.740 rss_kb=660 challenge=32 sig=29792 +pid=2216 status=OK elapsed_ms=452020 cpu_user_ms=37839.127 cpu_sys_ms=37.341 rss_kb=660 challenge=32 sig=29792 +pid=2210 status=OK elapsed_ms=452024 cpu_user_ms=37846.164 cpu_sys_ms=29.890 rss_kb=660 challenge=32 sig=29792 +pid=2214 status=OK elapsed_ms=452028 cpu_user_ms=37829.759 cpu_sys_ms=48.294 rss_kb=660 challenge=32 sig=29792 \ No newline at end of file diff --git a/ref/test/speed_print.c b/ref/test/speed_print.c new file mode 100644 index 00000000..c0058f19 --- /dev/null +++ b/ref/test/speed_print.c @@ -0,0 +1,51 @@ +#include +#include +#include +#include +#include "cpucycles.h" +#include "speed_print.h" + +static int cmp_uint64(const void *a, const void *b) { + if(*(uint64_t *)a < *(uint64_t *)b) return -1; + if(*(uint64_t *)a > *(uint64_t *)b) return 1; + return 0; +} + +static uint64_t median(uint64_t *l, size_t llen) { + qsort(l,llen,sizeof(uint64_t),cmp_uint64); + + if(llen%2) return l[llen/2]; + else return (l[llen/2-1]+l[llen/2])/2; +} + +static uint64_t average(uint64_t *t, size_t tlen) { + size_t i; + uint64_t acc=0; + + for(i=0;i +#include + +void print_results(const char *s, uint64_t *t, size_t tlen); + +#endif \ No newline at end of file diff --git a/ref/test/test_speed.c b/ref/test/test_speed.c new file mode 100644 index 00000000..5a23e0b6 --- /dev/null +++ b/ref/test/test_speed.c @@ -0,0 +1,93 @@ +#include +#include +#include +#ifdef _WIN32 +#include +#else +#include +#endif +#include "../api.h" + +#define NTESTS 100 + +static uint64_t get_time_ns(void) { +#ifdef _WIN32 + static LARGE_INTEGER freq = {0}; + LARGE_INTEGER counter; + + if (freq.QuadPart == 0) { + QueryPerformanceFrequency(&freq); + } + QueryPerformanceCounter(&counter); + return (uint64_t)(counter.QuadPart * 1000000000ULL / freq.QuadPart); +#else + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); + return (uint64_t)ts.tv_sec * 1000000000ULL + (uint64_t)ts.tv_nsec; +#endif +} + +static void print_results(const char *label, uint64_t *t, int ntests) { + uint64_t min = UINT64_MAX; + uint64_t max = 0; + uint64_t sum = 0; + + for (int i = 0; i < ntests; i++) { + if (t[i] < min) min = t[i]; + if (t[i] > max) max = t[i]; + sum += t[i]; + } + + double avg = (double)sum / ntests; + printf("%s\n", label); + printf(" Min: %llu ns\n", (unsigned long long)min); + printf(" Max: %llu ns\n", (unsigned long long)max); + printf(" Avg: %.2f ns\n", avg); + printf(" Cycles per second: %.2f\n", 1000000000.0 / avg); + printf("\n"); +} + +int main(void) { + uint64_t t[NTESTS]; + uint8_t pk[CRYPTO_PUBLICKEYBYTES]; + uint8_t sk[CRYPTO_SECRETKEYBYTES]; + uint8_t sig[CRYPTO_BYTES]; + uint8_t m[32] = {0}; // small message for speed test + unsigned long long siglen; + + printf("SPHINCS+ Speed Test\n"); + printf("Public Key bytes = %d\n", CRYPTO_PUBLICKEYBYTES); + printf("Secret Key bytes = %d\n", CRYPTO_SECRETKEYBYTES); + printf("Signature bytes = %d\n", CRYPTO_BYTES); + printf("Running %d tests...\n\n", NTESTS); + + // Key generation + for (int i = 0; i < NTESTS; i++) { + uint64_t start = get_time_ns(); + crypto_sign_keypair(pk, sk); + uint64_t end = get_time_ns(); + t[i] = end - start; + } + print_results("Key Generation:", t, NTESTS); + + // Signing + for (int i = 0; i < NTESTS; i++) { + uint64_t start = get_time_ns(); + crypto_sign_signature(sig, &siglen, m, sizeof(m), sk); + uint64_t end = get_time_ns(); + t[i] = end - start; + } + print_results("Signing:", t, NTESTS); + + // Verification + for (int i = 0; i < NTESTS; i++) { + uint64_t start = get_time_ns(); + int valid = crypto_sign_verify(sig, siglen, m, sizeof(m), pk); + uint64_t end = get_time_ns(); + t[i] = end - start; + (void)valid; // ignore result for speed test + } + print_results("Verification:", t, NTESTS); + + return 0; +} \ No newline at end of file diff --git a/ref/test/test_sphincsplus.c b/ref/test/test_sphincsplus.c new file mode 100644 index 00000000..12429693 --- /dev/null +++ b/ref/test/test_sphincsplus.c @@ -0,0 +1,93 @@ +#include +#include +#include +#include "../api.h" +#include "../randombytes.h" + +#define MLEN 1200 // limit input for testing +#define NTESTS 1 // test count + +void run_test(const unsigned char *m, unsigned long long mlen, int test_idx) +{ + // KeyGen + unsigned char pk[CRYPTO_PUBLICKEYBYTES]; + unsigned char sk[CRYPTO_SECRETKEYBYTES]; + crypto_sign_keypair(pk, sk); + + /* fprintf(fout, "Test #%d\n", test_idx+1); + fprintf(fout, "KeyGen Stage:\n- Input: None\n- Output:\n"); + + fprintf(fout, "* Public Key: "); + for (int i = 0; i < CRYPTO_PUBLICKEYBYTES; i++) fprintf(fout, "%02x", pk[i]); + fprintf(fout, "\n* Secret Key: "); + for (int i = 0; i < CRYPTO_SECRETKEYBYTES; i++) fprintf(fout, "%02x", sk[i]); + fprintf(fout, "\n\n"); */ + + // Signing + unsigned char sm[MLEN + CRYPTO_BYTES]; + unsigned long long smlen = 0; + crypto_sign(sm, &smlen, m, mlen, sk); + + /* fprintf(fout, "Signing Stage:\n- Input: input.txt, sk\n- Output:\n"); + + fprintf(fout, "* Signed Message: "); + for (unsigned long long i = 0; i < smlen; i++) fprintf(fout, "%02x", sm[i]); + fprintf(fout, "\n\n"); */ + + // Open/Verify + unsigned char m2[MLEN + CRYPTO_BYTES] = {0}; + unsigned long long m2len = 0; + int valid = crypto_sign_open(m2, &m2len, sm, smlen, pk); + /* fprintf(fout, "Verifying Stage:\n- Input: signed message, pk\n- Output: %s\n", valid == 0 ? "Valid" : "Invalid"); + if (!valid) { + fprintf(fout, "* Opened Message: "); + for (unsigned long long i = 0; i < m2len; i++) fprintf(fout, "%02x", m2[i]); + fprintf(fout, "\n"); + } + fprintf(fout, "\n"); */ + (void)valid; + (void)test_idx; +} + +int main(void) +{ + FILE *fin = fopen("test/input.txt", "rb"); + //FILE *fout = fopen("output.txt", "w"); + if (!fin /*|| !fout*/) { + printf("File error\n"); + return 1; + } + + // Read message from input.txt only once + unsigned char m[MLEN + CRYPTO_BYTES] = {0}; + unsigned long long mlen = fread(m, 1, MLEN, fin); + fclose(fin); + + for (int test = 0; test < NTESTS; ++test) { + run_test(m, mlen, test); + } + //fclose(fout); + + // Print testing information + printf("\n[Testing Information - %d runs]\n\n", NTESTS); + timing_info_t t = print_timing_info(); + printf("Average KeyGen time: %.6fs (%.2f ms)\n", t.keygen / NTESTS, (t.keygen / NTESTS) * 1000); + printf("Average Signing time: %.6fs (%.2f ms)\n", t.sign / NTESTS, (t.sign / NTESTS) * 1000); + printf("Average Verification time: %.6fs (%.2f ms)\n", t.verify / NTESTS, (t.verify / NTESTS) * 1000); + //printf("Average sum time (3 stages): %.6fs (%.2f ms)\n", t.temp / NTESTS, (t.temp / NTESTS) * 1000); + printf("Average all time (NIST compliance): %.6fs (%.2f ms)\n", t.all / NTESTS, (t.all / NTESTS) * 1000); + printf("Public key bytes = %d\n", CRYPTO_PUBLICKEYBYTES); + printf("Secret key bytes = %d\n", CRYPTO_SECRETKEYBYTES); + printf("Signature bytes = %d\n", CRYPTO_BYTES); + printf("Message bytes = %llu\n", mlen); + + const char* thash_str; +#ifdef SPX_ROBUST + thash_str = "robust"; +#else + thash_str = "simple"; +#endif + printf("Parameters = %s-%s\n", xstr(PARAMS), thash_str); + + return 0; +} \ No newline at end of file diff --git a/ref/test/test_sphincsplus_client.c b/ref/test/test_sphincsplus_client.c new file mode 100644 index 00000000..2e41551a --- /dev/null +++ b/ref/test/test_sphincsplus_client.c @@ -0,0 +1,233 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "../api.h" + +#define SERVER_PORT 5000 +#define BUFFER_SIZE 8192 +#define DEFAULT_TARGET_IP "192.168.4.85" +#define CLIENT_SK_PATH "client_sk.bin" +#define CLIENT_LOG_PATH "client.log" + +static uint64_t get_time_ms(void) { + struct timespec ts; + if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0) { + return 0; + } + return (uint64_t)ts.tv_sec * 1000 + ts.tv_nsec / 1000000; +} + +static int load_file_exact(const char *path, uint8_t *buf, size_t len) { + FILE *f = fopen(path, "rb"); + if (!f) { + return -1; + } + + size_t n = fread(buf, 1, len, f); + fclose(f); + + if (n != len) { + return -1; + } + + return 0; +} + +static int send_all(int sock, const uint8_t *buf, size_t len) { + size_t total = 0; + while (total < len) { + ssize_t sent = send(sock, (const char *)buf + total, (int)(len - total), 0); + if (sent < 0) { + if (errno == EINTR) { + continue; + } + return -1; + } + if (sent == 0) { + errno = ECONNRESET; + return -1; + } + total += (size_t)sent; + } + return 0; +} + +static int recv_all(int sock, uint8_t *buf, size_t len) { + size_t total = 0; + while (total < len) { + ssize_t recvd = recv(sock, (char *)buf + total, (int)(len - total), 0); + if (recvd == 0) { + errno = ECONNRESET; + return -1; + } + if (recvd < 0) { + if (errno == EINTR) { + continue; + } + return -1; + } + total += (size_t)recvd; + } + return 0; +} + +static int send_blob(int sock, const uint8_t *data, uint32_t data_len) { + uint32_t len_net = htonl(data_len); + if (send_all(sock, (const uint8_t *)&len_net, sizeof(len_net)) < 0) { + return -1; + } + if (data_len == 0) { + return 0; + } + return send_all(sock, data, data_len); +} + +static int recv_blob(int sock, uint8_t *buffer, uint32_t buffer_size, uint32_t *out_len) { + uint32_t len_net = 0; + if (recv_all(sock, (uint8_t *)&len_net, sizeof(len_net)) < 0) { + return -1; + } + + uint32_t payload_len = ntohl(len_net); + if (payload_len > buffer_size) { + errno = EMSGSIZE; + return -1; + } + + if (payload_len > 0 && recv_all(sock, buffer, payload_len) < 0) { + return -1; + } + + *out_len = payload_len; + return 0; +} + +static void log_result(const char *log_path, + int status, + uint32_t challenge_len, + size_t sig_len, + uint64_t elapsed_ms) { + struct rusage ru; + double user_ms = 0.0; + double sys_ms = 0.0; + long rss_kb = 0; + + if (getrusage(RUSAGE_SELF, &ru) == 0) { + user_ms = (double)ru.ru_utime.tv_sec * 1000.0 + (double)ru.ru_utime.tv_usec / 1000.0; + sys_ms = (double)ru.ru_stime.tv_sec * 1000.0 + (double)ru.ru_stime.tv_usec / 1000.0; + rss_kb = ru.ru_maxrss; + } + + FILE *f = fopen(log_path, "a"); + if (!f) { + return; + } + + fprintf(f, + "pid=%ld status=%s elapsed_ms=%llu cpu_user_ms=%.3f cpu_sys_ms=%.3f rss_kb=%ld challenge=%u sig=%zu\n", + (long)getpid(), + status == 0 ? "OK" : "FAIL", + (unsigned long long)elapsed_ms, + user_ms, + sys_ms, + rss_kb, + challenge_len, + sig_len); + fclose(f); +} + +int main(int argc, char *argv[]) { + int sock = -1; + struct sockaddr_in server_addr; + uint8_t sk[CRYPTO_SECRETKEYBYTES]; + uint8_t challenge[BUFFER_SIZE]; + uint32_t challenge_len = 0; + uint8_t signature[CRYPTO_BYTES]; + size_t sig_len = 0; + + const char *ip = (argc > 1) ? argv[1] : DEFAULT_TARGET_IP; + + const char *log_path = getenv("CLIENT_LOG_PATH"); + if (!log_path || *log_path == '\0') { + log_path = CLIENT_LOG_PATH; + } + + if (load_file_exact(CLIENT_SK_PATH, sk, sizeof(sk)) < 0) { + fprintf(stderr, "Missing %s. Run test_sphincsplus_keygen first.\n", CLIENT_SK_PATH); + return 1; + } + + sock = socket(AF_INET, SOCK_STREAM, 0); + if (sock < 0) { + perror("socket failed"); + return 1; + } + + memset(&server_addr, 0, sizeof(server_addr)); + server_addr.sin_family = AF_INET; + server_addr.sin_port = htons(SERVER_PORT); + if (inet_pton(AF_INET, ip, &server_addr.sin_addr) != 1) { + fprintf(stderr, "Invalid server IP: %s\n", ip); + close(sock); + return 1; + } + + if (connect(sock, (struct sockaddr *)&server_addr, sizeof(server_addr)) < 0) { + perror("connect failed"); + close(sock); + return 1; + } + printf("[+] Connected to %s\n", ip); + + uint64_t start_ms = get_time_ms(); + + printf("[*] Waiting for challenge from server...\n"); + if (recv_blob(sock, challenge, BUFFER_SIZE, &challenge_len) < 0) { + perror("recv() challenge failed"); + close(sock); + log_result(log_path, 1, challenge_len, 0, get_time_ms() - start_ms); + return 1; + } + printf("[+] Received challenge: %u bytes\n", challenge_len); + + printf("[*] Signing challenge...\n"); + if (crypto_sign_signature(signature, &sig_len, challenge, (size_t)challenge_len, sk) != 0) { + fprintf(stderr, "Signature failed\n"); + close(sock); + log_result(log_path, 1, challenge_len, 0, get_time_ms() - start_ms); + return 1; + } + + if (sig_len > UINT32_MAX) { + fprintf(stderr, "Signature too large: %zu bytes\n", sig_len); + close(sock); + log_result(log_path, 1, challenge_len, sig_len, get_time_ms() - start_ms); + return 1; + } + + printf("[*] Sending signature...\n"); + if (send_blob(sock, signature, (uint32_t)sig_len) < 0) { + perror("send() signature failed"); + close(sock); + log_result(log_path, 1, challenge_len, sig_len, get_time_ms() - start_ms); + return 1; + } + + printf("[DONE] SPHINCS+ process finished successfully.\n"); + close(sock); + log_result(log_path, 0, challenge_len, sig_len, get_time_ms() - start_ms); + return 0; +} \ No newline at end of file diff --git a/ref/test/test_sphincsplus_keygen.c b/ref/test/test_sphincsplus_keygen.c new file mode 100644 index 00000000..90ed2c16 --- /dev/null +++ b/ref/test/test_sphincsplus_keygen.c @@ -0,0 +1,54 @@ +#include +#include +#include +#include +#include + +#include "../api.h" + +#define CLIENT_SK_PATH "client_sk.bin" +#define CLIENT_PK_PATH "client_pk.bin" +#define SERVER_PK_PATH "server_pk.bin" + +static int write_file(const char *path, const uint8_t *buf, size_t len) { + FILE *f = fopen(path, "wb"); + if (!f) { + return -1; + } + if (fwrite(buf, 1, len, f) != len) { + fclose(f); + return -1; + } + fclose(f); + return 0; +} + +int main(void) { + uint8_t pk[CRYPTO_PUBLICKEYBYTES]; + uint8_t sk[CRYPTO_SECRETKEYBYTES]; + + printf("[*] Generating SPHINCS+ keypair...\n"); + if (crypto_sign_keypair(pk, sk) != 0) { + fprintf(stderr, "Key generation failed\n"); + return 1; + } + + if (write_file(CLIENT_SK_PATH, sk, sizeof(sk)) < 0) { + fprintf(stderr, "Failed to write %s\n", CLIENT_SK_PATH); + return 1; + } + + if (write_file(CLIENT_PK_PATH, pk, sizeof(pk)) < 0) { + fprintf(stderr, "Failed to write %s\n", CLIENT_PK_PATH); + return 1; + } + + if (write_file(SERVER_PK_PATH, pk, sizeof(pk)) < 0) { + fprintf(stderr, "Failed to write %s\n", SERVER_PK_PATH); + return 1; + } + + printf("[OK] Wrote %s, %s, %s\n", CLIENT_SK_PATH, CLIENT_PK_PATH, SERVER_PK_PATH); + printf("Copy %s to the server machine before running the server.\n", SERVER_PK_PATH); + return 0; +} \ No newline at end of file diff --git a/ref/test/test_sphincsplus_server.c b/ref/test/test_sphincsplus_server.c new file mode 100644 index 00000000..cfa9cdb1 --- /dev/null +++ b/ref/test/test_sphincsplus_server.c @@ -0,0 +1,480 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +/* Platform-specific socket headers - must come before ../api.h to avoid macro conflicts */ +#ifdef _WIN32 + #define WIN32_LEAN_AND_MEAN + #include + #include + #include + #define close(sock) closesocket(sock) + #define ssize_t int + /* Undefine potential macro conflicts that Windows headers define */ + #undef N + #undef D + #undef L +#else + #include + #include + #include + #include + #include + #include + #include +#endif + +/* SPHINCS+ headers - included after socket headers to avoid macro conflicts */ +#include "../api.h" + +/* Configuration */ +#define SERVER_PORT 5000 +#define CHALLENGE_MAX 8192 +#define CHALLENGE_PATH_PRIMARY "test/input.txt" +#define CHALLENGE_PATH_FALLBACK "input.txt" +#define SERVER_PK_PATH "server_pk.bin" +#define SERVER_LOG_PATH "server.log" + +/* Forward declarations */ +static uint64_t get_time_ms(void); +static int send_all(int sock, const uint8_t *buf, size_t len); +static int recv_all(int sock, uint8_t *buf, size_t len); +static int send_blob(int sock, const uint8_t *data, uint32_t data_len); +static int recv_blob(int sock, uint8_t *buf, uint32_t buf_size, uint32_t *out_len); +static int send_challenge(int sock, const uint8_t *challenge, size_t challenge_len); +static int receive_signature(int sock, uint8_t *signature, size_t *sig_len); +static int load_file_exact(const char *path, uint8_t *buf, size_t len); +static int load_public_key(const char *path, uint8_t *pk); +static void load_challenge(uint8_t *challenge, size_t *challenge_len); +static void log_result(const char *log_path, + const char *client_ip, + uint16_t client_port, + int verify_result, + size_t challenge_len, + size_t sig_len, + uint64_t elapsed_ms); +static int handle_client(int client_sock, const struct sockaddr_in *client_addr); + +static uint8_t g_pk[CRYPTO_PUBLICKEYBYTES]; +static uint8_t g_challenge[CHALLENGE_MAX]; +static size_t g_challenge_len = 0; + +/* Get current time in milliseconds */ +static uint64_t get_time_ms(void) { +#ifdef _WIN32 + return (uint64_t)GetTickCount64(); +#else + struct timespec ts; + if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0) { + return 0; + } + return (uint64_t)ts.tv_sec * 1000 + ts.tv_nsec / 1000000; +#endif +} + +static int send_all(int sock, const uint8_t *buf, size_t len) { + size_t total = 0; + while (total < len) { + ssize_t sent = send(sock, (const char *)buf + total, (int)(len - total), 0); + if (sent < 0) { +#ifndef _WIN32 + if (errno == EINTR) { + continue; + } +#endif + return -1; + } + if (sent == 0) { + errno = ECONNRESET; + return -1; + } + total += (size_t)sent; + } + return 0; +} + +static int recv_all(int sock, uint8_t *buf, size_t len) { + size_t total = 0; + while (total < len) { + ssize_t recvd = recv(sock, (char *)buf + total, (int)(len - total), 0); + if (recvd == 0) { + errno = ECONNRESET; + return -1; + } + if (recvd < 0) { +#ifndef _WIN32 + if (errno == EINTR) { + continue; + } +#endif + return -1; + } + total += (size_t)recvd; + } + return 0; +} + +static int send_blob(int sock, const uint8_t *data, uint32_t data_len) { + uint32_t len_net = htonl(data_len); + if (send_all(sock, (const uint8_t *)&len_net, sizeof(len_net)) < 0) { + return -1; + } + if (data_len == 0) { + return 0; + } + return send_all(sock, data, data_len); +} + +static int recv_blob(int sock, uint8_t *buf, uint32_t buf_size, uint32_t *out_len) { + uint32_t len_net = 0; + if (recv_all(sock, (uint8_t *)&len_net, sizeof(len_net)) < 0) { + return -1; + } + + uint32_t len = ntohl(len_net); + if (len > buf_size) { + errno = EMSGSIZE; + return -1; + } + + if (len > 0 && recv_all(sock, buf, len) < 0) { + return -1; + } + + *out_len = len; + return 0; +} + +static int load_file_exact(const char *path, uint8_t *buf, size_t len) { + FILE *f = fopen(path, "rb"); + if (!f) { + return -1; + } + + size_t n = fread(buf, 1, len, f); + fclose(f); + + if (n != len) { + return -1; + } + + return 0; +} + +static int load_public_key(const char *path, uint8_t *pk) { + if (load_file_exact(path, pk, CRYPTO_PUBLICKEYBYTES) < 0) { + fprintf(stderr, "Failed to load public key from %s\n", path); + return -1; + } + return 0; +} + +static void load_challenge(uint8_t *challenge, size_t *challenge_len) { + FILE *fin = fopen(CHALLENGE_PATH_PRIMARY, "rb"); + if (!fin) { + fin = fopen(CHALLENGE_PATH_FALLBACK, "rb"); + } + + if (!fin) { + const char *default_msg = "This is a test challenge message"; + size_t default_len = strlen(default_msg); + memcpy(challenge, default_msg, default_len); + *challenge_len = default_len; + printf("[WARNING] Cannot open input file, using default challenge\n"); + return; + } + + *challenge_len = fread(challenge, 1, CHALLENGE_MAX, fin); + fclose(fin); + + if (*challenge_len == 0) { + const char *default_msg = "This is a test challenge message"; + size_t default_len = strlen(default_msg); + memcpy(challenge, default_msg, default_len); + *challenge_len = default_len; + printf("[WARNING] Empty input file, using default challenge\n"); + } +} + +static void log_result(const char *log_path, + const char *client_ip, + uint16_t client_port, + int verify_result, + size_t challenge_len, + size_t sig_len, + uint64_t elapsed_ms) { + double user_ms = 0.0; + double sys_ms = 0.0; + long rss_kb = 0; + +#ifndef _WIN32 + struct rusage ru; + if (getrusage(RUSAGE_SELF, &ru) == 0) { + user_ms = (double)ru.ru_utime.tv_sec * 1000.0 + (double)ru.ru_utime.tv_usec / 1000.0; + sys_ms = (double)ru.ru_stime.tv_sec * 1000.0 + (double)ru.ru_stime.tv_usec / 1000.0; + rss_kb = ru.ru_maxrss; + } +#endif + + FILE *f = fopen(log_path, "a"); + if (!f) { + return; + } + + fprintf(f, + "client=%s:%u verify=%s elapsed_ms=%llu cpu_user_ms=%.3f cpu_sys_ms=%.3f rss_kb=%ld challenge=%zu sig=%zu\n", + client_ip ? client_ip : "unknown", + (unsigned int)client_port, + verify_result == 0 ? "OK" : "FAIL", + (unsigned long long)elapsed_ms, + user_ms, + sys_ms, + rss_kb, + challenge_len, + sig_len); + fclose(f); +} + +/* Send challenge message to client */ +static int send_challenge(int sock, const uint8_t *challenge, size_t challenge_len) { + printf("[*] Sending challenge to client (size: %zu bytes)...\n", challenge_len); + + if (challenge_len > UINT32_MAX) { + fprintf(stderr, "Challenge too large: %zu bytes\n", challenge_len); + return -1; + } + + if (send_blob(sock, challenge, (uint32_t)challenge_len) < 0) { + perror("send() challenge failed"); + return -1; + } + + printf("[+] Challenge sent successfully\n\n"); + return 0; +} + +/* Receive signature from client */ +static int receive_signature(int sock, uint8_t *signature, size_t *sig_len) { + printf("[*] Waiting for signature from client...\n"); + + uint32_t size = 0; + if (recv_blob(sock, signature, CRYPTO_BYTES, &size) < 0) { + perror("recv() signature failed"); + return -1; + } + + *sig_len = (size_t)size; + printf("[+] Signature received successfully (size: %zu bytes)\n\n", *sig_len); + return 0; +} + +static int handle_client(int client_sock, const struct sockaddr_in *client_addr) { + uint64_t total_start = get_time_ms(); + + uint8_t signature[CRYPTO_BYTES]; + size_t sig_len = 0; + + char client_ip[INET_ADDRSTRLEN] = "unknown"; + uint16_t client_port = 0; + if (client_addr) { + inet_ntop(AF_INET, &client_addr->sin_addr, client_ip, sizeof(client_ip)); + client_port = ntohs(client_addr->sin_port); + } + + /* ============ STAGE 1: Send Challenge ============ */ + printf("[STAGE 1] Sending challenge to client...\n"); + printf("- Challenge size: %zu bytes\n", g_challenge_len); + + uint64_t send_challenge_start = get_time_ms(); + if (send_challenge(client_sock, g_challenge, g_challenge_len) < 0) { + fprintf(stderr, "Failed to send challenge\n"); + return 1; + } + uint64_t send_challenge_end = get_time_ms(); + + printf("[+] Send challenge time: %llu ms\n\n", + (unsigned long long)(send_challenge_end - send_challenge_start)); + + /* ============ STAGE 2: Receive Signature ============ */ + printf("[STAGE 2] Receiving signature from client...\n"); + + uint64_t recv_sig_start = get_time_ms(); + if (receive_signature(client_sock, signature, &sig_len) < 0) { + fprintf(stderr, "Failed to receive signature\n"); + return 1; + } + uint64_t recv_sig_end = get_time_ms(); + + printf("- Signature size: %zu bytes\n", sig_len); + printf("[+] Receive signature time: %llu ms\n\n", + (unsigned long long)(recv_sig_end - recv_sig_start)); + + /* ============ STAGE 3: Verify Signature ============ */ + printf("[STAGE 3] Verifying signature...\n"); + + uint64_t verify_start = get_time_ms(); + int verify_result = crypto_sign_verify(signature, sig_len, g_challenge, g_challenge_len, + g_pk); + uint64_t verify_end = get_time_ms(); + + printf("- Verification result: %s\n", verify_result == 0 ? "VALID" : "INVALID"); + printf("[+] Verification time: %llu ms\n\n", + (unsigned long long)(verify_end - verify_start)); + + /* ============ TIMING SUMMARY ============ */ + uint64_t total_end = get_time_ms(); + + printf("===================================\n"); + printf("[TIMING SUMMARY]\n"); + printf("===================================\n"); + printf("Send Challenge Time: %llu ms\n", + (unsigned long long)(send_challenge_end - send_challenge_start)); + printf("Receive Signature Time: %llu ms\n", + (unsigned long long)(recv_sig_end - recv_sig_start)); + printf("Verification Time: %llu ms\n", + (unsigned long long)(verify_end - verify_start)); + printf("-----------------------------------\n"); + printf("Total Time (from start): %llu ms\n", + (unsigned long long)(total_end - total_start)); + printf("===================================\n\n"); + + printf("[KEY INFORMATION]\n"); + printf("- Signature Size: %zu bytes\n", sig_len); + printf("- Challenge Size: %zu bytes\n", g_challenge_len); + printf("===================================\n\n"); + + printf("[+] Signature verification %s.\n", verify_result == 0 ? "OK" : "FAILED"); + + log_result(SERVER_LOG_PATH, client_ip, client_port, verify_result, + g_challenge_len, sig_len, total_end - total_start); + + return verify_result == 0 ? 0 : 1; +} + +int main(void) { + int listen_sock = -1; + + printf("\n========== SPHINCS+ Server ==========\n"); + printf("Listening on port %d\n", SERVER_PORT); + printf("======================================\n\n"); + + /* Windows socket initialization */ +#ifdef _WIN32 + WSADATA wsa_data; + if (WSAStartup(MAKEWORD(2, 2), &wsa_data) != 0) { + fprintf(stderr, "WSAStartup failed\n"); + return 1; + } +#else + signal(SIGCHLD, SIG_IGN); + signal(SIGPIPE, SIG_IGN); +#endif + + if (load_public_key(SERVER_PK_PATH, g_pk) < 0) { +#ifdef _WIN32 + WSACleanup(); +#endif + return 1; + } + + load_challenge(g_challenge, &g_challenge_len); + + /* ============ STAGE 0: Create Socket & Listen ============ */ + listen_sock = socket(AF_INET, SOCK_STREAM, 0); + if (listen_sock < 0) { + perror("socket() failed"); +#ifdef _WIN32 + WSACleanup(); +#endif + return 1; + } + + /* Allow socket address reuse */ + int reuse = 1; + if (setsockopt(listen_sock, SOL_SOCKET, SO_REUSEADDR, (const char *)&reuse, sizeof(reuse)) < 0) { + perror("setsockopt() failed"); + close(listen_sock); +#ifdef _WIN32 + WSACleanup(); +#endif + return 1; + } + + struct sockaddr_in server_addr; + memset(&server_addr, 0, sizeof(server_addr)); + server_addr.sin_family = AF_INET; + server_addr.sin_addr.s_addr = INADDR_ANY; + server_addr.sin_port = htons(SERVER_PORT); + + if (bind(listen_sock, (struct sockaddr *)&server_addr, sizeof(server_addr)) < 0) { + perror("bind() failed"); + close(listen_sock); +#ifdef _WIN32 + WSACleanup(); +#endif + return 1; + } + + if (listen(listen_sock, 10) < 0) { + perror("listen() failed"); + close(listen_sock); +#ifdef _WIN32 + WSACleanup(); +#endif + return 1; + } + + printf("[+] Server listening on port %d\n\n", SERVER_PORT); + + /* ============ Main Loop ============ */ + while (1) { + struct sockaddr_in client_addr; + socklen_t client_addr_len = sizeof(client_addr); + + printf("[*] Waiting for client connections...\n"); + int client_sock = accept(listen_sock, (struct sockaddr *)&client_addr, &client_addr_len); + if (client_sock < 0) { + perror("accept() failed"); + continue; + } + + char client_ip[INET_ADDRSTRLEN]; + inet_ntop(AF_INET, &client_addr.sin_addr, client_ip, sizeof(client_ip)); + uint16_t client_port = ntohs(client_addr.sin_port); + printf("[+] Client connected from %s:%u\n\n", client_ip, client_port); + +#ifndef _WIN32 + pid_t pid = fork(); + if (pid == 0) { + close(listen_sock); + handle_client(client_sock, &client_addr); + close(client_sock); + _exit(0); + } + + if (pid < 0) { + perror("fork() failed"); + close(client_sock); + continue; + } + + close(client_sock); +#else + handle_client(client_sock, &client_addr); + close(client_sock); +#endif + + printf("[+] Client disconnected\n\n"); + } + + close(listen_sock); +#ifdef _WIN32 + WSACleanup(); +#endif + return 0; +} \ No newline at end of file diff --git a/ref/test/test_sphincsplus_stress.c b/ref/test/test_sphincsplus_stress.c new file mode 100644 index 00000000..d6620915 --- /dev/null +++ b/ref/test/test_sphincsplus_stress.c @@ -0,0 +1,313 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "../api.h" + +#define SERVER_PORT 5000 +#define BUFFER_SIZE 8192 +#define DEFAULT_TARGET_IP "192.168.4.85" +#define DEFAULT_CONCURRENT 10 +#define DEFAULT_BATCHES 0 +#define DEFAULT_BATCH_DELAY_SEC 0 +#define CLIENT_SK_PATH "client_sk.bin" +#define CLIENT_LOG_PATH "client.log" + +static uint64_t get_time_ms(void) { + struct timespec ts; + if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0) { + return 0; + } + return (uint64_t)ts.tv_sec * 1000 + ts.tv_nsec / 1000000; +} + +static unsigned int parse_uint_env(const char *name, unsigned int def_value) { + const char *val = getenv(name); + if (!val || *val == '\0') { + return def_value; + } + + char *end = NULL; + unsigned long parsed = strtoul(val, &end, 10); + if (!end || *end != '\0' || parsed > UINT_MAX) { + return def_value; + } + + return (unsigned int)parsed; +} + +static int load_file_exact(const char *path, uint8_t *buf, size_t len) { + FILE *f = fopen(path, "rb"); + if (!f) { + return -1; + } + + size_t n = fread(buf, 1, len, f); + fclose(f); + + if (n != len) { + return -1; + } + + return 0; +} + +static int send_all(int sock, const uint8_t *buf, size_t len) { + size_t total = 0; + while (total < len) { + ssize_t sent = send(sock, (const char *)buf + total, (int)(len - total), 0); + if (sent < 0) { + if (errno == EINTR) { + continue; + } + return -1; + } + if (sent == 0) { + errno = ECONNRESET; + return -1; + } + total += (size_t)sent; + } + return 0; +} + +static int recv_all(int sock, uint8_t *buf, size_t len) { + size_t total = 0; + while (total < len) { + ssize_t recvd = recv(sock, (char *)buf + total, (int)(len - total), 0); + if (recvd == 0) { + errno = ECONNRESET; + return -1; + } + if (recvd < 0) { + if (errno == EINTR) { + continue; + } + return -1; + } + total += (size_t)recvd; + } + return 0; +} + +static int send_blob(int sock, const uint8_t *data, uint32_t data_len) { + uint32_t len_net = htonl(data_len); + if (send_all(sock, (const uint8_t *)&len_net, sizeof(len_net)) < 0) { + return -1; + } + if (data_len == 0) { + return 0; + } + return send_all(sock, data, data_len); +} + +static int recv_blob(int sock, uint8_t *buffer, uint32_t buffer_size, uint32_t *out_len) { + uint32_t len_net = 0; + if (recv_all(sock, (uint8_t *)&len_net, sizeof(len_net)) < 0) { + return -1; + } + + uint32_t payload_len = ntohl(len_net); + if (payload_len > buffer_size) { + errno = EMSGSIZE; + return -1; + } + + if (payload_len > 0 && recv_all(sock, buffer, payload_len) < 0) { + return -1; + } + + *out_len = payload_len; + return 0; +} + +static void log_result(const char *log_path, + int status, + uint32_t challenge_len, + size_t sig_len, + uint64_t elapsed_ms) { + struct rusage ru; + double user_ms = 0.0; + double sys_ms = 0.0; + long rss_kb = 0; + + if (getrusage(RUSAGE_SELF, &ru) == 0) { + user_ms = (double)ru.ru_utime.tv_sec * 1000.0 + (double)ru.ru_utime.tv_usec / 1000.0; + sys_ms = (double)ru.ru_stime.tv_sec * 1000.0 + (double)ru.ru_stime.tv_usec / 1000.0; + rss_kb = ru.ru_maxrss; + } + + FILE *f = fopen(log_path, "a"); + if (!f) { + return; + } + + fprintf(f, + "pid=%ld status=%s elapsed_ms=%llu cpu_user_ms=%.3f cpu_sys_ms=%.3f rss_kb=%ld challenge=%u sig=%zu\n", + (long)getpid(), + status == 0 ? "OK" : "FAIL", + (unsigned long long)elapsed_ms, + user_ms, + sys_ms, + rss_kb, + challenge_len, + sig_len); + fclose(f); +} + +static int client_session(const char *ip, const uint8_t *sk) { + int sock = -1; + struct sockaddr_in server_addr; + uint8_t challenge[BUFFER_SIZE]; + uint32_t challenge_len = 0; + uint8_t signature[CRYPTO_BYTES]; + size_t sig_len = 0; + + sock = socket(AF_INET, SOCK_STREAM, 0); + if (sock < 0) { + perror("socket failed"); + return 1; + } + + memset(&server_addr, 0, sizeof(server_addr)); + server_addr.sin_family = AF_INET; + server_addr.sin_port = htons(SERVER_PORT); + if (inet_pton(AF_INET, ip, &server_addr.sin_addr) != 1) { + fprintf(stderr, "Invalid server IP: %s\n", ip); + close(sock); + return 1; + } + + if (connect(sock, (struct sockaddr *)&server_addr, sizeof(server_addr)) < 0) { + perror("connect failed"); + close(sock); + return 1; + } + + uint64_t start_ms = get_time_ms(); + + if (recv_blob(sock, challenge, BUFFER_SIZE, &challenge_len) < 0) { + perror("recv() challenge failed"); + close(sock); + return 1; + } + + if (crypto_sign_signature(signature, &sig_len, challenge, (size_t)challenge_len, sk) != 0) { + fprintf(stderr, "Signature failed\n"); + close(sock); + return 1; + } + + if (sig_len > UINT32_MAX) { + fprintf(stderr, "Signature too large: %zu bytes\n", sig_len); + close(sock); + return 1; + } + + if (send_blob(sock, signature, (uint32_t)sig_len) < 0) { + perror("send() signature failed"); + close(sock); + return 1; + } + + close(sock); + log_result(CLIENT_LOG_PATH, 0, challenge_len, sig_len, get_time_ms() - start_ms); + return 0; +} + +int main(int argc, char *argv[]) { + uint8_t sk[CRYPTO_SECRETKEYBYTES]; + + const char *target_ip = getenv("TARGET_IP"); + if (!target_ip || *target_ip == '\0') { + target_ip = DEFAULT_TARGET_IP; + } + + unsigned int concurrent_sessions = parse_uint_env("CONCURRENT_SESSIONS", DEFAULT_CONCURRENT); + unsigned int batches = parse_uint_env("BATCHES", DEFAULT_BATCHES); + unsigned int batch_delay_sec = parse_uint_env("BATCH_DELAY_SEC", DEFAULT_BATCH_DELAY_SEC); + + if (load_file_exact(CLIENT_SK_PATH, sk, sizeof(sk)) < 0) { + fprintf(stderr, "Missing %s. Run test_sphincsplus_keygen first.\n", CLIENT_SK_PATH); + return 1; + } + + printf("[STRESS TEST] SPHINCS+ Client\n"); + printf("- Target IP: %s\n", target_ip); + printf("- Concurrent sessions: %u\n", concurrent_sessions); + printf("- Batches: %u\n", batches); + printf("- Batch delay: %u sec\n", batch_delay_sec); + printf("\n"); + + unsigned int batch = 1; + while (batches == 0 || batch <= batches) { + printf("[BATCH %u/%s] Starting...\n", batch, batches == 0 ? "inf" : "fixed"); + + pid_t *pids = calloc(concurrent_sessions, sizeof(pid_t)); + if (!pids) { + perror("calloc failed"); + return 1; + } + + uint64_t batch_start = get_time_ms(); + + for (unsigned int i = 0; i < concurrent_sessions; i++) { + pids[i] = fork(); + if (pids[i] < 0) { + perror("fork failed"); + free(pids); + return 1; + } else if (pids[i] == 0) { + /* Child process */ + exit(client_session(target_ip, sk)); + } + } + + int failed_count = 0; + for (unsigned int i = 0; i < concurrent_sessions; i++) { + int status; + if (waitpid(pids[i], &status, 0) < 0) { + perror("waitpid failed"); + free(pids); + return 1; + } + if (WIFEXITED(status) && WEXITSTATUS(status) != 0) { + failed_count++; + } + } + + uint64_t batch_end = get_time_ms(); + printf("[BATCH %u] Completed in %llu ms, %u/%u succeeded\n", + batch, + (unsigned long long)(batch_end - batch_start), + concurrent_sessions - failed_count, concurrent_sessions); + + free(pids); + + if (batches != 0 && batch >= batches) { + break; + } + + if (batch_delay_sec > 0) { + printf("[DELAY] Waiting %u seconds before next batch...\n", batch_delay_sec); + sleep(batch_delay_sec); + } + + batch++; + } + + return 0; +} \ No newline at end of file diff --git a/ref/test/test_vectors.c b/ref/test/test_vectors.c new file mode 100644 index 00000000..b75b3f8d --- /dev/null +++ b/ref/test/test_vectors.c @@ -0,0 +1,67 @@ +#include +#include +#include +#include +#include "../api.h" + +#define MLEN 32 +#define NVECTORS 100 + +int main(void) { + unsigned int i, j; + uint8_t pk[CRYPTO_PUBLICKEYBYTES]; + uint8_t sk[CRYPTO_SECRETKEYBYTES]; + uint8_t sig[CRYPTO_BYTES]; + uint8_t m[MLEN]; + unsigned long long siglen; + + printf("SPHINCS+ Test Vectors\n"); + printf("Public Key bytes = %d\n", CRYPTO_PUBLICKEYBYTES); + printf("Secret Key bytes = %d\n", CRYPTO_SECRETKEYBYTES); + printf("Signature bytes = %d\n", CRYPTO_BYTES); + printf("\n"); + + for(i = 0; i < NVECTORS; ++i) { + printf("count = %u\n", i); + + // Generate random message + for(j = 0; j < MLEN; ++j) { + m[j] = (uint8_t)(rand() & 0xFF); + } + printf("m = "); + for(j = 0; j < MLEN; ++j) + printf("%02x", m[j]); + printf("\n"); + + // Key generation + crypto_sign_keypair(pk, sk); + printf("pk = "); + for(j = 0; j < CRYPTO_PUBLICKEYBYTES; ++j) + printf("%02x", pk[j]); + printf("\n"); + printf("sk = "); + for(j = 0; j < CRYPTO_SECRETKEYBYTES; ++j) + printf("%02x", sk[j]); + printf("\n"); + + // Signing + crypto_sign_signature(sig, &siglen, m, MLEN, sk); + printf("sig = "); + for(j = 0; j < siglen; ++j) + printf("%02x", sig[j]); + printf("\n"); + + // Verification + int valid = crypto_sign_verify(sig, siglen, m, MLEN, pk); + printf("valid = %d\n", valid == 0 ? 1 : 0); + + if (valid == 0) { + printf("PASS\n"); + } else { + printf("FAIL\n"); + } + printf("\n"); + } + + return 0; +} \ No newline at end of file