鍵管理の統一と重複削除

- 共通鍵ファイル追加:include/se050_scp03_keys.h, src/se050_scp03_keys.c
- test_scp03_hardware.c: 重複鍵定義削除し共通ファイルを参照
- test_scp03_se050.c: 重複鍵定義削除し共通ファイルを参照
- 鍵値はプレースホルダー (TODO: PDF から正しい値に置き換え)

構造:
  se050_scp03_keys.c
    ├─ SE050C0_ENC/MAC/DEK_KEY
    ├─ SE050C1_ENC/MAC/DEK_KEY
    └─ SE050E2_ENC/MAC/DEK_KEY
This commit is contained in:
km
2026-03-26 10:13:25 +09:00
parent 163fad68a7
commit 74789be2c3
6 changed files with 127 additions and 71 deletions
+2 -54
View File
@@ -25,9 +25,10 @@
#include "se050_wireguard.h"
#include "se050_crypto_utils.h"
#include "se050_scp03_keys.h"
/* ============================================================================
* SE050 Chip Selection (compile-time)
* Chip Selection and Key Mapping
* ============================================================================ */
#ifndef SE050_CHIP
@@ -61,59 +62,6 @@
#error "Invalid SE050_CHIP. Use SE050C0, SE050C1, or SE050E2"
#endif
/* ============================================================================
* Platform SCP03 Keys per Chip Type
* Each chip type has its own 3-key set (ENC, MAC, DEK)
* ============================================================================ */
/* SE050C0 Platform SCP03 Keys */
static const uint8_t SE050C0_ENC_KEY[16] = {
0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF
};
static const uint8_t SE050C0_MAC_KEY[16] = {
0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10,
0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10
};
static const uint8_t SE050C0_DEK_KEY[16] = {
0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF
};
/* SE050C1 Platform SCP03 Keys */
static const uint8_t SE050C1_ENC_KEY[16] = {
0xA1, 0xB2, 0xC3, 0xD4, 0xE5, 0xF6, 0x07, 0x18,
0x29, 0x3A, 0x4B, 0x5C, 0x6D, 0x7E, 0x8F, 0x90
};
static const uint8_t SE050C1_MAC_KEY[16] = {
0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88,
0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x00
};
static const uint8_t SE050C1_DEK_KEY[16] = {
0x98, 0x76, 0x54, 0x32, 0x10, 0xFE, 0xDC, 0xBA,
0x98, 0x76, 0x54, 0x32, 0x10, 0xFE, 0xDC, 0xBA
};
/* SE050E2 Platform SCP03 Keys */
static const uint8_t SE050E2_ENC_KEY[16] = {
0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC,
0xDD, 0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44
};
static const uint8_t SE050E2_MAC_KEY[16] = {
0x44, 0x33, 0x22, 0x11, 0x00, 0xFF, 0xEE, 0xDD,
0xCC, 0xBB, 0xAA, 0x99, 0x88, 0x77, 0x66, 0x55
};
static const uint8_t SE050E2_DEK_KEY[16] = {
0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE,
0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66
};
/* ============================================================================
* Test Result Tracking
* ============================================================================ */