Rename SPX files to have `spx_` prefix.
We can't have two source files with the same name, it seems, so since
crypto/spx/ will be going away, move its files out of the way so that
SLH-DSA can use those names.
Change-Id: Iedee8453cb77291eeff5ec33aa9836ea5d00d9a2
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/70908
Auto-Submit: Adam Langley <agl@google.com>
Reviewed-by: David Benjamin <davidben@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
diff --git a/build.json b/build.json
index 9ea699e..e614d30 100644
--- a/build.json
+++ b/build.json
@@ -305,13 +305,13 @@
"crypto/rsa_extra/rsa_crypt.c",
"crypto/rsa_extra/rsa_print.c",
"crypto/siphash/siphash.c",
- "crypto/spx/address.c",
- "crypto/spx/fors.c",
- "crypto/spx/merkle.c",
+ "crypto/spx/spx_address.c",
+ "crypto/spx/spx_fors.c",
+ "crypto/spx/spx_merkle.c",
"crypto/spx/spx.c",
"crypto/spx/spx_util.c",
- "crypto/spx/thash.c",
- "crypto/spx/wots.c",
+ "crypto/spx/spx_thash.c",
+ "crypto/spx/spx_wots.c",
"crypto/stack/stack.c",
"crypto/thread.c",
"crypto/thread_none.c",
@@ -534,13 +534,13 @@
"crypto/rand_extra/getrandom_fillin.h",
"crypto/rand_extra/sysrand_internal.h",
"crypto/rsa_extra/internal.h",
- "crypto/spx/address.h",
- "crypto/spx/fors.h",
- "crypto/spx/merkle.h",
- "crypto/spx/params.h",
+ "crypto/spx/spx_address.h",
+ "crypto/spx/spx_fors.h",
+ "crypto/spx/spx_merkle.h",
+ "crypto/spx/spx_params.h",
+ "crypto/spx/spx_thash.h",
"crypto/spx/spx_util.h",
- "crypto/spx/thash.h",
- "crypto/spx/wots.h",
+ "crypto/spx/spx_wots.h",
"crypto/trust_token/internal.h",
"crypto/x509/ext_dat.h",
"crypto/x509/internal.h",
diff --git a/crypto/spx/spx.c b/crypto/spx/spx.c
index 372001a..7ca1c2f 100644
--- a/crypto/spx/spx.c
+++ b/crypto/spx/spx.c
@@ -20,12 +20,12 @@
#include <openssl/experimental/spx.h>
#include <openssl/rand.h>
-#include "./address.h"
-#include "./fors.h"
-#include "./merkle.h"
-#include "./params.h"
+#include "./spx_address.h"
+#include "./spx_fors.h"
+#include "./spx_merkle.h"
+#include "./spx_params.h"
#include "./spx_util.h"
-#include "./thash.h"
+#include "./spx_thash.h"
void SPX_generate_key(uint8_t out_public_key[SPX_PUBLIC_KEY_BYTES],
uint8_t out_secret_key[SPX_SECRET_KEY_BYTES]) {
diff --git a/crypto/spx/address.c b/crypto/spx/spx_address.c
similarity index 99%
rename from crypto/spx/address.c
rename to crypto/spx/spx_address.c
index 13ca2f0..fb22ae5 100644
--- a/crypto/spx/address.c
+++ b/crypto/spx/spx_address.c
@@ -17,7 +17,7 @@
#include <string.h>
#include "../internal.h"
-#include "./address.h"
+#include "./spx_address.h"
#include "./spx_util.h"
diff --git a/crypto/spx/address.h b/crypto/spx/spx_address.h
similarity index 100%
rename from crypto/spx/address.h
rename to crypto/spx/spx_address.h
diff --git a/crypto/spx/fors.c b/crypto/spx/spx_fors.c
similarity index 97%
rename from crypto/spx/fors.c
rename to crypto/spx/spx_fors.c
index 0e12bb6..8fa62db 100644
--- a/crypto/spx/fors.c
+++ b/crypto/spx/spx_fors.c
@@ -16,11 +16,11 @@
#include <string.h>
-#include "./address.h"
-#include "./fors.h"
-#include "./params.h"
+#include "./spx_address.h"
+#include "./spx_fors.h"
+#include "./spx_params.h"
#include "./spx_util.h"
-#include "./thash.h"
+#include "./spx_thash.h"
void spx_fors_sk_gen(uint8_t *fors_sk, uint32_t idx,
const uint8_t sk_seed[SPX_N], const uint8_t pk_seed[SPX_N],
diff --git a/crypto/spx/fors.h b/crypto/spx/spx_fors.h
similarity index 98%
rename from crypto/spx/fors.h
rename to crypto/spx/spx_fors.h
index b673d67..f4bc7c2 100644
--- a/crypto/spx/fors.h
+++ b/crypto/spx/spx_fors.h
@@ -17,7 +17,7 @@
#include <openssl/base.h>
-#include "./params.h"
+#include "./spx_params.h"
#if defined(__cplusplus)
extern "C" {
diff --git a/crypto/spx/merkle.c b/crypto/spx/spx_merkle.c
similarity index 97%
rename from crypto/spx/merkle.c
rename to crypto/spx/spx_merkle.c
index 58429f7..3274e22 100644
--- a/crypto/spx/merkle.c
+++ b/crypto/spx/spx_merkle.c
@@ -16,11 +16,11 @@
#include <string.h>
-#include "./address.h"
-#include "./merkle.h"
-#include "./params.h"
-#include "./thash.h"
-#include "./wots.h"
+#include "./spx_address.h"
+#include "./spx_merkle.h"
+#include "./spx_params.h"
+#include "./spx_thash.h"
+#include "./spx_wots.h"
void spx_treehash(uint8_t out_pk[SPX_N], const uint8_t sk_seed[SPX_N],
uint32_t i /*target node index*/,
diff --git a/crypto/spx/merkle.h b/crypto/spx/spx_merkle.h
similarity index 98%
rename from crypto/spx/merkle.h
rename to crypto/spx/spx_merkle.h
index 93f9e51..1f0bfe9 100644
--- a/crypto/spx/merkle.h
+++ b/crypto/spx/spx_merkle.h
@@ -19,7 +19,7 @@
#include <sys/types.h>
-#include "./params.h"
+#include "./spx_params.h"
#if defined(__cplusplus)
extern "C" {
diff --git a/crypto/spx/params.h b/crypto/spx/spx_params.h
similarity index 100%
rename from crypto/spx/params.h
rename to crypto/spx/spx_params.h
diff --git a/crypto/spx/thash.c b/crypto/spx/spx_thash.c
similarity index 98%
rename from crypto/spx/thash.c
rename to crypto/spx/spx_thash.c
index 8be1ba4..3b34dd4 100644
--- a/crypto/spx/thash.c
+++ b/crypto/spx/spx_thash.c
@@ -20,9 +20,9 @@
#include <openssl/sha.h>
-#include "./params.h"
+#include "./spx_params.h"
#include "./spx_util.h"
-#include "./thash.h"
+#include "./spx_thash.h"
static void spx_thash(uint8_t *output, const uint8_t *input,
size_t input_blocks, const uint8_t pk_seed[SPX_N],
diff --git a/crypto/spx/thash.h b/crypto/spx/spx_thash.h
similarity index 98%
rename from crypto/spx/thash.h
rename to crypto/spx/spx_thash.h
index 2fd2842..368a0c9 100644
--- a/crypto/spx/thash.h
+++ b/crypto/spx/spx_thash.h
@@ -17,7 +17,7 @@
#include <openssl/base.h>
-#include "./params.h"
+#include "./spx_params.h"
#if defined(__cplusplus)
extern "C" {
diff --git a/crypto/spx/wots.c b/crypto/spx/spx_wots.c
similarity index 97%
rename from crypto/spx/wots.c
rename to crypto/spx/spx_wots.c
index c91dee2..652ffca 100644
--- a/crypto/spx/wots.c
+++ b/crypto/spx/spx_wots.c
@@ -18,11 +18,11 @@
#include <stdio.h>
#include <string.h>
-#include "./address.h"
-#include "./params.h"
+#include "./spx_address.h"
+#include "./spx_params.h"
#include "./spx_util.h"
-#include "./thash.h"
-#include "./wots.h"
+#include "./spx_thash.h"
+#include "./spx_wots.h"
// Chaining function used in WOTS+.
static void chain(uint8_t *output, const uint8_t *input, uint32_t start,
diff --git a/crypto/spx/wots.h b/crypto/spx/spx_wots.h
similarity index 98%
rename from crypto/spx/wots.h
rename to crypto/spx/spx_wots.h
index b3dbf38..1ef64f4 100644
--- a/crypto/spx/wots.h
+++ b/crypto/spx/spx_wots.h
@@ -17,7 +17,7 @@
#include <openssl/base.h>
-#include "./params.h"
+#include "./spx_params.h"
#if defined(__cplusplus)
extern "C" {
diff --git a/gen/sources.bzl b/gen/sources.bzl
index 8ea8f74..b176c72 100644
--- a/gen/sources.bzl
+++ b/gen/sources.bzl
@@ -404,13 +404,13 @@
"crypto/rsa_extra/rsa_crypt.c",
"crypto/rsa_extra/rsa_print.c",
"crypto/siphash/siphash.c",
- "crypto/spx/address.c",
- "crypto/spx/fors.c",
- "crypto/spx/merkle.c",
"crypto/spx/spx.c",
+ "crypto/spx/spx_address.c",
+ "crypto/spx/spx_fors.c",
+ "crypto/spx/spx_merkle.c",
+ "crypto/spx/spx_thash.c",
"crypto/spx/spx_util.c",
- "crypto/spx/thash.c",
- "crypto/spx/wots.c",
+ "crypto/spx/spx_wots.c",
"crypto/stack/stack.c",
"crypto/thread.c",
"crypto/thread_none.c",
@@ -636,13 +636,13 @@
"crypto/rand_extra/getrandom_fillin.h",
"crypto/rand_extra/sysrand_internal.h",
"crypto/rsa_extra/internal.h",
- "crypto/spx/address.h",
- "crypto/spx/fors.h",
- "crypto/spx/merkle.h",
- "crypto/spx/params.h",
+ "crypto/spx/spx_address.h",
+ "crypto/spx/spx_fors.h",
+ "crypto/spx/spx_merkle.h",
+ "crypto/spx/spx_params.h",
+ "crypto/spx/spx_thash.h",
"crypto/spx/spx_util.h",
- "crypto/spx/thash.h",
- "crypto/spx/wots.h",
+ "crypto/spx/spx_wots.h",
"crypto/trust_token/internal.h",
"crypto/x509/ext_dat.h",
"crypto/x509/internal.h",
diff --git a/gen/sources.cmake b/gen/sources.cmake
index e3245c1..8db4e3a 100644
--- a/gen/sources.cmake
+++ b/gen/sources.cmake
@@ -418,13 +418,13 @@
crypto/rsa_extra/rsa_crypt.c
crypto/rsa_extra/rsa_print.c
crypto/siphash/siphash.c
- crypto/spx/address.c
- crypto/spx/fors.c
- crypto/spx/merkle.c
crypto/spx/spx.c
+ crypto/spx/spx_address.c
+ crypto/spx/spx_fors.c
+ crypto/spx/spx_merkle.c
+ crypto/spx/spx_thash.c
crypto/spx/spx_util.c
- crypto/spx/thash.c
- crypto/spx/wots.c
+ crypto/spx/spx_wots.c
crypto/stack/stack.c
crypto/thread.c
crypto/thread_none.c
@@ -654,13 +654,13 @@
crypto/rand_extra/getrandom_fillin.h
crypto/rand_extra/sysrand_internal.h
crypto/rsa_extra/internal.h
- crypto/spx/address.h
- crypto/spx/fors.h
- crypto/spx/merkle.h
- crypto/spx/params.h
+ crypto/spx/spx_address.h
+ crypto/spx/spx_fors.h
+ crypto/spx/spx_merkle.h
+ crypto/spx/spx_params.h
+ crypto/spx/spx_thash.h
crypto/spx/spx_util.h
- crypto/spx/thash.h
- crypto/spx/wots.h
+ crypto/spx/spx_wots.h
crypto/trust_token/internal.h
crypto/x509/ext_dat.h
crypto/x509/internal.h
diff --git a/gen/sources.gni b/gen/sources.gni
index 292b2f1..c498e40 100644
--- a/gen/sources.gni
+++ b/gen/sources.gni
@@ -404,13 +404,13 @@
"crypto/rsa_extra/rsa_crypt.c",
"crypto/rsa_extra/rsa_print.c",
"crypto/siphash/siphash.c",
- "crypto/spx/address.c",
- "crypto/spx/fors.c",
- "crypto/spx/merkle.c",
"crypto/spx/spx.c",
+ "crypto/spx/spx_address.c",
+ "crypto/spx/spx_fors.c",
+ "crypto/spx/spx_merkle.c",
+ "crypto/spx/spx_thash.c",
"crypto/spx/spx_util.c",
- "crypto/spx/thash.c",
- "crypto/spx/wots.c",
+ "crypto/spx/spx_wots.c",
"crypto/stack/stack.c",
"crypto/thread.c",
"crypto/thread_none.c",
@@ -636,13 +636,13 @@
"crypto/rand_extra/getrandom_fillin.h",
"crypto/rand_extra/sysrand_internal.h",
"crypto/rsa_extra/internal.h",
- "crypto/spx/address.h",
- "crypto/spx/fors.h",
- "crypto/spx/merkle.h",
- "crypto/spx/params.h",
+ "crypto/spx/spx_address.h",
+ "crypto/spx/spx_fors.h",
+ "crypto/spx/spx_merkle.h",
+ "crypto/spx/spx_params.h",
+ "crypto/spx/spx_thash.h",
"crypto/spx/spx_util.h",
- "crypto/spx/thash.h",
- "crypto/spx/wots.h",
+ "crypto/spx/spx_wots.h",
"crypto/trust_token/internal.h",
"crypto/x509/ext_dat.h",
"crypto/x509/internal.h",
diff --git a/gen/sources.json b/gen/sources.json
index d6242bc..1e57157 100644
--- a/gen/sources.json
+++ b/gen/sources.json
@@ -388,13 +388,13 @@
"crypto/rsa_extra/rsa_crypt.c",
"crypto/rsa_extra/rsa_print.c",
"crypto/siphash/siphash.c",
- "crypto/spx/address.c",
- "crypto/spx/fors.c",
- "crypto/spx/merkle.c",
"crypto/spx/spx.c",
+ "crypto/spx/spx_address.c",
+ "crypto/spx/spx_fors.c",
+ "crypto/spx/spx_merkle.c",
+ "crypto/spx/spx_thash.c",
"crypto/spx/spx_util.c",
- "crypto/spx/thash.c",
- "crypto/spx/wots.c",
+ "crypto/spx/spx_wots.c",
"crypto/stack/stack.c",
"crypto/thread.c",
"crypto/thread_none.c",
@@ -618,13 +618,13 @@
"crypto/rand_extra/getrandom_fillin.h",
"crypto/rand_extra/sysrand_internal.h",
"crypto/rsa_extra/internal.h",
- "crypto/spx/address.h",
- "crypto/spx/fors.h",
- "crypto/spx/merkle.h",
- "crypto/spx/params.h",
+ "crypto/spx/spx_address.h",
+ "crypto/spx/spx_fors.h",
+ "crypto/spx/spx_merkle.h",
+ "crypto/spx/spx_params.h",
+ "crypto/spx/spx_thash.h",
"crypto/spx/spx_util.h",
- "crypto/spx/thash.h",
- "crypto/spx/wots.h",
+ "crypto/spx/spx_wots.h",
"crypto/trust_token/internal.h",
"crypto/x509/ext_dat.h",
"crypto/x509/internal.h",