Coder Social home page Coder Social logo

hku-systems / uranus Goto Github PK

View Code? Open in Web Editor NEW
6.0 10.0 6.0 1.08 GB

License: GNU General Public License v2.0

Dockerfile 0.01% Makefile 0.26% HTML 0.60% Shell 1.04% M4 0.10% C 7.16% Java 73.24% CMake 0.01% Batchfile 0.02% Objective-C 0.42% C++ 14.40% JavaScript 1.24% Assembly 0.04% Python 0.05% DTrace 0.04% XSLT 0.20% Lex 0.01% Roff 1.18% Perl 0.01% Ruby 0.01%

uranus's Introduction

Uranus

Uranus is a easy-to-use SGX runtime based on OpenJDK. It provides two annotation primitives: JECall and JOCall. For more details on Uranus's design, please see our AsiaCCS'20 paper.

How to build Uranus

Building Uranus is as easy as building OpenJDK. We have tested running Uranus with the following setup:

  • Linux Ubuntu 16.04 LTS x64

First, we need to install a modified version of SGX SDK

git clone https://github.com/intel/linux-sgx -b sgx_1.9
cd linux-sgx
./download_prebuilt.sh
# download dependencies
sudo apt-get install build-essential ocaml automake autoconf libtool wget python
# psw dependencies
sudo apt-get install libssl-dev libcurl4-openssl-dev protobuf-compiler libprotobuf-dev
# build sdk and psw
make sdk_install_pkg
make psw_install_pkg
# install sdk and psw
./linux/installer/bin/sgx_linux_x64_sdk_${version}.bin
./linux/installer/bin/sgx_linux_x64_psw_${version}.bin

# install simulation .so (for simulation only)
sudo cp ./linux/installer/common/sdk/output/package/lib64/libsgx_uae_service_sim.so /usr/lib/
sudo cp ./linux/installer/common/sdk/output/package/lib64/libsgx_urts_sim.so /usr/lib/

Then, install dependencies for openjdk

sudo apt-get install cmake

Finally, compile Uranus:

./confiure; make

If you want to build with the simulation mode, use

make SGX_MODE=SIM

How to run Uranus

Test your built:

cd ev_test
# compile your Java program
../build/linux-x86_64-normal-server-release/jdk/bin/javac TestSuit.java
# run test cases
../build/linux-x86_64-normal-server-release/jdk/bin/java TestSuit

Run a simple Fibonacci example

import edu.anonymity.sgx.IntelSGX;
import edu.anonymity.sgx.IntelSGXOcall;
import edu.anonymity.sgx.Tools;
class SimpleExample {

    // JOCall
    @IntelSGXOcall
    public static void print_info() {
        System.out.println("call print_info");
    }

    // fibonacci calculation, JECall
    @IntelSGX
    public static int[] calculate(int n) {
        int cal_n = n;
        if (n <= 2)
            cal_n = 2;
        int[] arr = new int[cal_n];
        arr[0] = arr[1] = 1;
        for (int i = 2;i < cal_n;i++) {
            arr[i] = arr[i - 1] + arr[i - 2];
        }
        print_info();
        return (int[])Tools.deep_copy(arr);
    }

    public static void main(String[] args) {
        int[] arr = calculate(10);
        for (int i : arr) {
                System.out.println(i);
        }
    }
}

In the example above, calculate is a JECall (annotated using IntelSGX), and print_info is a JOCall (annotated as IntelSGXOcall). After computated the result, arr is an enclave object and needs to be copied out of enclave. Therefore, we use Tools.deep_copy to copy all data from enclave to non-enclave heap.

To run this example,

cd ev_test
# compile your Java program
../build/linux-x86_64-normal-server-release/jdk/bin/javac SimpleExample.java
# run test cases
../build/linux-x86_64-normal-server-release/jdk/bin/java SimpleExample

uranus's People

Contributors

adinn avatar adoptopenjdk-github-bot avatar hansen-chen avatar jianyu-m avatar therealaph avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

uranus's Issues

could you please publish a docker for the project?

Hi, I am interested in this project very much and hope to try it, but I encounter some compile issue here:
image
I guess the reason is that g++ version causes it. I suggest that you could publish a docker for it, these problems will disappear.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.