Alguien podría decirme cómo generar un par de claves como esta en formato hexadecimal: Esto es de SampleCode / RemoteAttestation / service_provider / service_provider.cpp del repositorio: enlace
// This is the private EC key of SP, the corresponding public EC key is
// hard coded in isv_enclave. It is based on NIST P-256 curve.
static const sample_ec256_private_t g_sp_priv_key = {
{
0x90, 0xe7, 0x6c, 0xbb, 0x2d, 0x52, 0xa1, 0xce,
0x3b, 0x66, 0xde, 0x11, 0x43, 0x9c, 0x87, 0xec,
0x1f, 0x86, 0x6a, 0x3b, 0x65, 0xb6, 0xae, 0xea,
0xad, 0x57, 0x34, 0x53, 0xd1, 0x03, 0x8c, 0x01
}
};
// This is the public EC key of SP, this key is hard coded in isv_enclave.
// It is based on NIST P-256 curve. Not used in the SP code.
static const sample_ec_pub_t g_sp_pub_key = {
{
0x72, 0x12, 0x8a, 0x7a, 0x17, 0x52, 0x6e, 0xbf,
0x85, 0xd0, 0x3a, 0x62, 0x37, 0x30, 0xae, 0xad,
0x3e, 0x3d, 0xaa, 0xee, 0x9c, 0x60, 0x73, 0x1d,
0xb0, 0x5b, 0xe8, 0x62, 0x1c, 0x4b, 0xeb, 0x38
},
{
0xd4, 0x81, 0x40, 0xd9, 0x50, 0xe2, 0x57, 0x7b,
0x26, 0xee, 0xb7, 0x41, 0xe7, 0xc6, 0x14, 0xe2,
0x24, 0xb7, 0xbd, 0xc9, 0x03, 0xf2, 0x9a, 0x28,
0xa8, 0x3c, 0xc8, 0x10, 0x11, 0x14, 0x5e, 0x06
}
};
Soy nuevo en criptografía. La definición del tipo de datos:
#define SAMPLE_ECP256_KEY_SIZE 32
typedef struct sample_ec256_private_t
{
uint8_t r[SAMPLE_ECP256_KEY_SIZE];
} sample_ec256_private_t;
typedef struct sample_ec_pub_t
{
uint8_t gx[SAMPLE_ECP_KEY_SIZE];
uint8_t gy[SAMPLE_ECP_KEY_SIZE];
} sample_ec_pub_t;
#define SAMPLE_FEBITSIZE 256
#define SAMPLE_ECP_KEY_SIZE (SAMPLE_FEBITSIZE/8)