Skip to content

Commit

Permalink
#31 POC for python avro deserialsation working in Anjuna-SGX environment
Browse files Browse the repository at this point in the history
  • Loading branch information
hiteshvpatel256 committed Aug 5, 2022
1 parent 60954e2 commit 8278650
Show file tree
Hide file tree
Showing 9 changed files with 402 additions and 9 deletions.
Binary file not shown.
Binary file not shown.
18 changes: 9 additions & 9 deletions protocolAggregator/anjunaEnclave/avroSerialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
inputRecords = convertCsvToJson.make_json("ProviderInputData.csv")

# print(convertCsvToJson.make_json("ProviderInputData.csv")[0])
print(inputSchema)
# print(inputSchema)

writer = DataFileWriter(open("aggregateOutput.avro", "wb"), DatumWriter(), inputSchema)
for record in inputRecords:
print(record)
writer.append(record)
# writer = DataFileWriter(open("aggregateOutput.avro", "wb"), DatumWriter(), inputSchema)
# for record in inputRecords:
# print(record)
# writer.append(record)

# writer.append({"name": "Alyssa", "favorite_number": 256})
# writer.append({"name": "Ben", "favorite_number": 7, "favorite_color": "red"})
writer.close()
# # writer.append({"name": "Alyssa", "favorite_number": 256})
# # writer.append({"name": "Ben", "favorite_number": 7, "favorite_color": "red"})
# writer.close()

reader = DataFileReader(open("aggregateOutput.avro", "rb"), DatumReader())
reader = DataFileReader(open("aggregateOutput.avro.encrypted", "rb"), DatumReader())
for record in reader:
print(record)

Expand Down
Binary file not shown.
9 changes: 9 additions & 0 deletions protocolAggregator/anjunaEnclave/provision/python.pubkey
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-----BEGIN PUBLIC KEY-----
MIIBIDANBgkqhkiG9w0BAQEFAAOCAQ0AMIIBCAKCAQEAmlIkYfeXOwlX3vxT3TCK
MLeOqXFTbM3uFQF3L8XZu+Bpf8Ohd25nng1LzSgqcplYRlXyu5i2IcWl3Z31axyZ
uvVRkUYnmcYayIavkeJxQ8+2IC9cR8XChJTHbY8YeJUj09Mujh9AncoR+yNukWJE
bcgtpax7pNsOoZ3+wZ1zB/BIPIy4z8wkaX2MJCCHOplP4dLRn7lr+qHQ7WPrVNI4
Tu/hNEQtDQmAoM6yNyV05HbDaq80Y3fgy5Ck8hA+JdybxYYdba4FDvj0avgN0MwR
FgS1wTaJp0ZOrVEP0lwmRozyc3nkvUbfkcEp/ZMhm2DLhFTiXZGetblDQ4ZshCLZ
CQIBAw==
-----END PUBLIC KEY-----
Binary file not shown.
38 changes: 38 additions & 0 deletions protocolAggregator/anjunaEnclave/python.manifest.sgx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
environment:
- name: LD_LIBRARY_PATH
value: Runtime:/lib/x86_64-linux-gnu
command: /home/azureuser/180protocol/protocolAggregator/anjunaEnclave/venv/bin/python
enclave_size: 2147483648
num_threads: 64
num_switchless_workers: 1
isv_prod_id: 0
isv_svn: 0
trusted_hashes:
- path: /lib/x86_64-linux-gnu/libz.so.1
hash: a2a9fe2449100e9f0fee051929ecf979a84f1e10801ebf1ac92cea1598691129
- path: /home/azureuser/180protocol/protocolAggregator/anjunaEnclave/venv/bin/python
hash: b9d6afd6104319204b4a2caf9ea9d457a99d14c65c8875cf29f894414375a168
- path: Runtime/libutil.so.1
hash: 40a27b64a46cbe80cf2ccc5a64870233a8c7ac903713402505deb768f9c7a1d2
- path: Runtime/libpthread.so.0
hash: 54fd8e6077598168372bc203a2699fe50baf1fa5a4cd8028a9f56a4b7db4de6f
- path: Runtime/libdl.so.2
hash: fa96fce0f5abfe3b132470990a99d05de27185b8a347261e7ab6c7508484379e
- path: /lib/x86_64-linux-gnu/libexpat.so.1
hash: 814511d21382822ab40b3bfc1b1eff649ea2332594ae65b93852277cf4c04b1b
- path: Runtime/libm.so.6
hash: 9ee4c2cb354570f2a95072ddb5e8eb870da6d7f63e1464c2817fba1c91f59fb8
- path: Runtime/ld-linux-x86-64.so.2
hash: 0017b6f95ee84fa0940c553cabb5f4ab5d0244e4903f9114e4170158b7a63e9b
- path: Runtime/libc.so.6
hash: abdc9bdf8a682265a9038765c615715e807e64eae3da6ac6eb38946e27199ced
disable_switchless: false
ignore_map_shared: false
ignore_vfork: false
is_production: false
keys:
- id: secret_key
source: enclave_generated
encrypted_files:
- path: aggregateOutput.avro.encrypted
key: secret_key
Loading

0 comments on commit 8278650

Please sign in to comment.