-
Notifications
You must be signed in to change notification settings - Fork 771
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dice] Move dice key related seeds to a separate library
Both X509 and CWT DICE implementations need these definitions. Move it out from the original source file for code reuse. Signed-off-by: Tommy Chiu <[email protected]>
- Loading branch information
1 parent
738f662
commit 02addf8
Showing
5 changed files
with
103 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// Copyright lowRISC contributors (OpenTitan project). | ||
// Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#include "sw/device/silicon_creator/lib/drivers/keymgr.h" | ||
#include "sw/device/silicon_creator/manuf/lib/flash_info_fields.h" | ||
|
||
// UDS (Creator) attestation key diverisfier constants. | ||
// Note: versions are always set to 0 so these keys are always valid from the | ||
// perspective of the keymgr hardware. | ||
const sc_keymgr_diversification_t kUdsKeymgrDiversifier = { | ||
.salt = | ||
{ | ||
0xabffa6a9, | ||
0xc781f1ad, | ||
0x4c1107ad, | ||
0xf9210d85, | ||
0x0931f555, | ||
0x6c5aef5d, | ||
0xb9ba4df0, | ||
0x77b248d2, | ||
}, | ||
.version = 0, | ||
}; | ||
// CDI_0 (OwnerIntermediate) attestation key diverisfier constants. | ||
const sc_keymgr_diversification_t kCdi0KeymgrDiversifier = { | ||
.salt = | ||
{ | ||
0x3e5913c7, | ||
0x41156f1d, | ||
0x998ddb9f, | ||
0xfa334191, | ||
0x8a85380e, | ||
0xba76ca1a, | ||
0xdb17c4a7, | ||
0xfb8852dc, | ||
}, | ||
.version = 0, | ||
}; | ||
// CDI_1 (Owner) attestation key diverisfier constants. | ||
const sc_keymgr_diversification_t kCdi1KeymgrDiversifier = { | ||
.salt = | ||
{ | ||
0x2d12c2e3, | ||
0x6acc6876, | ||
0x4bfb07ee, | ||
0xc45fc414, | ||
0x5d4fa9de, | ||
0xf295b128, | ||
0x50f49882, | ||
0xbbdefa29, | ||
}, | ||
.version = 0, | ||
}; | ||
|
||
const sc_keymgr_ecc_key_t kDiceKeyUds = { | ||
.type = kScKeymgrKeyTypeAttestation, | ||
.keygen_seed_idx = kFlashInfoFieldUdsKeySeedIdx, | ||
.keymgr_diversifier = &kUdsKeymgrDiversifier, | ||
.required_keymgr_state = kScKeymgrStateCreatorRootKey, | ||
}; | ||
|
||
const sc_keymgr_ecc_key_t kDiceKeyCdi0 = { | ||
.type = kScKeymgrKeyTypeAttestation, | ||
.keygen_seed_idx = kFlashInfoFieldCdi0KeySeedIdx, | ||
.keymgr_diversifier = &kCdi0KeymgrDiversifier, | ||
.required_keymgr_state = kScKeymgrStateOwnerIntermediateKey, | ||
}; | ||
|
||
const sc_keymgr_ecc_key_t kDiceKeyCdi1 = { | ||
.type = kScKeymgrKeyTypeAttestation, | ||
.keygen_seed_idx = kFlashInfoFieldCdi1KeySeedIdx, | ||
.keymgr_diversifier = &kCdi1KeymgrDiversifier, | ||
.required_keymgr_state = kScKeymgrStateOwnerKey, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Copyright lowRISC contributors (OpenTitan project). | ||
// Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#ifndef OPENTITAN_SW_DEVICE_SILICON_CREATOR_LIB_CERT_DICE_KEYS_H_ | ||
#define OPENTITAN_SW_DEVICE_SILICON_CREATOR_LIB_CERT_DICE_KEYS_H_ | ||
|
||
#include "sw/device/silicon_creator/lib/drivers/keymgr.h" | ||
|
||
extern const sc_keymgr_ecc_key_t kDiceKeyUds; | ||
extern const sc_keymgr_ecc_key_t kDiceKeyCdi0; | ||
extern const sc_keymgr_ecc_key_t kDiceKeyCdi1; | ||
|
||
#endif // OPENTITAN_SW_DEVICE_SILICON_CREATOR_LIB_CERT_DICE_KEYS_H_ |