Skip to content

Commit

Permalink
Merge pull request #113 from ySteinhart1/restructure-2
Browse files Browse the repository at this point in the history
Restructure 2
  • Loading branch information
adriandavila authored Dec 29, 2023
2 parents fd91634 + 9b7c1ae commit 5beacca
Show file tree
Hide file tree
Showing 104 changed files with 5,061 additions and 0 deletions.
137 changes: 137 additions & 0 deletions ortoa-tee/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: false
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
SortPriority: 0
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
SortPriority: 0
- Regex: '.*'
Priority: 1
SortPriority: 0
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentCaseLabels: false
IndentGotoLabels: true
IndentPPDirectives: None
IndentWidth: 4
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
Standard: Latest
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 4
UseCRLF: false
UseTab: Never
...

18 changes: 18 additions & 0 deletions ortoa-tee/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# C++ build and installation
build/
install/

# Python sdk
.venv/

**/__pycache__/
**/.pytest_cache/
*.egg-info/

# e2e benchmarking flow
out/
*.csv

# Miscellaneous
.vscode/
**/*.DS_Store
8 changes: 8 additions & 0 deletions ortoa-tee/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
cmake_minimum_required(VERSION 3.26)

project(ORTOA-TEE
VERSION 0.1
LANGUAGES C CXX
)

add_subdirectory(src)
49 changes: 49 additions & 0 deletions ortoa-tee/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# ORTOA-TEE

ORTOA- a One Round Trip Oblivious Access protocol that reads or writes data stored on remote storage *in one round without revealing the type of access*.

The ORTOA-TEE project implements this access protocol leveraging the cryptographic guarantees of trusted execution environments (hardware enclaves) and benchmarks the performance.

## Scripts & Utilities

We provide a bash script library `srcipts/ortoa-lib.sh` that houses a collection of scripts and utilities to manage the `ORTOA` environment. It can be sourced as follows:

```bash
ORTOA/ $ source scripts/ortoa-lib.sh
```

## Building the codebase

Details about the build can be found at [TODO](todo). The easiest way to build the C++ projects is to run the `ortoa-cbi` script.

```bash
ORTOA/ $ ortoa-cbi # requires sourcing scripts & utilities
```

## Running ORTOA


### `ortoa-client-run`

Runs the `ORTOA-TEE` client

```bash
ORTOA/ $ ortoa-client-run -h
```

### `ortoa-host`

Runs the `ORTOA-TEE` host. Requires SGX hardware.

```bash
ORTOA/ $ ortoa-host -h
```

### `ortoa-simulate`

Runs the `ORTOA-TEE` host in simulation mode.

```bash
ORTOA/ $ ortoa-simulate -h
```

42 changes: 42 additions & 0 deletions ortoa-tee/data/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Data Directory

## Top-level directory layout

```txt
.
├── experiments # Benchmarking experiments
├── sample_seed # Sample seed and operations files
├── tests # Tests used while developing ORTOA
└── README.md
```

## `experiments`

We define experiments in `.yaml` format used to microbenchmark the ORTOA-TEE program. These are consumed by the benchmarking tool to test how certain variables affect the latency and throughput of ORTOA.

```txt
.
├── ...
├── experiments
│ ├── byte_size # Varying the size of the values (in bytes)
│ ├── client_concurrency # Varying the number of concurrent clients
│ ├── db_size # Varying the number of keys in the DB
│ └── percent_write # Varying the % of read vs. write operations
└── ...
```

## `seed`

Sample seed and operations `.csv` files that are consumed by the `ortoa-client` program to perform database accesses with the ORTOA protocol.

## `tests`

Tests defined in the same `.yaml` format as `experiments`. Consumed by the benchmarking tool while developing ORTOA-TEE to test the success/failure of the program.

```txt
.
├── ...
├── tests
│ └── byte_size_tests # How big can we push the size of the values?
└── ...
```
18 changes: 18 additions & 0 deletions ortoa-tee/data/experiments/byte_size/1000_bytes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Byte Size Experiment - 1000 Bytes

output_directory: byte_size_experiment_1000/

metadata:
description: How does the byte size of the values affect the latency and throughput of ORTOA?
nbytes: 1000

client_config:
data:
generator: ByteSizeGenerator
n_bytes: 1000
seed_size: 1000000
num_operations: 1100

flags:
- name: nthreads
value: 32
18 changes: 18 additions & 0 deletions ortoa-tee/data/experiments/byte_size/100_bytes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Byte Size Experiment - 100 Bytes

output_directory: byte_size_experiment_100/

metadata:
description: How does the byte size of the values affect the latency and throughput of ORTOA?
nbytes: 100

client_config:
data:
generator: ByteSizeGenerator
n_bytes: 100
seed_size: 1000000
num_operations: 1100

flags:
- name: nthreads
value: 32
18 changes: 18 additions & 0 deletions ortoa-tee/data/experiments/byte_size/10_bytes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Byte Size Experiment - 10 Bytes

output_directory: byte_size_experiment_10/

metadata:
description: How does the byte size of the values affect the latency and throughput of ORTOA?
nbytes: 10

client_config:
data:
generator: ByteSizeGenerator
n_bytes: 10
seed_size: 1000000
num_operations: 1100

flags:
- name: nthreads
value: 32
18 changes: 18 additions & 0 deletions ortoa-tee/data/experiments/byte_size/200_bytes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Byte Size Experiment - 200 Bytes

output_directory: byte_size_experiment_200/

metadata:
description: How does the byte size of the values affect the latency and throughput of ORTOA?
nbytes: 200

client_config:
data:
generator: ByteSizeGenerator
n_bytes: 200
seed_size: 1000000
num_operations: 1100

flags:
- name: nthreads
value: 32
18 changes: 18 additions & 0 deletions ortoa-tee/data/experiments/byte_size/300_bytes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Byte Size Experiment - 300 Bytes

output_directory: byte_size_experiment_300/

metadata:
description: How does the byte size of the values affect the latency and throughput of ORTOA?
nbytes: 300

client_config:
data:
generator: ByteSizeGenerator
n_bytes: 300
seed_size: 1000000
num_operations: 1100

flags:
- name: nthreads
value: 32
18 changes: 18 additions & 0 deletions ortoa-tee/data/experiments/byte_size/400_bytes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Byte Size Experiment - 400 Bytes

output_directory: byte_size_experiment_400/

metadata:
description: How does the byte size of the values affect the latency and throughput of ORTOA?
nbytes: 400

client_config:
data:
generator: ByteSizeGenerator
n_bytes: 400
seed_size: 1000000
num_operations: 1100

flags:
- name: nthreads
value: 32
18 changes: 18 additions & 0 deletions ortoa-tee/data/experiments/byte_size/500_bytes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Byte Size Experiment - 500 Bytes

output_directory: byte_size_experiment_500/

metadata:
description: How does the byte size of the values affect the latency and throughput of ORTOA?
nbytes: 500

client_config:
data:
generator: ByteSizeGenerator
n_bytes: 500
seed_size: 1000000
num_operations: 1100

flags:
- name: nthreads
value: 32
Loading

0 comments on commit 5beacca

Please sign in to comment.