Skip to content

Commit

Permalink
make sure sm_copy_key is defined for cva6
Browse files Browse the repository at this point in the history
  • Loading branch information
grg-haas committed Jan 26, 2024
1 parent eb03c0d commit e9fcf7f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
14 changes: 14 additions & 0 deletions sm/src/platform/fpga/ariane/platform.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* Default platform does nothing special here */
#include "../../../enclave.h"
#include <sbi/sbi_string.h>

unsigned long platform_init_global_once(){
return SBI_ERR_SM_ENCLAVE_SUCCESS;
Expand Down Expand Up @@ -42,3 +43,16 @@ uint64_t platform_random(){
x += (w += s);
return (x>>32) | (x<<32);
}

// Initialization functions
extern byte dev_public_key[PUBLIC_KEY_SIZE];

// Todo secure boot
void sm_copy_key(void)
{
sbi_memset(sm_hash, 0, MDSIZE);
sbi_memset(sm_signature, 0, SIGNATURE_SIZE);
sbi_memset(sm_public_key, 0, PUBLIC_KEY_SIZE);
sbi_memset(sm_private_key, 0, PRIVATE_KEY_SIZE);
sbi_memset(dev_public_key, 0, PUBLIC_KEY_SIZE);
}
4 changes: 4 additions & 0 deletions sm/src/platform/fpga/ariane/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@ struct platform_enclave_data{
// CPU configuration
#define MAX_HARTS 5


// Initialization functions
void sm_copy_key(void);

#endif // _PLATFORM_H_

0 comments on commit e9fcf7f

Please sign in to comment.