This commit is contained in:
atul.jha 2021-01-13 14:51:27 +01:00
parent f92dcf0f5b
commit 20500fbb58
3 changed files with 10 additions and 10 deletions

View File

@ -47,11 +47,11 @@
/* DEFAULT CONFIGURATIONS */ /* DEFAULT CONFIGURATIONS */
#define DEBUG 1 //print all values when 1 #define DEBUG 0 //print all values when 1
#define isRSA 0 #define isRSA 0
#define isECC 1 #define isECC 1
#define DFL_PKC isRSA // isECC, 1 = ECC, 0= RSA #define DFL_PKC isECC // isECC, 1 = ECC, 0= RSA
//#define BIN 2 //#define BIN 2
#define PEM 0 #define PEM 0

View File

@ -70,18 +70,18 @@ void main()
//Session key creation //Session key creation
//receive session nonce from verifier? //receive session nonce from verifier?
//placeholder //placeholder
char * nonce = "session1"; char * NONCE = "session1";
KeyDrv_context SSN_ctx; KeyDrv_context SSN1_ctx;
SSN_ctx.ENT_MODE = SW_PRNG; SSN1_ctx.ENT_MODE = SW_PRNG; //non determ, gen new key for every session
SSN_ctx.PKC_MODE = DFL_PKC; SSN1_ctx.PKC_MODE = DFL_PKC;
SSN_ctx.seed = FWKEY; SSN1_ctx.seed = NULL;
SSN_ctx.phrase = nonce; SSN1_ctx.phrase = NONCE;
SSN_ctx.KEY_FORM = DFL_FORM; SSN1_ctx.KEY_FORM = DFL_FORM;
printf("Generating Session keys\n"); printf("Generating Session keys\n");
ret = AsymmKeyGen(&SSN_ctx); ret = AsymmKeyGen(&SSN1_ctx);
if(ret < DIMASUCCESS) if(ret < DIMASUCCESS)
{ {
perror("DIMAFAILURE : SESSION key gen failed\n"); perror("DIMAFAILURE : SESSION key gen failed\n");

Binary file not shown.