[sw/otbn] Move crypto assembly files into new folder.
OTBN crypto assembly files are a bit of a different category than the
other small example programs in code-snippets; move these to their own,
new folder under sw/otbn/crypto.
Signed-off-by: Jade Philipoom <jadep@google.com>
diff --git a/sw/otbn/code-snippets/meson.build b/sw/otbn/code-snippets/meson.build
index 1ad21cd..dfea0d9 100644
--- a/sw/otbn/code-snippets/meson.build
+++ b/sw/otbn/code-snippets/meson.build
@@ -6,12 +6,6 @@
'barrett384': files(
'barrett384.s',
),
- 'modexp': files(
- 'modexp.s'
- ),
- 'p256': files(
- 'p256.s'
- ),
'loop': files(
'loop.s',
),
@@ -24,41 +18,9 @@
'pseudo-ops': files(
'pseudo-ops.s',
),
- 'rsa_1024_dec_test': files(
- 'rsa_1024_dec_test.s',
- 'modexp.s',
- ),
- 'rsa_1024_enc_test': files(
- 'rsa_1024_enc_test.s',
- 'modexp.s',
- ),
'err_test': files(
'err_test.s',
),
- 'p256_isoncurve_test': files(
- 'p256_isoncurve_test.s',
- 'p256.s',
- ),
- 'p256_scalar_mult_test': files(
- 'p256_scalar_mult_test.s',
- 'p256.s',
- ),
- 'p256_ecdsa_sign_test': files(
- 'p256_ecdsa_sign_test.s',
- 'p256.s',
- ),
- 'p256_ecdsa_verify_test': files(
- 'p256_ecdsa_verify_test.s',
- 'p256.s',
- ),
- 'rsa': files(
- 'rsa.s',
- 'modexp.s',
- ),
- 'p256_ecdsa': files(
- 'p256_ecdsa.s',
- 'p256.s',
- ),
'randomness': files(
'randomness.s',
),
diff --git a/sw/otbn/code-snippets/LICENSE.dcrypto b/sw/otbn/crypto/LICENSE.dcrypto
similarity index 100%
rename from sw/otbn/code-snippets/LICENSE.dcrypto
rename to sw/otbn/crypto/LICENSE.dcrypto
diff --git a/sw/otbn/crypto/meson.build b/sw/otbn/crypto/meson.build
new file mode 100644
index 0000000..225ba94
--- /dev/null
+++ b/sw/otbn/crypto/meson.build
@@ -0,0 +1,110 @@
+# Copyright lowRISC contributors.
+# Licensed under the Apache License, Version 2.0, see LICENSE for details.
+# SPDX-License-Identifier: Apache-2.0
+
+sw_otbn_sources += {
+ 'modexp': files(
+ 'modexp.s'
+ ),
+ 'p256': files(
+ 'p256.s'
+ ),
+ 'p256_base_mult_test': files(
+ 'p256_base_mult_test.s',
+ 'p256.s',
+ ),
+ 'p256_ecdsa': files(
+ 'p256_ecdsa.s',
+ 'p256.s',
+ ),
+ 'p256_ecdsa_sign_test': files(
+ 'p256_ecdsa_sign_test.s',
+ 'p256.s',
+ ),
+ 'p256_ecdsa_verify_test': files(
+ 'p256_ecdsa_verify_test.s',
+ 'p256.s',
+ ),
+ 'p256_isoncurve_test': files(
+ 'p256_isoncurve_test.s',
+ 'p256.s',
+ ),
+ 'p256_proj_add_test': files(
+ 'p256_proj_add_test.s',
+ 'p256.s',
+ ),
+ 'p256_scalar_mult_test': files(
+ 'p256_scalar_mult_test.s',
+ 'p256.s',
+ ),
+ 'p384_base': files(
+ 'p384_base.s',
+ ),
+ 'p384_base_mult_test': files(
+ 'p384_base_mult_test.s',
+ 'p384_sign.s',
+ 'p384_base.s',
+ ),
+ 'p384_ecdsa_sign_test': files(
+ 'p384_ecdsa_sign_test.s',
+ 'p384_sign.s',
+ 'p384_base.s',
+ ),
+ 'p384_ecdsa_verify_test': files(
+ 'p384_ecdsa_verify_test.s',
+ 'p384_verify.s',
+ 'p384_base.s',
+ ),
+ 'p384_isoncurve_test': files(
+ 'p384_isoncurve_test.s',
+ 'p384_verify.s',
+ 'p384_base.s',
+ ),
+ 'p384_proj_add_test': files(
+ 'p384_proj_add_test.s',
+ 'p384_base.s',
+ ),
+ 'p384_scalar_mult_test': files(
+ 'p384_scalar_mult_test.s',
+ 'p384_sign.s',
+ 'p384_base.s',
+ ),
+ 'p384_sign': files(
+ 'p384_sign.s',
+ 'p384_base.s',
+ ),
+ 'p384_verify': files(
+ 'p384_verify.s',
+ 'p384_base.s',
+ ),
+ 'rsa': files(
+ 'rsa.s',
+ 'modexp.s',
+ ),
+ 'rsa_1024_dec_test': files(
+ 'rsa_1024_dec_test.s',
+ 'modexp.s',
+ ),
+ 'rsa_1024_enc_test': files(
+ 'rsa_1024_enc_test.s',
+ 'modexp.s',
+ ),
+ 'rsa_verify_3072': files(
+ 'rsa_verify_3072.s',
+ ),
+ 'rsa_verify_3072_test': files(
+ 'rsa_verify_3072_test.s',
+ 'rsa_verify_3072.s',
+ ),
+ 'rsa_verify': files(
+ 'rsa_verify.s',
+ ),
+ 'rsa_verify_test': files(
+ 'rsa_verify_test.s',
+ 'rsa_verify.s',
+ ),
+ 'rsa_verify_test_exp3': files(
+ 'rsa_verify_test_exp3.s',
+ 'rsa_verify.s',
+ ),
+}
diff --git a/sw/otbn/code-snippets/modexp.s b/sw/otbn/crypto/modexp.s
similarity index 100%
rename from sw/otbn/code-snippets/modexp.s
rename to sw/otbn/crypto/modexp.s
diff --git a/sw/otbn/code-snippets/p256.s b/sw/otbn/crypto/p256.s
similarity index 100%
rename from sw/otbn/code-snippets/p256.s
rename to sw/otbn/crypto/p256.s
diff --git a/sw/otbn/code-snippets/p256_base_mult_test.s b/sw/otbn/crypto/p256_base_mult_test.s
similarity index 100%
rename from sw/otbn/code-snippets/p256_base_mult_test.s
rename to sw/otbn/crypto/p256_base_mult_test.s
diff --git a/sw/otbn/code-snippets/p256_ecdsa.s b/sw/otbn/crypto/p256_ecdsa.s
similarity index 100%
rename from sw/otbn/code-snippets/p256_ecdsa.s
rename to sw/otbn/crypto/p256_ecdsa.s
diff --git a/sw/otbn/code-snippets/p256_ecdsa_sign_test.s b/sw/otbn/crypto/p256_ecdsa_sign_test.s
similarity index 100%
rename from sw/otbn/code-snippets/p256_ecdsa_sign_test.s
rename to sw/otbn/crypto/p256_ecdsa_sign_test.s
diff --git a/sw/otbn/code-snippets/p256_ecdsa_verify_test.s b/sw/otbn/crypto/p256_ecdsa_verify_test.s
similarity index 100%
rename from sw/otbn/code-snippets/p256_ecdsa_verify_test.s
rename to sw/otbn/crypto/p256_ecdsa_verify_test.s
diff --git a/sw/otbn/code-snippets/p256_isoncurve_test.s b/sw/otbn/crypto/p256_isoncurve_test.s
similarity index 100%
rename from sw/otbn/code-snippets/p256_isoncurve_test.s
rename to sw/otbn/crypto/p256_isoncurve_test.s
diff --git a/sw/otbn/code-snippets/p256_proj_add_test.s b/sw/otbn/crypto/p256_proj_add_test.s
similarity index 100%
rename from sw/otbn/code-snippets/p256_proj_add_test.s
rename to sw/otbn/crypto/p256_proj_add_test.s
diff --git a/sw/otbn/code-snippets/p256_scalar_mult_test.s b/sw/otbn/crypto/p256_scalar_mult_test.s
similarity index 100%
rename from sw/otbn/code-snippets/p256_scalar_mult_test.s
rename to sw/otbn/crypto/p256_scalar_mult_test.s
diff --git a/sw/otbn/code-snippets/p384_base.s b/sw/otbn/crypto/p384_base.s
similarity index 100%
rename from sw/otbn/code-snippets/p384_base.s
rename to sw/otbn/crypto/p384_base.s
diff --git a/sw/otbn/code-snippets/p384_base_mult_test.s b/sw/otbn/crypto/p384_base_mult_test.s
similarity index 100%
rename from sw/otbn/code-snippets/p384_base_mult_test.s
rename to sw/otbn/crypto/p384_base_mult_test.s
diff --git a/sw/otbn/code-snippets/p384_ecdsa_sign_test.s b/sw/otbn/crypto/p384_ecdsa_sign_test.s
similarity index 100%
rename from sw/otbn/code-snippets/p384_ecdsa_sign_test.s
rename to sw/otbn/crypto/p384_ecdsa_sign_test.s
diff --git a/sw/otbn/code-snippets/p384_ecdsa_verify_test.s b/sw/otbn/crypto/p384_ecdsa_verify_test.s
similarity index 100%
rename from sw/otbn/code-snippets/p384_ecdsa_verify_test.s
rename to sw/otbn/crypto/p384_ecdsa_verify_test.s
diff --git a/sw/otbn/code-snippets/p384_isoncurve_test.s b/sw/otbn/crypto/p384_isoncurve_test.s
similarity index 100%
rename from sw/otbn/code-snippets/p384_isoncurve_test.s
rename to sw/otbn/crypto/p384_isoncurve_test.s
diff --git a/sw/otbn/code-snippets/p384_proj_add_test.s b/sw/otbn/crypto/p384_proj_add_test.s
similarity index 100%
rename from sw/otbn/code-snippets/p384_proj_add_test.s
rename to sw/otbn/crypto/p384_proj_add_test.s
diff --git a/sw/otbn/code-snippets/p384_scalar_mult_test.s b/sw/otbn/crypto/p384_scalar_mult_test.s
similarity index 100%
rename from sw/otbn/code-snippets/p384_scalar_mult_test.s
rename to sw/otbn/crypto/p384_scalar_mult_test.s
diff --git a/sw/otbn/code-snippets/p384_sign.s b/sw/otbn/crypto/p384_sign.s
similarity index 100%
rename from sw/otbn/code-snippets/p384_sign.s
rename to sw/otbn/crypto/p384_sign.s
diff --git a/sw/otbn/code-snippets/p384_verify.s b/sw/otbn/crypto/p384_verify.s
similarity index 100%
rename from sw/otbn/code-snippets/p384_verify.s
rename to sw/otbn/crypto/p384_verify.s
diff --git a/sw/otbn/code-snippets/rsa.s b/sw/otbn/crypto/rsa.s
similarity index 100%
rename from sw/otbn/code-snippets/rsa.s
rename to sw/otbn/crypto/rsa.s
diff --git a/sw/otbn/code-snippets/rsa_1024_dec_test.s b/sw/otbn/crypto/rsa_1024_dec_test.s
similarity index 100%
rename from sw/otbn/code-snippets/rsa_1024_dec_test.s
rename to sw/otbn/crypto/rsa_1024_dec_test.s
diff --git a/sw/otbn/code-snippets/rsa_1024_enc_test.s b/sw/otbn/crypto/rsa_1024_enc_test.s
similarity index 100%
rename from sw/otbn/code-snippets/rsa_1024_enc_test.s
rename to sw/otbn/crypto/rsa_1024_enc_test.s
diff --git a/sw/otbn/code-snippets/rsa_verify.s b/sw/otbn/crypto/rsa_verify.s
similarity index 100%
rename from sw/otbn/code-snippets/rsa_verify.s
rename to sw/otbn/crypto/rsa_verify.s
diff --git a/sw/otbn/code-snippets/rsa_verify_3072.s b/sw/otbn/crypto/rsa_verify_3072.s
similarity index 100%
rename from sw/otbn/code-snippets/rsa_verify_3072.s
rename to sw/otbn/crypto/rsa_verify_3072.s
diff --git a/sw/otbn/code-snippets/rsa_verify_3072_test.s b/sw/otbn/crypto/rsa_verify_3072_test.s
similarity index 100%
rename from sw/otbn/code-snippets/rsa_verify_3072_test.s
rename to sw/otbn/crypto/rsa_verify_3072_test.s
diff --git a/sw/otbn/code-snippets/rsa_verify_test.s b/sw/otbn/crypto/rsa_verify_test.s
similarity index 100%
rename from sw/otbn/code-snippets/rsa_verify_test.s
rename to sw/otbn/crypto/rsa_verify_test.s
diff --git a/sw/otbn/code-snippets/rsa_verify_test_exp3.s b/sw/otbn/crypto/rsa_verify_test_exp3.s
similarity index 100%
rename from sw/otbn/code-snippets/rsa_verify_test_exp3.s
rename to sw/otbn/crypto/rsa_verify_test_exp3.s
diff --git a/sw/otbn/meson.build b/sw/otbn/meson.build
index d362e89..1993c34 100644
--- a/sw/otbn/meson.build
+++ b/sw/otbn/meson.build
@@ -39,6 +39,7 @@
# All subdirectories add the objects they want to build to the sw_otbn_sources
# dictionary.
subdir('code-snippets')
+subdir('crypto')
prog_otbn_build = meson.source_root() / 'util/otbn_build.py'
diff --git a/util/licence-checker.hjson b/util/licence-checker.hjson
index 3150d1b..bd4bb3a 100644
--- a/util/licence-checker.hjson
+++ b/util/licence-checker.hjson
@@ -54,10 +54,10 @@
# Code taken from Chromium, so covered by the BSD licence
'sw/device/silicon_creator/lib/crypto/ecdsa_p256/p256.s',
'sw/device/silicon_creator/lib/crypto/rsa_3072/rsa_3072.s',
- 'sw/otbn/code-snippets/modexp.s',
- 'sw/otbn/code-snippets/p256.s',
- 'sw/otbn/code-snippets/rsa_verify.s',
- 'sw/otbn/code-snippets/rsa_verify_3072.s',
+ 'sw/otbn/crypto/modexp.s',
+ 'sw/otbn/crypto/p256.s',
+ 'sw/otbn/crypto/rsa_verify.s',
+ 'sw/otbn/crypto/rsa_verify_3072.s',
# Mersenne Twister PRNG
'sw/device/sca/lib/prng.c',
],