Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor penglai config to the file penglai-config.h #121

Merged
merged 1 commit into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading