Skip to content

Commit

Permalink
Merge pull request #121 from iku-iku-iku/sign_tool
Browse files Browse the repository at this point in the history
refactor penglai config to the file penglai-config.h
  • Loading branch information
fengerhu1 authored May 30, 2024
2 parents 05f5bef + 4fadb27 commit 2241bc7
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 15 deletions.
28 changes: 28 additions & 0 deletions penglai-enclave-driver/penglai-config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#ifndef _PENGLAI_CONFIG_H
#define _PENGLAI_CONFIG_H

#define NONCE 12345
#define MD_SIZE 64
#define MAX_ELF_SIZE 512*1024*1024
#define MAX_STACK_SIZE 64*1024*1024
#define DEFAULT_STACK_SIZE 1024*1024
#define MAX_UNTRUSTED_MEM_SIZE 16*1024*1024
#define DEFAULT_UNTRUSTED_SIZE 8*1024

//TODO: 64?
#define PRIVATE_KEY_SIZE 32
//TODO: 32?
#define PUBLIC_KEY_SIZE 64
#define HASH_SIZE 32
#define SIGNATURE_SIZE 64

#define DEFAULT_CLOCK_DELAY 100000
#define DEFAULT_UNTRUSTED_PTR 0x0000001000000000
#define ENCLAVE_DEFAULT_KBUFFER_SIZE 0x1000UL
#define ENCLAVE_DEFAULT_KBUFFER 0xffffffe000000000UL

#define USER_PARAM_RESUME_FROM_CUSTOM_OCALL 1000

#define STACK_POINT 0x0000004000000000
#endif

16 changes: 1 addition & 15 deletions penglai-enclave-driver/penglai-enclave-ioctl.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef _PENGLAI_ENCLAVE_IOCTL
#define _PENGLAI_ENCLAVE_IOCTL
#include "penglai-enclave.h"
#include "penglai-config.h"
#include <linux/uaccess.h>
#include <linux/types.h>
#include <asm/timex.h>
Expand All @@ -25,9 +26,6 @@

#define DEFAULT_SECURE_PAGES_ORDER 10
#define DEFAULT_CLOCK_DELAY 100000
#define DEFAULT_UNTRUSTED_PTR 0x0000001000000000
#define ENCLAVE_DEFAULT_KBUFFER_SIZE 0x1000UL
#define ENCLAVE_DEFAULT_KBUFFER 0xffffffe000000000UL

#define USER_PARAM_RESUME_FROM_CUSTOM_OCALL 1000

Expand Down Expand Up @@ -66,18 +64,6 @@ struct penglai_enclave_sbi_param

typedef unsigned char byte;

#define MD_SIZE 64
#define MAX_ELF_SIZE 512*1024*1024
#define MAX_STACK_SIZE 64*1024*1024
#define MAX_UNTRUSTED_MEM_SIZE 16*1024*1024

//TODO: 64?
#define PRIVATE_KEY_SIZE 32
//TODO: 32?
#define PUBLIC_KEY_SIZE 64
#define HASH_SIZE 32
#define SIGNATURE_SIZE 64

struct sm_report_t
{
unsigned char hash[HASH_SIZE];
Expand Down

0 comments on commit 2241bc7

Please sign in to comment.