Skip to content

Commit 8ba2f7e

Browse files
committed
[cryptolib] Move p256 and p384 headers to include
The p256 and p384 header files are needed to easily create variables for the input of ecc functions. Move those to public. Signed-off-by: Siemen Dhooghe <[email protected]>
1 parent e3995e4 commit 8ba2f7e

File tree

13 files changed

+19
-14
lines changed

13 files changed

+19
-14
lines changed

sw/device/lib/crypto/impl/ecc/BUILD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ load("//rules/opentitan:defs.bzl", "OPENTITAN_CPU")
99
cc_library(
1010
name = "p256",
1111
srcs = ["p256.c"],
12-
hdrs = ["p256.h"],
12+
hdrs = ["//sw/device/lib/crypto/include:p256.h"],
1313
target_compatible_with = [OPENTITAN_CPU],
1414
deps = [
1515
"//sw/device/lib/base:crc32",
@@ -25,7 +25,7 @@ cc_library(
2525
cc_library(
2626
name = "p384",
2727
srcs = ["p384.c"],
28-
hdrs = ["p384.h"],
28+
hdrs = ["//sw/device/lib/crypto/include:p384.h"],
2929
target_compatible_with = [OPENTITAN_CPU],
3030
deps = [
3131
"//sw/device/lib/base:crc32",

sw/device/lib/crypto/impl/ecc/p256.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
33
// SPDX-License-Identifier: Apache-2.0
44

5-
#include "sw/device/lib/crypto/impl/ecc/p256.h"
5+
#include "sw/device/lib/crypto/include/p256.h"
66

77
#include "sw/device/lib/base/crc32.h"
88
#include "sw/device/lib/base/hardened.h"

sw/device/lib/crypto/impl/ecc/p384.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
33
// SPDX-License-Identifier: Apache-2.0
44

5-
#include "sw/device/lib/crypto/impl/ecc/p384.h"
5+
#include "sw/device/lib/crypto/include/p384.h"
66

77
#include "sw/device/lib/base/crc32.h"
88
#include "sw/device/lib/base/hardened.h"

sw/device/lib/crypto/impl/ecc_p256.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
#include "sw/device/lib/base/hardened_memory.h"
88
#include "sw/device/lib/crypto/drivers/entropy.h"
99
#include "sw/device/lib/crypto/drivers/hmac.h"
10-
#include "sw/device/lib/crypto/impl/ecc/p256.h"
1110
#include "sw/device/lib/crypto/impl/security_config.h"
1211
#include "sw/device/lib/crypto/include/datatypes.h"
1312
#include "sw/device/lib/crypto/include/integrity.h"
1413
#include "sw/device/lib/crypto/include/keyblob.h"
14+
#include "sw/device/lib/crypto/include/p256.h"
1515

1616
// Module ID for status codes.
1717
#define MODULE_ID MAKE_MODULE_ID('p', '2', '5')

sw/device/lib/crypto/impl/ecc_p384.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
#include "sw/device/lib/base/hardened_memory.h"
88
#include "sw/device/lib/crypto/drivers/entropy.h"
99
#include "sw/device/lib/crypto/drivers/hmac.h"
10-
#include "sw/device/lib/crypto/impl/ecc/p384.h"
1110
#include "sw/device/lib/crypto/impl/security_config.h"
1211
#include "sw/device/lib/crypto/include/datatypes.h"
1312
#include "sw/device/lib/crypto/include/integrity.h"
1413
#include "sw/device/lib/crypto/include/keyblob.h"
14+
#include "sw/device/lib/crypto/include/p384.h"
1515

1616
// Module ID for status codes.
1717
#define MODULE_ID MAKE_MODULE_ID('p', '3', '8')

sw/device/lib/crypto/include/BUILD

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ cc_library(
3939
"kmac.h",
4040
"kmac_kdf.h",
4141
"otcrypto.h",
42+
"p256.h",
43+
"p384.h",
4244
"rsa.h",
4345
"sha2.h",
4446
"sha3.h",
@@ -50,6 +52,7 @@ cc_library(
5052
"//sw/device/lib/base:hardened",
5153
"//sw/device/lib/base:status",
5254
"//sw/device/lib/crypto/drivers:keymgr",
55+
"//sw/device/lib/crypto/drivers:otbn",
5356
],
5457
)
5558

@@ -74,6 +77,8 @@ cc_library(
7477
"kmac.h",
7578
"kmac_kdf.h",
7679
"otcrypto.h",
80+
"p256.h",
81+
"p384.h",
7782
"rsa.h",
7883
"sha2.h",
7984
"sha3.h",
File renamed without changes.
File renamed without changes.

sw/device/tests/crypto/cryptotest/firmware/ecdsa.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
#include "sw/device/lib/base/memory.h"
66
#include "sw/device/lib/base/status.h"
7-
#include "sw/device/lib/crypto/impl/ecc/p256.h"
8-
#include "sw/device/lib/crypto/impl/ecc/p384.h"
97
#include "sw/device/lib/crypto/include/datatypes.h"
108
#include "sw/device/lib/crypto/include/ecc_p256.h"
119
#include "sw/device/lib/crypto/include/ecc_p384.h"
1210
#include "sw/device/lib/crypto/include/integrity.h"
1311
#include "sw/device/lib/crypto/include/keyblob.h"
12+
#include "sw/device/lib/crypto/include/p256.h"
13+
#include "sw/device/lib/crypto/include/p384.h"
1414
#include "sw/device/lib/runtime/log.h"
1515
#include "sw/device/lib/testing/test_framework/ujson_ottf.h"
1616
#include "sw/device/lib/ujson/ujson.h"

sw/device/tests/crypto/ecdsa_p256_verify_functest.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#include "sw/device/lib/crypto/drivers/entropy.h"
66
#include "sw/device/lib/crypto/drivers/otbn.h"
7-
#include "sw/device/lib/crypto/impl/ecc/p256.h"
7+
#include "sw/device/lib/crypto/include/p256.h"
88
#include "sw/device/lib/crypto/include/sha2.h"
99
#include "sw/device/lib/runtime/log.h"
1010
#include "sw/device/lib/testing/test_framework/check.h"

0 commit comments

Comments
 (0)