forked from keystone-enclave/keystone-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILDING
36 lines (29 loc) · 1.34 KB
/
BUILDING
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# This is quick-start approximate workflow and may not work for everyone, see docs/Building-and-Running.rst for details.
% cd ..
% git clone https://github.com/jedisct1/libsodium.git libsodium-server
% cd libsodium-server
% git checkout 4917510626c55c1f199ef7383ae164cf96044aea
% patch -p1 < ../keystone-demo/sodium_patches/configure.ac.patch
% ./autogen.sh
% ./configure --host=riscv64-unknown-linux-gnu --disable-ssp --disable-asm --without-pthreads
% make
% cd ..
% git clone https://github.com/jedisct1/libsodium.git libsodium-client
% cd libsodium-client
% git checkout 4917510626c55c1f199ef7383ae164cf96044aea
% ./autogen.sh
% ./configure --host=riscv64-unknown-linux-gnu --disable-ssp --disable-asm --without-pthreads
% make
% cd ../keystone-demo
% cp ../riscv-pk/hash/sm_expected_hash.h include/ # Or the relevant expected sm hash for your platform, this is only valid for qemu testing
% KEYSTONE_DIR=`pwd`/../keystone/ LIBSODIUM_DIR=`pwd`/../libsodium-server/src/libsodium LIBSODIUM_CLIENT_DIR=`pwd`/../libsodium-client/src/libsodium make
# Copy binaries to the buildroot build and rebuild image
% KEYSTONE_DIR=`pwd`/../keystone/ make copybins
# Now start qemu and run the demo
% scripts/run-qemu.sh
# login as root / busybear
% insmod keystone-driver.ko
% ifdown lo && ifup lo
% cd keystone-demo
% ./enclave-host.riscv &
% ./trusted_client.riscv 127.0.0.1