2019-03-06 13:24:55 +08:00
|
|
|
/*
|
2022-04-05 18:59:24 +08:00
|
|
|
* Copyright (C) 2019 Intel Corporation.
|
2019-03-06 13:24:55 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SEED_H_
|
|
|
|
#define SEED_H_
|
|
|
|
|
2019-03-15 10:21:21 +08:00
|
|
|
#define BOOTLOADER_SEED_MAX_ENTRIES 10U
|
|
|
|
#define BUP_MKHI_BOOTLOADER_SEED_LEN 64U
|
2020-05-28 23:18:47 +08:00
|
|
|
#define MAX_SEED_ARG_SIZE 1024U
|
2019-03-15 10:21:21 +08:00
|
|
|
|
|
|
|
/* Structure of seed info */
|
|
|
|
struct seed_info {
|
|
|
|
uint8_t cse_svn;
|
|
|
|
uint8_t bios_svn;
|
|
|
|
uint8_t padding[2];
|
|
|
|
uint8_t seed[BUP_MKHI_BOOTLOADER_SEED_LEN];
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Structure of physical seed */
|
2019-03-06 13:24:55 +08:00
|
|
|
struct physical_seed {
|
|
|
|
struct seed_info seed_list[BOOTLOADER_SEED_MAX_ENTRIES];
|
|
|
|
uint32_t num_seeds;
|
|
|
|
uint32_t pad;
|
|
|
|
};
|
|
|
|
|
|
|
|
void init_seed(void);
|
|
|
|
|
2020-06-03 12:41:03 +08:00
|
|
|
void fill_seed_arg(char *cmd_dst, size_t cmd_sz);
|
2019-03-06 13:24:55 +08:00
|
|
|
|
|
|
|
bool derive_virtual_seed(struct seed_info *seed_list, uint32_t *num_seeds,
|
|
|
|
const uint8_t *salt, size_t salt_len, const uint8_t *info, size_t info_len);
|
|
|
|
|
|
|
|
bool derive_attkb_enc_key(uint8_t *out_key);
|
|
|
|
|
|
|
|
#endif /* SEED_H_ */
|