杰特森 Linux API 参考文档

32.7.4 版本
基于软件的 AES-CMAC 函数

详细描述

指定 AES-CMAC 函数的软件实现,与 OpenSSL CMAC 实现非常相似,并且基于相同的概念。

函数

static int nist_sp_800_108_with_cmac (uint8_t *key, uint32_t key_len, char const *context, char const *label, uint32_t dk_len, uint8_t *out_dk)
 基于软件的 NIST-SP-800-108 KDF;从密钥缓冲区中的密钥派生密钥。更多...
 
static int key_mgnt_derive_root_keys (void)
 
static int set_ekb_key_to_keyslot (uint32_t keyslot, uint8_t key_index)
 
static int tegra_se_cmac_self_test (void)
 
static int tegra_se_nist_800_108_kdf_self_test (void)
 
int key_mgnt_processing (void)
 

变量

static uint8_t fv_for_ekb []
 
static uint8_t fv_for_ssk_dk []
 
static uint8_t kek2_rk_for_ekb [AES_KEY_128_SIZE] = { 0 }
 
static uint8_t ssk_rk [AES_KEY_128_SIZE] = { 0 }
 
static uint8_t demo_256_rk [AES_KEY_256_SIZE] = { 0 }
 
static uint8_t ekb_ek [AES_KEY_128_SIZE] = { 0 }
 
static uint8_t ekb_ak [AES_KEY_128_SIZE] = { 0 }
 
static uint8_t ssk_dk [AES_KEY_128_SIZE] = { 0 }
 

函数文档

◆ key_mgnt_derive_root_keys()

static int key_mgnt_derive_root_keys ( void  )
static

◆ key_mgnt_processing()

◆ nist_sp_800_108_with_cmac()

static int nist_sp_800_108_with_cmac ( uint8_t *  key,
uint32_t  key_len,
char const *  context,
char const *  label,
uint32_t  dk_len,
uint8_t *  out_dk 
)
static

基于软件的 NIST-SP-800-108 KDF;从密钥缓冲区中的密钥派生密钥。

注意
仅在运行时(启动阶段之后)使用此函数。要在启动时从 SE 密钥槽派生密钥,请使用 se_nist_sp_800_with_cmac()。该函数定义在仓库 trusty/keystore-demo 的 ./hwkey-agent/platform/tegra_se/include/tegra_se.h 中。它的 KDF 是在硬件而不是软件中实现的。
参数
[输入]*key用于派生的输入密钥。
[输入]key_len输入密钥的长度,以字节为单位。
[输入]*context指向 NIST-SP-800-108 上下文字符串的指针。
[输入]*label指向 NIST-SP-800-108 标签字符串的指针。
[输入]dk_len派生密钥的长度,以字节为单位;可以是 16(128 位)或 16 的任何倍数。
[输出]*out_dk指向派生密钥的指针。函数将结果存储在此位置。
返回值
如果成功,则返回 NO_ERROR;如果内存不可用,则返回 ERR_NO_MEMORY。

定义于文件 key_mgnt.c 第 116 行。

key_mgnt_processing()tegra_se_nist_800_108_kdf_self_test() 引用。

◆ set_ekb_key_to_keyslot()

static int set_ekb_key_to_keyslot ( uint32_t  keyslot,
uint8_t  key_index 
)
static

定义于文件 key_mgnt.c 第 246 行。

引用 se_write_keyslot()

key_mgnt_processing() 引用。

◆ tegra_se_cmac_self_test()

static int tegra_se_cmac_self_test ( void  )
static

◆ tegra_se_nist_800_108_kdf_self_test()

static int tegra_se_nist_800_108_kdf_self_test ( void  )
static

变量文档

◆ demo_256_rk

uint8_t demo_256_rk[AES_KEY_256_SIZE] = { 0 }
static

定义于文件 key_mgnt.c 第 85 行。

key_mgnt_derive_root_keys() 引用。

◆ ekb_ak

uint8_t ekb_ak[AES_KEY_128_SIZE] = { 0 }
static

定义于文件 key_mgnt.c 第 91 行。

key_mgnt_processing() 引用。

◆ ekb_ek

uint8_t ekb_ek[AES_KEY_128_SIZE] = { 0 }
static

定义于文件 key_mgnt.c 第 90 行。

key_mgnt_processing() 引用。

◆ fv_for_ekb

uint8_t fv_for_ekb[]
static
初始值
= {
0xba, 0xd6, 0x6e, 0xb4, 0x48, 0x49, 0x83, 0x68,
0x4b, 0x99, 0x2f, 0xe5, 0x4a, 0x64, 0x8b, 0xb8,
}

定义于文件 key_mgnt.c 第 65 行。

key_mgnt_derive_root_keys() 引用。

◆ fv_for_ssk_dk

uint8_t fv_for_ssk_dk[]
static
初始值
= {
0xe4, 0x20, 0xf5, 0x8d, 0x1d, 0xea, 0xb5, 0x24,
0xc2, 0x70, 0xd8, 0xd2, 0x3e, 0xca, 0x45, 0xe8,
}

定义于文件 key_mgnt.c 第 75 行。

key_mgnt_derive_root_keys() 引用。

◆ kek2_rk_for_ekb

uint8_t kek2_rk_for_ekb[AES_KEY_128_SIZE] = { 0 }
static

定义于文件 key_mgnt.c 第 83 行。

key_mgnt_derive_root_keys()key_mgnt_processing() 引用。

◆ ssk_dk

uint8_t ssk_dk[AES_KEY_128_SIZE] = { 0 }
static

定义于文件 key_mgnt.c 第 92 行。

key_mgnt_processing() 引用。

◆ ssk_rk

uint8_t ssk_rk[AES_KEY_128_SIZE] = { 0 }
static

定义于文件 key_mgnt.c 第 84 行。

key_mgnt_derive_root_keys()key_mgnt_processing() 引用。

. All rights reserved.