libspdm icon indicating copy to clipboard operation
libspdm copied to clipboard

Add raw key support in spdm_device_secret_lib_sample

Open jyao1 opened this issue 3 years ago • 0 comments

Current https://github.com/DMTF/libspdm/tree/main/os_stub/spdm_device_secret_lib_sample only supports PEM based private key.

Since we are also support raw key API, such as libspdm_ec_set_priv_key in https://github.com/DMTF/libspdm/blob/main/include/hal/library/cryptlib/cryptlib_ec.h libspdm_rsa_set_key in https://github.com/DMTF/libspdm/blob/main/include/hal/library/cryptlib/cryptlib_rsa.h

We need demonstrate using raw key, by using LIBSPDM_PRIVATE_KEY_USE_PEM macro.

That can save the image size.

ECDSA Example: with PEM

11/05/2022  08:11 PM           178,176 test_size_of_spdm_responder.exe
11/05/2022  08:11 PM               381 test_size_of_spdm_responder.exe.manifest
11/05/2022  08:11 PM           159,188 test_size_of_spdm_responder.map

with raw key, no PEM

11/05/2022  08:55 PM            63,488 test_size_of_spdm_responder.exe
11/05/2022  08:55 PM               381 test_size_of_spdm_responder.exe.manifest
11/05/2022  08:55 PM            58,528 test_size_of_spdm_responder.map

Sample POC at https://github.com/jyao1/libspdm/tree/poc_size

jyao1 avatar Nov 05 '22 13:11 jyao1