├── .dockerignore ├── .env ├── .gitattributes ├── .github └── settings.yml ├── .gitignore ├── .pycodestyle ├── BUILD.md ├── CODEOWNERS ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Jenkinsfile ├── Jenkinsfile-centos-sim ├── Jenkinsfile-sgx-hw ├── LICENSE ├── MAINTAINERS.md ├── PREREQUISITES.md ├── README.md ├── SECURITY.md ├── VERSION ├── bin ├── get_version ├── run_docker_test ├── run_lint └── run_tests ├── blockchain_connector ├── common │ ├── Makefile │ ├── connector_common │ │ ├── __init__.py │ │ ├── base_connector.py │ │ ├── connector_interface.py │ │ ├── work_order_delegate.py │ │ └── worker_delegate.py │ └── setup.py ├── docker │ ├── Dockerfile-ethereum │ └── Dockerfile-fabric ├── ethereum │ ├── Makefile │ ├── ethereum_connector │ │ ├── __init__.py │ │ ├── eth_connector_service.py │ │ └── ethereum_connector.py │ └── setup.py └── fabric │ ├── Makefile │ ├── fabric_connector │ ├── __init__.py │ ├── fabric_connector.py │ └── fabric_connector_service.py │ └── setup.py ├── ci ├── docker-compose-direct-model-sgx.yaml ├── docker-compose-direct-model.yaml ├── docker-compose-fabric-proxy-model.yaml └── docker-compose-fabric-tests.yaml ├── common ├── README.md ├── cpp │ ├── BUILD.md │ ├── CMakeLists.txt │ ├── CMakeVariables.txt │ ├── README.md │ ├── c11_support.cpp │ ├── c11_support.h │ ├── crypto │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── crypto.h │ │ ├── crypto_shared.h │ │ ├── crypto_utils.cpp │ │ ├── crypto_utils.h │ │ ├── crypto_utils_encrypt.cpp │ │ ├── mbedtls │ │ │ ├── crypto_utils.cpp │ │ │ ├── pkenc_private_key.cpp │ │ │ ├── pkenc_public_key.cpp │ │ │ ├── sig_private_key.cpp │ │ │ ├── sig_public_key.cpp │ │ │ ├── skenc.cpp │ │ │ ├── verify_certificate.cpp │ │ │ └── verify_signature.cpp │ │ ├── pkenc.h │ │ ├── pkenc_private_key.cpp │ │ ├── pkenc_private_key.h │ │ ├── pkenc_private_key_common.cpp │ │ ├── pkenc_public_key.cpp │ │ ├── pkenc_public_key.h │ │ ├── pkenc_public_key_common.cpp │ │ ├── sig.h │ │ ├── sig_private_key.cpp │ │ ├── sig_private_key.h │ │ ├── sig_private_key_common.cpp │ │ ├── sig_public_key.cpp │ │ ├── sig_public_key.h │ │ ├── sig_public_key_common.cpp │ │ ├── skenc.cpp │ │ ├── skenc.h │ │ ├── skenc_common.cpp │ │ ├── verify_certificate.cpp │ │ ├── verify_certificate.h │ │ ├── verify_signature.cpp │ │ └── verify_signature.h │ ├── error.h │ ├── hex_string.cpp │ ├── hex_string.h │ ├── json_utils.cpp │ ├── json_utils.h │ ├── jsonvalue.h │ ├── packages │ │ ├── base64 │ │ │ ├── CMakeLists.txt │ │ │ ├── base64.cpp │ │ │ └── base64.h │ │ └── parson │ │ │ ├── CMakeLists.txt │ │ │ ├── parson.cpp │ │ │ └── parson.h │ ├── tcf_error.h │ ├── tests │ │ ├── Makefile │ │ ├── README.md │ │ ├── b64test.cpp │ │ ├── certtest.cpp │ │ ├── pktest.cpp │ │ ├── secrettest.cpp │ │ ├── signtest.cpp │ │ ├── utiltest.cpp │ │ └── verifytest.cpp │ ├── timer.h │ ├── types.cpp │ ├── types.h │ ├── utils.cpp │ ├── utils.h │ ├── verify_dcap_report │ │ ├── CMakeLists.txt │ │ ├── dcap_attestation_util.cpp │ │ ├── dcap_attestation_util.h │ │ ├── verify-dcap-quote.cpp │ │ └── verify-dcap-quote.h │ ├── verify_ias_report │ │ ├── CMakeLists.txt │ │ ├── build_ias_certificates_cpp.sh │ │ ├── ias-certificates.h │ │ ├── ias-certificates.template │ │ ├── ias_attestation_util.cpp │ │ ├── ias_attestation_util.h │ │ ├── verify-ias-report.cpp │ │ └── verify-ias-report.h │ └── zero.h ├── crypto_utils │ ├── Makefile │ ├── avalon_crypto_utils │ │ ├── __init__.py │ │ ├── crypto_utility.py │ │ ├── worker_encryption.py │ │ ├── worker_hash.py │ │ └── worker_signing.py │ ├── setup.py │ └── tests │ │ ├── README.md │ │ ├── cryptoutiltest.py │ │ ├── run_test.sh │ │ ├── signaturetest.py │ │ ├── wo_receipt_request.json │ │ ├── wo_receipt_update_response.json │ │ ├── wo_request.json │ │ └── wo_response.json ├── crypto_utils_openssl │ ├── Makefile │ ├── avalon_crypto_utils │ │ ├── __init__.py │ │ ├── crypto │ │ │ ├── __init__.py │ │ │ └── crypto.i │ │ ├── crypto_utility.py │ │ ├── keys.py │ │ └── signature.py │ └── setup.py ├── python │ ├── Makefile │ ├── README.md │ ├── config │ │ ├── __init__.py │ │ └── config.py │ ├── database │ │ ├── __init__.py │ │ ├── connector.py │ │ ├── lmdb_helper_proxy.py │ │ └── test_lmdb_app.py │ ├── error_code │ │ ├── __init__.py │ │ ├── enclave_error.py │ │ └── error_status.py │ ├── http_client │ │ ├── __init__.py │ │ └── http_jrpc_client.py │ ├── listener │ │ ├── __init__.py │ │ └── base_jrpc_listener.py │ ├── schema_validation │ │ ├── __init__.py │ │ ├── data │ │ │ ├── WorkOrderGetResult.json │ │ │ ├── WorkOrderReceiptCreate.json │ │ │ ├── WorkOrderReceiptLookUp.json │ │ │ ├── WorkOrderReceiptLookUpNext.json │ │ │ ├── WorkOrderReceiptRetrieve.json │ │ │ ├── WorkOrderReceiptUpdate.json │ │ │ ├── WorkOrderReceiptUpdateRetrieve.json │ │ │ ├── WorkOrderSubmit.json │ │ │ ├── WorkerLookUp.json │ │ │ ├── WorkerLookUpNext.json │ │ │ ├── WorkerRetrieve.json │ │ │ ├── sdk_WorkOrderSubmit.json │ │ │ ├── sdk_inData.json │ │ │ └── tc_methods.json │ │ └── validate.py │ ├── setup.py │ └── utility │ │ ├── __init__.py │ │ ├── file_utils.py │ │ ├── hex_utils.py │ │ ├── jrpc_utility.py │ │ ├── logger.py │ │ └── zmq_comm.py ├── sgx_workload │ ├── CMakeLists.txt │ ├── CMakeVariables.txt │ ├── README.md │ ├── iohandler │ │ ├── CMakeLists.txt │ │ ├── file_io.cpp │ │ ├── file_io.h │ │ ├── file_io_wrapper.cpp │ │ └── file_io_wrapper.h │ └── workload │ │ ├── CMakeLists.txt │ │ ├── work_order_data.cpp │ │ ├── work_order_data.h │ │ ├── workload_processor.cpp │ │ └── workload_processor.h └── verify_report_utils │ ├── dcap │ ├── Makefile │ ├── setup.py │ └── verify_dcap_quote │ │ ├── __init__.py │ │ ├── dcap_verify_report.i │ │ └── verify_dcap_quote_util.py │ └── ias │ ├── Makefile │ ├── setup.py │ └── verify_report │ ├── __init__.py │ ├── verify_attestation_report.py │ └── verify_report.i ├── config ├── graphene_config.toml ├── graphene_wpe_config.toml ├── kme_config.toml ├── singleton_enclave_config.toml ├── tcs_config.toml └── wpe_config.toml ├── coverage ├── Dockerfile ├── README.md ├── coverage-direct-model.yaml ├── coverage_gen.sh └── generate-report.yaml ├── docker-compose-lint.yaml ├── docker-compose-sgx-dcap.yaml ├── docker-compose-sgx.yaml ├── docker-compose.yaml ├── docker ├── Dockerfile ├── compose │ ├── avalon-eth-besu.yaml │ ├── avalon-eth-ganache.yaml │ ├── avalon-fabric.yaml │ ├── avalon-fib-graphene.yaml │ ├── avalon-fib-gsgx.yaml │ ├── avalon-multi-pool-sgx.yaml │ ├── avalon-multi-pool.yaml │ ├── avalon-ov-graphene.yaml │ ├── avalon-ov-gsgx.yaml │ ├── avalon-ov-subnet.yaml │ ├── avalon-pool-sgx-dcap.yaml │ ├── avalon-pool-sgx.yaml │ ├── avalon-pool.yaml │ ├── avalon-wpe-fib-graphene.yaml │ └── avalon-wpe-fib-gsgx.yaml ├── k8s │ ├── README.md │ ├── create-nfs.sh │ ├── docker │ │ └── Dockerfile │ ├── enclave-manager-deployment.yaml │ ├── enclave-manager-kme-deployment.yaml │ ├── enclave-manager-wpe-deployment.yaml │ ├── fabric │ │ ├── README.md │ │ ├── blockchain-connector.yaml │ │ └── shell.yaml │ ├── listener.yaml │ ├── lmdb.yaml │ ├── persistent-volume-claim.yaml │ ├── persistent-volume.yaml │ ├── propose-requests-job.yaml │ ├── propose_requests.sh │ ├── sgx-enclave-manager-deployment.yaml │ ├── sgx-enclave-manager-kme-deployment.yaml │ ├── sgx-enclave-manager-wpe-deployment.yaml │ ├── shell.yaml │ └── tcf-config-map.yaml ├── lb │ ├── Dockerfile.haproxy │ ├── Dockerfile.nginx │ ├── README.md │ ├── docker-compose-lb-haproxy.yaml │ ├── docker-compose-lb-nginx.yaml │ ├── docker-compose-listeners.yaml │ ├── haproxy.cfg │ └── nginx.conf └── pccs │ ├── Dockerfile │ └── sgx_default_qcnl.conf ├── docs ├── Doxyfile.in ├── FAQ.rst ├── Makefile ├── README.md ├── TestingBesuProxyModel.rst ├── TestingFabricProxyModel.rst ├── TestingGanacheProxyModel.rst ├── avalon-arch.pdf ├── dev-environments │ ├── ethereum │ │ ├── Dockerfile │ │ ├── besu │ │ │ ├── README.md │ │ │ ├── besu │ │ │ │ ├── node1 │ │ │ │ │ ├── genesis.json │ │ │ │ │ ├── key │ │ │ │ │ └── static-nodes.json │ │ │ │ └── node2 │ │ │ │ │ ├── genesis.json │ │ │ │ │ ├── key │ │ │ │ │ └── static-nodes.json │ │ │ ├── cleanup.sh │ │ │ ├── docker-compose-truffle.yaml │ │ │ ├── docker-compose.yaml │ │ │ ├── ethsigner │ │ │ │ ├── node1 │ │ │ │ │ ├── keystore │ │ │ │ │ │ └── account.txt │ │ │ │ │ └── password.txt │ │ │ │ └── node2 │ │ │ │ │ ├── keystore │ │ │ │ │ └── account.txt │ │ │ │ │ └── password.txt │ │ │ └── startup.sh │ │ └── ganache │ │ │ ├── cleanup.sh │ │ │ ├── docker-compose-truffle.yaml │ │ │ └── startup.sh │ └── fabric │ │ ├── README.md │ │ └── getandinstall.sh ├── graphene-workload-tutorial │ ├── Dockerfile │ ├── README.md │ ├── create_workload.py │ ├── docker-compose.yaml │ └── workload │ │ ├── Dockerfile.template │ │ ├── Makefile.template │ │ ├── avalon-workload-graphene.yaml.template │ │ ├── avalon-workload-gsgx.yaml.template │ │ ├── compose │ │ └── graphene-sgx.yaml.template │ │ ├── docker-compose.yaml.template │ │ ├── graphene_sgx │ │ └── build_gsc_workload.sh.template │ │ ├── setup.py │ │ ├── src │ │ ├── __init__.py │ │ └── my_workload.py.template │ │ ├── tests │ │ └── test_work_orders.json.template │ │ └── workload.json.template └── workload-tutorial │ ├── README.md │ ├── hello_world │ ├── stage_1 │ │ ├── CMakeLists.txt │ │ ├── logic.cpp │ │ ├── logic.h │ │ ├── plug-in.cpp │ │ └── plug-in.h │ ├── stage_2 │ │ ├── logic.cpp │ │ ├── logic.h │ │ └── plug-in.cpp │ └── stage_3 │ │ ├── CMakeLists.txt │ │ ├── io_helper.cpp │ │ ├── io_helper.h │ │ ├── logic.cpp │ │ └── logic.h │ └── templates │ ├── CMakeLists.txt │ ├── logic.cpp │ ├── logic.h │ ├── plug-in.cpp │ └── plug-in.h ├── enclave_manager ├── Dockerfile ├── Dockerfile-graphene ├── Makefile ├── Makefile-graphene ├── avalon_enclave_manager │ ├── __init__.py │ ├── attestation │ │ ├── __init__.py │ │ ├── attestation.py │ │ ├── dcap │ │ │ ├── __init__.py │ │ │ ├── dcap_attestation.py │ │ │ ├── dcap_enclave_info.i │ │ │ ├── dcap_enclave_info_kme.i │ │ │ ├── dcap_enclave_info_singleton.i │ │ │ ├── dcap_enclave_info_wpe.i │ │ │ └── pccs_client.py │ │ ├── enclave_info.i │ │ └── epid │ │ │ ├── __init__.py │ │ │ ├── epid_attestation.py │ │ │ ├── epid_enclave_info.i │ │ │ ├── epid_enclave_info_kme.i │ │ │ ├── epid_enclave_info_singleton.i │ │ │ └── epid_enclave_info_wpe.i │ ├── attestation_common │ │ ├── __init__.py │ │ └── ias_client.py │ ├── base_enclave_info.py │ ├── base_enclave_manager.py │ ├── enclave_attributes.py │ ├── enclave_type.py │ ├── graphene │ │ ├── __init__.py │ │ ├── graphene_enclave_info.py │ │ └── graphene_enclave_manager.py │ ├── graphene_wpe │ │ ├── __init__.py │ │ ├── graphene_wpe_enclave_info.py │ │ └── graphene_wpe_manager.py │ ├── kme │ │ ├── __init__.py │ │ ├── kme_enclave.i │ │ ├── kme_enclave_info.py │ │ ├── kme_enclave_manager.py │ │ └── kme_listener.py │ ├── sgx_work_order_request.py │ ├── singleton │ │ ├── __init__.py │ │ ├── singleton_enclave.i │ │ ├── singleton_enclave_info.py │ │ └── singleton_enclave_manager.py │ ├── work_order_kv_delegate.py │ ├── work_order_processor_manager.py │ ├── worker_kv_delegate.py │ ├── wpe │ │ ├── __init__.py │ │ ├── wpe_enclave.i │ │ ├── wpe_enclave_info.py │ │ └── wpe_enclave_manager.py │ └── wpe_common │ │ ├── __init__.py │ │ ├── wo_processor_manager_helper.py │ │ └── wpe_requester.py ├── setup_enclave_attestation.py ├── setup_graphene.py ├── setup_graphene_wpe.py ├── setup_kme.py ├── setup_singleton.py └── setup_wpe.py ├── examples ├── apps │ ├── CMakeLists.txt │ ├── CMakeVariables.txt │ ├── README.md │ ├── aml │ │ └── standalone-cipher │ │ │ ├── README.md │ │ │ ├── encryptionAlg.py │ │ │ ├── environment.sh │ │ │ ├── images │ │ │ └── santander_logo.png │ │ │ ├── json_building_blocks │ │ │ ├── base.json │ │ │ └── inData.json │ │ │ ├── main.py │ │ │ ├── signature.py │ │ │ ├── signingAlgorithm.py │ │ │ ├── test_data │ │ │ ├── csv_requests │ │ │ │ ├── transacES.csv │ │ │ │ ├── transacPL.csv │ │ │ │ ├── transacUK.csv │ │ │ │ ├── usersES.csv │ │ │ │ ├── usersPL.csv │ │ │ │ └── usersUK.csv │ │ │ └── our_signing_key.pem │ │ │ └── worker.py │ ├── echo │ │ └── workload │ │ │ ├── CMakeLists.txt │ │ │ ├── echo_logic.cpp │ │ │ ├── echo_logic.h │ │ │ ├── echo_plug-in.cpp │ │ │ └── echo_plug-in.h │ ├── eea_token │ │ ├── Makefile │ │ ├── README.md │ │ ├── execution_logic.cpp │ │ ├── execution_logic.h │ │ ├── test │ │ │ └── token_request │ │ └── token_validation.cpp │ ├── generic_client │ │ ├── README.md │ │ ├── base_generic_client.py │ │ ├── direct_model_generic_client.py │ │ ├── generic_client.py │ │ ├── generic_client_interface.py │ │ └── proxy_model_generic_client.py │ ├── heart_disease_eval │ │ ├── README.md │ │ ├── client │ │ │ └── heart_gui.py │ │ ├── images │ │ │ ├── ecg.jpg │ │ │ └── heart_gui_screenshot.jpg │ │ └── workload │ │ │ ├── CMakeLists.txt │ │ │ ├── heart_disease_evaluation_logic.cpp │ │ │ ├── heart_disease_evaluation_logic.h │ │ │ ├── heart_disease_evaluation_plug-in.cpp │ │ │ └── heart_disease_evaluation_plug-in.h │ ├── inside_out_eval │ │ ├── README.md │ │ └── workload │ │ │ ├── CMakeLists.txt │ │ │ ├── inside_out_eval_logic.cpp │ │ │ ├── inside_out_eval_logic.h │ │ │ ├── inside_out_eval_plug-in.cpp │ │ │ └── inside_out_eval_plug-in.h │ └── simple_wallet │ │ ├── README.md │ │ └── workload │ │ ├── CMakeLists.txt │ │ ├── simple_wallet_execute_io.cpp │ │ ├── simple_wallet_execute_io.h │ │ ├── simple_wallet_logic.cpp │ │ ├── simple_wallet_logic.h │ │ ├── simple_wallet_plug-in.cpp │ │ └── simple_wallet_plug-in.h ├── common │ └── java │ │ ├── .gitignore │ │ └── direct │ │ └── worker │ │ ├── Dockerfile │ │ ├── README.md │ │ ├── build.gradle │ │ ├── docker-compose.yml │ │ ├── gradle.properties │ │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ ├── settings.gradle │ │ ├── src │ │ ├── main │ │ │ ├── java │ │ │ │ └── org │ │ │ │ │ └── eea │ │ │ │ │ └── tcf │ │ │ │ │ └── worker │ │ │ │ │ ├── Application.java │ │ │ │ │ ├── chain │ │ │ │ │ ├── ChainUtils.java │ │ │ │ │ ├── events │ │ │ │ │ │ └── WorkOrderSubmittedEvent.java │ │ │ │ │ ├── model │ │ │ │ │ │ ├── ChainRegistry.java │ │ │ │ │ │ ├── ChainWorkOrder.java │ │ │ │ │ │ └── ChainWorker.java │ │ │ │ │ └── services │ │ │ │ │ │ ├── ComputationService.java │ │ │ │ │ │ ├── CredentialsService.java │ │ │ │ │ │ ├── WalletDetails.java │ │ │ │ │ │ ├── Web3jService.java │ │ │ │ │ │ ├── WorkOrderRegistryService.java │ │ │ │ │ │ └── WorkerRegistryService.java │ │ │ │ │ ├── config │ │ │ │ │ ├── WorkerConfigurationModel.java │ │ │ │ │ └── WorkerConfigurationService.java │ │ │ │ │ ├── contract │ │ │ │ │ └── generated │ │ │ │ │ │ ├── IWorkerRegistry.java │ │ │ │ │ │ ├── Migrations.java │ │ │ │ │ │ ├── Ownable.java │ │ │ │ │ │ ├── Set.java │ │ │ │ │ │ ├── SignatureVerifier.java │ │ │ │ │ │ ├── WorkOrderRegistry.java │ │ │ │ │ │ └── WorkerRegistry.java │ │ │ │ │ ├── dapp │ │ │ │ │ └── DappType.java │ │ │ │ │ ├── docker │ │ │ │ │ └── CustomDockerClient.java │ │ │ │ │ ├── executor │ │ │ │ │ ├── TaskExecutionException.java │ │ │ │ │ ├── TaskExecutionService.java │ │ │ │ │ └── TaskExecutorHelperService.java │ │ │ │ │ ├── security │ │ │ │ │ └── Signature.java │ │ │ │ │ └── utils │ │ │ │ │ ├── BytesUtils.java │ │ │ │ │ ├── FileHelper.java │ │ │ │ │ ├── HashUtils.java │ │ │ │ │ ├── MultiAddressHelper.java │ │ │ │ │ ├── SignatureUtils.java │ │ │ │ │ ├── VersionUtils.java │ │ │ │ │ └── WaitUtils.java │ │ │ └── resources │ │ │ │ ├── Version.java.template │ │ │ │ ├── application.yml │ │ │ │ ├── banner.txt │ │ │ │ ├── entrypoint.sh │ │ │ │ ├── logback.xml │ │ │ │ ├── wallet │ │ │ │ ├── wallet1.json │ │ │ │ ├── wallet2.json │ │ │ │ ├── wallet3.json │ │ │ │ ├── wallet4.json │ │ │ │ └── wallet5.json │ │ │ │ └── worker-details.json │ │ └── test │ │ │ └── resources │ │ │ └── tmp │ │ │ └── test-worker │ │ │ ├── bytes32 │ │ │ └── output │ │ │ │ └── iexec_out │ │ │ │ └── determinism.iexec │ │ │ ├── callback-fake │ │ │ └── output │ │ │ │ └── iexec_out │ │ │ │ └── callback.iexec │ │ │ ├── callback │ │ │ └── output │ │ │ │ └── iexec_out │ │ │ │ └── callback.iexec │ │ │ ├── notBytes32 │ │ │ └── output │ │ │ │ └── iexec_out │ │ │ │ └── determinism.iexec │ │ │ ├── scone-tee-corrupted-file │ │ │ └── output │ │ │ │ └── iexec_out │ │ │ │ └── enclaveSig.iexec │ │ │ └── scone-tee │ │ │ └── output │ │ │ └── iexec_out │ │ │ └── enclaveSig.iexec │ │ └── truffle_generate.sh └── graphene_apps │ ├── cppopenvino │ ├── CMakeLists.txt │ ├── Dockerfile │ ├── Dockerfile-py-workloads │ ├── README.md │ ├── compose │ │ ├── ov-subnet.yaml │ │ ├── python-worker-graphene.yaml │ │ └── python-worker-gsgx.yaml │ ├── config.toml │ ├── docker-compose-sgx.yaml │ ├── docker-compose.yaml │ ├── graphene │ │ ├── build_gsc_openvinowl.sh │ │ ├── build_gsc_ov_python_worker.sh │ │ └── openvinowl.manifest │ ├── images │ │ ├── elephants.jpg │ │ ├── horses.jpg │ │ ├── scenery.jpg │ │ ├── street.jpg │ │ └── test.png │ ├── ov_workload │ │ ├── setup.py │ │ └── src │ │ │ ├── __init__.py │ │ │ ├── openvino.py │ │ │ └── ov_workload_config.toml │ ├── process_wo.cpp │ ├── process_wo.h │ ├── ssd_od.cpp │ ├── ssd_od.h │ ├── test │ │ ├── python_worker │ │ │ ├── ov_workload.json │ │ │ └── test_ov_work_orders.json │ │ ├── test_config.toml │ │ └── test_send_request.py │ ├── zmq_listener.cpp │ └── zmq_listener.h │ └── python_workloads │ └── fibonacci │ ├── Dockerfile │ ├── Makefile │ ├── README.md │ ├── compose │ └── graphene-wpe-sgx.yaml │ ├── docker-compose-wpe.yaml │ ├── docker-compose.yaml │ ├── fib_workload.json │ ├── graphene_sgx │ └── build_gsc_fibonacci_workload.sh │ ├── setup.py │ ├── src │ ├── __init__.py │ └── fibonacci.py │ └── tests │ └── test_fib_work_orders.json ├── images ├── HL_Avalon_Logo_Color.png ├── HL_Avalon_Logo_Color_Small.png ├── sample-python-code-coverage-report.png ├── screenshot-hyperledger-avalon-application-development.jpg ├── screenshot-hyperledger-avalon-heart-disease-demo.jpg └── screenshot-introduction-to-hyperledger-avalon.jpg ├── lint └── Dockerfile ├── listener ├── Dockerfile ├── Makefile ├── avalon_listener │ ├── __init__.py │ ├── tcs_listener.py │ ├── tcs_work_order_handler.py │ ├── tcs_work_order_handler_sync.py │ ├── tcs_worker_encryption_key_handler.py │ ├── tcs_worker_registry_handler.py │ └── tcs_workorder_receipt_handler.py ├── listener_config.toml └── setup.py ├── scripts ├── eth_cli.py ├── generate_mrenclave.sh ├── install_packages ├── lmdb.sh ├── mr_enclave.py ├── sgx-hw.sh ├── start_fabric.sh ├── tcs_listener.sh ├── tcs_startup.sh └── update_env.sh ├── sdk ├── Makefile ├── TestingContracts.md ├── avalon_sdk │ ├── __init__.py │ ├── connector │ │ ├── README.md │ │ ├── __init__.py │ │ ├── blockchains │ │ │ ├── __init__.py │ │ │ ├── common │ │ │ │ ├── __init__.py │ │ │ │ └── contract_response.py │ │ │ ├── ethereum │ │ │ │ ├── README.md │ │ │ │ ├── __init__.py │ │ │ │ ├── contracts │ │ │ │ │ ├── LibSet.bytes32.sol │ │ │ │ │ ├── WorkOrderReceiptRegistry.sol │ │ │ │ │ ├── WorkOrderRegistry.sol │ │ │ │ │ ├── WorkerRegistry.sol │ │ │ │ │ └── WorkerRegistryList.sol │ │ │ │ ├── ethereum_listener.py │ │ │ │ ├── ethereum_work_order.py │ │ │ │ ├── ethereum_worker_registry.py │ │ │ │ ├── ethereum_worker_registry_list.py │ │ │ │ ├── ethereum_wrapper.py │ │ │ │ ├── truffle_artifacts │ │ │ │ │ ├── 2_deploy_contracts.js │ │ │ │ │ └── truffle-config.js │ │ │ │ └── unit_tests │ │ │ │ │ ├── test_ethereum_work_order_impl.py │ │ │ │ │ ├── test_ethereum_worker_registry_impl.py │ │ │ │ │ ├── test_ethereum_worker_registry_list_impl.py │ │ │ │ │ ├── work_order_get_result.json │ │ │ │ │ ├── work_order_get_result_error.json │ │ │ │ │ └── work_order_req.json │ │ │ └── fabric │ │ │ │ ├── README.md │ │ │ │ ├── __init__.py │ │ │ │ ├── base.py │ │ │ │ ├── chaincode │ │ │ │ ├── order │ │ │ │ │ └── go │ │ │ │ │ │ ├── definitions.go │ │ │ │ │ │ ├── go.mod │ │ │ │ │ │ └── main.go │ │ │ │ ├── receipt │ │ │ │ │ └── go │ │ │ │ │ │ ├── definitions.go │ │ │ │ │ │ ├── go.mod │ │ │ │ │ │ └── main.go │ │ │ │ ├── registry │ │ │ │ │ └── go │ │ │ │ │ │ ├── definitions.go │ │ │ │ │ │ ├── go.mod │ │ │ │ │ │ └── main.go │ │ │ │ └── worker │ │ │ │ │ └── go │ │ │ │ │ ├── definitions.go │ │ │ │ │ ├── go.mod │ │ │ │ │ └── main.go │ │ │ │ ├── chaincode_methods.py │ │ │ │ ├── event_listener.py │ │ │ │ ├── fabric_work_order.py │ │ │ │ ├── fabric_work_order_receipt.py │ │ │ │ ├── fabric_worker_registry.py │ │ │ │ ├── fabric_worker_registry_list.py │ │ │ │ ├── fabric_wrapper.py │ │ │ │ ├── network.json │ │ │ │ ├── tx_committer.py │ │ │ │ └── unit_tests │ │ │ │ ├── test_fabric_worker_registry_impl.py │ │ │ │ └── test_fabric_worker_registry_list_impl.py │ │ ├── direct │ │ │ ├── __init__.py │ │ │ ├── avalon_direct_client.py │ │ │ └── jrpc │ │ │ │ ├── __init__.py │ │ │ │ ├── jrpc_util.py │ │ │ │ ├── jrpc_work_order.py │ │ │ │ ├── jrpc_work_order_receipt.py │ │ │ │ ├── jrpc_worker_registry.py │ │ │ │ └── unit_tests │ │ │ │ ├── test_work_order_encryption_key_jrpc_impl.py │ │ │ │ ├── test_work_order_jrpc_impl.py │ │ │ │ └── test_worker_registry_jrpc_impl.py │ │ └── interfaces │ │ │ ├── __init__.py │ │ │ ├── work_order.py │ │ │ ├── work_order_proxy.py │ │ │ ├── work_order_receipt.py │ │ │ ├── worker_registry.py │ │ │ └── worker_registry_list.py │ ├── registry │ │ ├── __init__.py │ │ └── registry_status.py │ ├── tcf_connector.toml │ ├── work_order │ │ ├── __init__.py │ │ └── work_order_params.py │ ├── work_order_receipt │ │ ├── __init__.py │ │ └── work_order_receipt.py │ └── worker │ │ ├── __init__.py │ │ └── worker_details.py └── setup.py ├── shared_kv_storage ├── Dockerfile ├── Makefile ├── db_store │ ├── Makefile │ ├── db_store.cpp │ ├── db_store.h │ ├── db_store_csv.cpp │ ├── db_store_csv.h │ ├── db_store_error.h │ └── packages │ │ ├── CMakeLists.txt │ │ ├── db_store_wrapper.h │ │ ├── lmdb_store.cpp │ │ └── lmdb_store.h ├── kv_storage │ ├── __init__.py │ ├── interface │ │ ├── __init__.py │ │ ├── kv_csv_interface.py │ │ └── shared_kv_interface.py │ └── remote_lmdb │ │ ├── __init__.py │ │ ├── db_store.i │ │ ├── db_store_csv.i │ │ ├── lmdb_listener.py │ │ ├── lmdb_request_handler.py │ │ ├── shared_kv_dbstore.py │ │ └── string_escape.py ├── lmdb_config.toml ├── packaging │ ├── lmdb_config.toml.example │ └── systemd │ │ └── shared_kv_storage.service └── setup.py ├── tc ├── graphene │ └── python_worker │ │ ├── Dockerfile │ │ ├── Makefile │ │ ├── README.md │ │ ├── avalon_worker │ │ ├── __init__.py │ │ ├── attestation │ │ │ ├── __init__.py │ │ │ ├── sgx_attestation.py │ │ │ └── sgx_attestation_factory.py │ │ ├── base_work_order_processor.py │ │ ├── error_code.py │ │ ├── receive_request.py │ │ ├── singleton_work_order_processor.py │ │ ├── utility │ │ │ ├── __init__.py │ │ │ ├── jrpc_utility.py │ │ │ └── zmq_comm.py │ │ ├── workload │ │ │ ├── __init__.py │ │ │ ├── workload.py │ │ │ └── workload_processor.py │ │ └── wpe_work_order_processor.py │ │ ├── compose │ │ └── graphene-sgx.yaml │ │ ├── docker-compose-wpe-worker.yaml │ │ ├── docker-compose.yaml │ │ ├── graphene_sgx │ │ ├── __init__.py │ │ ├── build_gsc_python_worker.sh │ │ ├── graphene_sgx_attestation.py │ │ └── manifest │ │ │ ├── collect2.manifest │ │ │ ├── gcc.manifest │ │ │ ├── ld.manifest │ │ │ ├── python.manifest │ │ │ └── sh.manifest │ │ ├── setup_singleton.py │ │ ├── setup_wpe.py │ │ └── tests │ │ ├── __init__.py │ │ ├── hello │ │ ├── __init__.py │ │ └── hello.py │ │ ├── hello_world_workload.json │ │ ├── test_hello_work_orders.json │ │ ├── test_send_work_order.py │ │ └── test_worker_encryption.py └── sgx │ └── trusted_worker_manager │ ├── common │ ├── CMakeLists.txt │ ├── avalon_sgx_error.cpp │ ├── avalon_sgx_error.h │ └── sgx_support.h │ ├── enclave │ ├── CMakeLists.txt │ ├── CMakeVariables.txt │ ├── CMakeWorkloads.txt │ ├── auto_handle.h │ ├── auto_handle_sgx.h │ ├── base.edl │ ├── base_enclave.cpp │ ├── base_enclave.h │ ├── dcap_signup_helper.cpp │ ├── dcap_signup_helper.h │ ├── enclave.edl │ ├── enclave_common_t.h │ ├── enclave_data.cpp │ ├── enclave_data.h │ ├── enclave_utils.cpp │ ├── enclave_utils.h │ ├── epid_signup_helper.cpp │ ├── epid_signup_helper.h │ ├── ext_work_order_info.h │ ├── ext_work_order_info_impl.cpp │ ├── ext_work_order_info_impl.h │ ├── iohandler.edl │ ├── iohandler_enclave.cpp │ ├── iohandler_enclave.h │ ├── kme │ │ ├── CMakeLists.txt │ │ ├── avalon_kme_enclave.config.xml │ │ ├── avalon_kme_enclave.lds │ │ ├── ext_work_order_info_kme.cpp │ │ ├── ext_work_order_info_kme.h │ │ ├── kme_enclave.edl │ │ ├── signup_enclave_kme.cpp │ │ ├── signup_kme.edl │ │ ├── work_order_enclave_kme.cpp │ │ ├── work_order_processor_kme.cpp │ │ ├── work_order_processor_kme.h │ │ ├── workload │ │ │ ├── CMakeLists.txt │ │ │ ├── kme_workload_plug-in.cpp │ │ │ └── kme_workload_plug-in.h │ │ ├── workload_processor_kme.cpp │ │ └── workload_processor_kme.h │ ├── signup.edl │ ├── signup_enclave_common.cpp │ ├── signup_enclave_common.h │ ├── signup_enclave_util.cpp │ ├── signup_enclave_util.h │ ├── signup_helper.cpp │ ├── signup_helper.h │ ├── singleton │ │ ├── CMakeLists.txt │ │ ├── avalon_singleton_enclave.config.xml │ │ ├── avalon_singleton_enclave.lds │ │ ├── signup_enclave_singleton.cpp │ │ ├── signup_enclave_singleton.h │ │ ├── signup_singleton.edl │ │ ├── singleton_enclave.edl │ │ ├── work_order.edl │ │ └── work_order_enclave_singleton.cpp │ ├── tcf_enclave.config.xml │ ├── tcf_enclave.lds │ ├── work_order.edl │ ├── work_order_data_handler.cpp │ ├── work_order_data_handler.h │ ├── work_order_enclave_common.cpp │ ├── work_order_key_info.h │ ├── work_order_processor.cpp │ ├── work_order_processor.h │ └── wpe │ │ ├── CMakeLists.txt │ │ ├── avalon_wpe_enclave.config.xml │ │ ├── avalon_wpe_enclave.lds │ │ ├── ext_work_order_info_wpe.cpp │ │ ├── ext_work_order_info_wpe.h │ │ ├── signup_enclave_wpe.cpp │ │ ├── signup_wpe.edl │ │ ├── work_order_data_handler_wpe.cpp │ │ ├── work_order_data_handler_wpe.h │ │ ├── work_order_enclave_wpe.cpp │ │ ├── work_order_preprocessed_keys_wpe.cpp │ │ ├── work_order_preprocessed_keys_wpe.h │ │ ├── work_order_processor_wpe.cpp │ │ ├── work_order_processor_wpe.h │ │ └── wpe_enclave.edl │ ├── enclave_untrusted │ ├── enclave_bridge │ │ ├── CMakeLists.txt │ │ ├── attestation.cpp │ │ ├── attestation.h │ │ ├── base.cpp │ │ ├── base.h │ │ ├── dcap │ │ │ ├── dcap_attestation.cpp │ │ │ └── dcap_attestation.h │ │ ├── enclave.cpp │ │ ├── enclave.h │ │ ├── enclave_common_u.h │ │ ├── enclave_queue.cpp │ │ ├── enclave_queue.h │ │ ├── epid │ │ │ ├── epid_attestation.cpp │ │ │ └── epid_attestation.h │ │ ├── file_io_handler.cpp │ │ ├── file_io_handler.h │ │ ├── file_io_processor.cpp │ │ ├── file_io_processor.h │ │ ├── io_handler.cpp │ │ ├── io_handler.h │ │ ├── io_handler_if.h │ │ ├── kme │ │ │ ├── CMakeLists.txt │ │ │ ├── signup_kme.cpp │ │ │ └── signup_kme.h │ │ ├── log.cpp │ │ ├── log.h │ │ ├── ocall.cpp │ │ ├── sgx_utility.cpp │ │ ├── sgx_utility.h │ │ ├── signup.cpp │ │ ├── signup.h │ │ ├── singleton │ │ │ ├── CMakeLists.txt │ │ │ ├── signup_singleton.cpp │ │ │ └── signup_singleton.h │ │ ├── work_order.cpp │ │ ├── work_order.h │ │ └── wpe │ │ │ ├── CMakeLists.txt │ │ │ ├── signup_wpe.cpp │ │ │ └── signup_wpe.h │ └── enclave_bridge_wrapper │ │ ├── base_enclave_info.cpp │ │ ├── base_enclave_info.h │ │ ├── dcap_enclave_info.cpp │ │ ├── dcap_enclave_info.h │ │ ├── epid_enclave_info.cpp │ │ ├── epid_enclave_info.h │ │ ├── kme │ │ ├── signup_info_kme.cpp │ │ └── signup_info_kme.h │ │ ├── signup_info.cpp │ │ ├── signup_info.h │ │ ├── singleton │ │ ├── signup_info_singleton.cpp │ │ └── signup_info_singleton.h │ │ ├── swig_utils.cpp │ │ ├── swig_utils.h │ │ ├── tcf_enclave.h │ │ ├── work_order_wrap.cpp │ │ ├── work_order_wrap.h │ │ └── wpe │ │ ├── signup_info_wpe.cpp │ │ └── signup_info_wpe.h │ └── tests │ ├── CMakeLists.txt │ ├── testCrypto.cpp │ ├── testCrypto.h │ ├── test_cryptoWrapper.py │ ├── trusted │ ├── app │ │ ├── TestApp.cpp │ │ └── TestApp.h │ └── enclave │ │ ├── CMakeLists.txt │ │ ├── TestEnclave.config.xml │ │ ├── TestEnclave.cpp │ │ ├── TestEnclave.edl │ │ ├── TestEnclave.h │ │ ├── TestEnclave.lds │ │ └── TestEnclave_private.pem │ └── untrusted │ └── TestUntrusted.cpp ├── tests ├── Demo.py ├── __init__.py ├── json_requests │ ├── json_01.json │ ├── json_02.json │ ├── json_03.json │ ├── json_04.json │ ├── json_05.json │ ├── json_06.json │ ├── json_07.json │ ├── json_08.json │ ├── json_09.json │ ├── json_10.json │ ├── json_11.json │ ├── json_12.json │ └── json_13.json ├── signature │ ├── wo_request_01.json │ ├── wo_request_02.json │ ├── wo_request_03.json │ ├── wo_request_04.json │ └── wo_request_05.json ├── test_encrypted_data_encryption.py ├── test_encryption.py ├── test_ias_attestation.py ├── test_utility │ ├── test_file_utils │ │ ├── path_test_file │ │ ├── sample1.json │ │ ├── sample2.json │ │ ├── sample3.json │ │ └── test.py │ ├── test_hex_utils.py │ └── test_utility.py ├── work_orders │ ├── 01_worker_lookup.json │ ├── 01a_worker_retrieve.json │ ├── 02_work_order_encryptionkey_get.json │ ├── 03_work_order_encryptionkey_set.json │ ├── 04_work_order_submit.json │ └── 05_work_order_get_result.json ├── worker │ ├── worker_01.json │ ├── worker_01a.json │ ├── worker_02.json │ ├── worker_03.json │ ├── worker_04.json │ └── worker_05.json └── workorder_receipt │ ├── workorderreceipt_01.json │ ├── workorderreceipt_02.json │ ├── workorderreceipt_02a.json │ ├── workorderreceipt_02b.json │ ├── workorderreceipt_03.json │ ├── workorderreceipt_04.json │ ├── workorderreceipt_05.json │ ├── workorderreceipt_07.json │ └── workorderreceipt_08.json └── tools ├── build └── Makefile ├── clean.sh ├── rebuild.sh ├── run_proxy_model_tests.sh └── run_tests.sh /.dockerignore: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | #Ignore Kv files 16 | config/Kv* 17 | 18 | #Ignore documentation files 19 | *.md 20 | docs/* 21 | CODEOWNERS 22 | # Fabric certificates folder 23 | vars/* 24 | -------------------------------------------------------------------------------- /.env: -------------------------------------------------------------------------------- 1 | CLEAN_SEALED_DATA=1 2 | DISTRO=bionic 3 | IMAGE=ubuntu:bionic 4 | # Provide DCAP PCCS api key by subscribing in 5 | # the portal https://api.portal.trustedservices.intel.com/ 6 | API_KEY=00aaaabbbbccccddddccccbbbbaaaa00 7 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Explicitly declare text files you want to always be normalized and converted 16 | # to native line endings on checkout. 17 | Makefile text eol=lf 18 | Dockerfile text eol=lf 19 | *.c text eol=lf 20 | *.cpp text eol=lf 21 | *.csh text eol=lf 22 | *.h text eol=lf 23 | *.json text eol=lf 24 | *.md text eol=lf 25 | *.rst text eol=lf 26 | *.pem text eol=lf 27 | *.py text eol=lf 28 | *.sh text eol=lf 29 | *.toml text eol=lf 30 | *.txt text eol=lf 31 | -------------------------------------------------------------------------------- /.github/settings.yml: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | 5 | repository: 6 | name: avalon 7 | description: Hyperledger Avalon enables privacy in blockchain transactions, 8 | moving intensive processing from a main blockchain to improve 9 | scalability and latency, and to support attested Oracles 10 | homepage: https://wiki.hyperledger.org/display/avalon/Hyperledger+Avalon 11 | default_branch: main 12 | has_downloads: true 13 | has_issues: true 14 | has_projects: true 15 | has_wiki: false 16 | archived: true 17 | private: false 18 | allow_squash_merge: true 19 | allow_merge_commit: false 20 | allow_rebase_merge: true 21 | -------------------------------------------------------------------------------- /.pycodestyle: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # ------------------------------------------------------------------------------ 15 | 16 | [pycodestyle] 17 | exclude=build,docs,*_pb2.py 18 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @manju956 @dcmiddle @danintel @Karthikamurthy @manojgop @SriharshaSubbakrishna @pankajgoyal2 @rranjan3 @ram-srini @TomBarnes @EugeneYYY 2 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | Code of Conduct Guidelines 7 | ========================== 8 | 9 | Please review the Hyperledger 10 | [Code of 11 | Conduct](https://wiki.hyperledger.org/display/HYP/Hyperledger+Code+of+Conduct) 12 | before participating. 13 | 14 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 5 | # Contributing to Hyperledger Avalon 6 | 7 | Avalon software is [Apache 2.0 licensed](LICENSE) and accepts contributions via 8 | git pull requests. Each commit must include a DCO line in the git commit message: 9 | 10 | `Signed-off-by: GitHub User Name ` 11 | 12 | This sign-off means you agree the commit satisfies the 13 | [Developer Certificate of Origin (DCO).](https://developercertificate.org/) 14 | 15 | For other ways to contribute, see 16 | [Get involved: How to Contribute to Hyperledger](https://www.hyperledger.org/blog/2018/07/11/get-involved-how-to-contribute-to-hyperledger) 17 | and our 18 | [community links](https://github.com/hyperledger/avalon/tree/master/docs#community). 19 | 20 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 0.5.0 2 | -------------------------------------------------------------------------------- /blockchain_connector/common/connector_common/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __all__ = [] 16 | -------------------------------------------------------------------------------- /blockchain_connector/ethereum/ethereum_connector/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __all__ = [] 16 | -------------------------------------------------------------------------------- /blockchain_connector/fabric/fabric_connector/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __all__ = [] 16 | -------------------------------------------------------------------------------- /common/README.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | Purpose of Common Hyperledger Avalon Code 7 | ============================================= 8 | 9 | The common directory contains source code shared by untrusted and trusted 10 | (Intel SGX Enclave) Hyperledger Avalon code. 11 | 12 | Source Directories 13 | ------------------ 14 | 15 | * `cpp/`
16 | C++ common code 17 | * `crypto_utils/`
18 | Python common crypto code 19 | * `python/`
20 | Python common code 21 | * `sgx_workload/`
22 | C++ Intel SGX common code 23 | -------------------------------------------------------------------------------- /common/cpp/BUILD.md: -------------------------------------------------------------------------------- 1 | 5 | # Building the common libraries 6 | 7 | Make sure you have environment variables `SGX_SDK` and `SGX_SSL` defined 8 | (see [BUILD.md](../../../BUILD.md)) and then run 9 | ``` 10 | mkdir build 11 | cd build 12 | cmake .. -G "Unix Makefiles" && make 13 | ``` 14 | -------------------------------------------------------------------------------- /common/cpp/crypto/verify_certificate.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2018 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | /** 17 | * @file 18 | * Avalon CA certification verification. 19 | */ 20 | 21 | /** Verifies certificate against CA certificate. */ 22 | bool verify_certificate_chain(const char* cert_pem, 23 | const char* ca_cert_pem); 24 | -------------------------------------------------------------------------------- /common/cpp/crypto/verify_signature.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2018 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | /** 17 | * @file 18 | * Avalon signature verification. 19 | */ 20 | 21 | 22 | /** 23 | * Verifies signature of the message by extracting public key from certificate. 24 | */ 25 | bool verify_signature(const char* cert_pem, 26 | const char* msg, 27 | unsigned int msg_len, 28 | const char* signature, 29 | unsigned int signature_len); 30 | -------------------------------------------------------------------------------- /common/cpp/packages/base64/base64.h: -------------------------------------------------------------------------------- 1 | // 2 | // base64 encoding and decoding with C++. 3 | // Version: 1.01.00 4 | // Copyright (C) 2004-2017 René Nyffenegger 5 | // Copyright 2020 Intel Corporation 6 | // 7 | 8 | /** 9 | * @file 10 | * Base64 encode and decode functions. 11 | * Used to encode/decode between binary data into a printable character format. 12 | */ 13 | 14 | /* 15 | * The original source code has been modified to be used with 16 | * Hyperledger Avalon. Added function base64_decoded_length(). 17 | */ 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | std::string base64_encode( 25 | const std::vector& raw_buffer); 26 | 27 | std::vector base64_decode( 28 | const std::string& encoded_string); 29 | 30 | unsigned int base64_decoded_length(const char *encoded_string, 31 | unsigned int encoded_len); 32 | -------------------------------------------------------------------------------- /common/cpp/utils.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | /** 17 | * @file 18 | * Avalon ByteArray and String conversion utilities. 19 | */ 20 | 21 | #pragma once 22 | 23 | #include 24 | 25 | #include "types.h" 26 | 27 | ByteArray StrToByteArray(std::string str); 28 | 29 | std::string ByteArrayToStr(ByteArray ba); 30 | 31 | -------------------------------------------------------------------------------- /common/cpp/verify_dcap_report/dcap_attestation_util.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #include 17 | 18 | // Verifies signature of the message by extracting public key from certificate 19 | bool verify_dcap_quote_signature( 20 | const std::string& dcap_attestation_signing_cert_pem, 21 | const std::string& dcap_quote, const std::string& dcap_signature); 22 | 23 | // Verifies certificate against IAS CA certificate 24 | bool verify_dcap_quote(const std::string& dcap_quote); 25 | -------------------------------------------------------------------------------- /common/cpp/verify_ias_report/ias-certificates.template: -------------------------------------------------------------------------------- 1 | /* Copyright 2018 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | extern const char ias_report_signing_ca_cert_pem[] = 20 | #ifdef IAS_CA_CERT_REQUIRED 21 | R"MLT(IAS_REPORT_SIGNING_CA_CERT_PEM_PLACEMARK 22 | )MLT" 23 | #else 24 | "NO SUCH CA CERTIFICATE" 25 | #endif 26 | ; 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | -------------------------------------------------------------------------------- /common/crypto_utils/avalon_crypto_utils/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /common/crypto_utils/tests/wo_receipt_request.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkOrderReceiptCreate", 4 | "id": 30, 5 | "params": { 6 | "workOrderId": "", 7 | "workerServiceId": "50", 8 | "workerId": "", 9 | "requesterId": "", 10 | "receiptCreateStatus":0, 11 | "workOrderRequestHash": "", 12 | "requesterGeneratedNonce": "", 13 | "requesterSignature": "", 14 | "signatureRules": "SHA-256/RSA-OAEP-4096", 15 | "receiptVerificationKey":"" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /common/crypto_utils/tests/wo_receipt_update_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "id":30, 4 | "result": { 5 | "workOrderId": "", 6 | "updaterId": "", 7 | "updateType": 1, 8 | "updateData": "", 9 | "updateSignature": "", 10 | "signatureRules": "SHA-256/RSA-OAEP-4096", 11 | "receiptVerificationKey": "" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /common/crypto_utils/tests/wo_request.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkOrderSubmit", 4 | "id": 30, 5 | "params": { 6 | "workOrderId": "", 7 | "responseTimeoutMSecs": 6000, 8 | "payloadFormat": "JSON-RPC", 9 | "resultUri": " ", 10 | "notifyUri": " ", 11 | "workerId": "", 12 | "workloadId": "626f6d5f696f", 13 | "requesterId": "", 14 | "workerEncryptionKey": "", 15 | "dataEncryptionAlgorithm": "AES-GCM-256", 16 | "encryptedSessionKey": "", 17 | "sessionKeyIv": "", 18 | "requesterNonce": "", 19 | "encryptedRequestHash": "", 20 | "requesterSignature": "", 21 | "inData": [ 22 | { 23 | "index": 0, 24 | "dataHash": "", 25 | "data": "Hyperledger Avalon", 26 | "encryptedDataEncryptionKey": "", 27 | "iv": "" 28 | } 29 | ] 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /common/crypto_utils/tests/wo_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "id":30, 4 | "result": { 5 | "workOrderId":"", 6 | "workloadId": "", 7 | "workerId": "", 8 | "requesterId": "", 9 | "workerNonce": "", 10 | "workerSignature": "", 11 | "outData": [ 12 | { 13 | "index": 0, 14 | "dataHash": "", 15 | "data": "Hyperledger Avalon", 16 | "encryptedDataEncryptionKey": "-", 17 | "iv": "" 18 | } 19 | ] 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /common/crypto_utils_openssl/avalon_crypto_utils/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /common/crypto_utils_openssl/avalon_crypto_utils/crypto/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /common/python/README.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | Purpose of Common Python Hyperledger Avalon Code 7 | ============================================= 8 | 9 | The common/python directory contains common functionalities used by 10 | Hyperledger Avalon components. 11 | 12 | Source Directories 13 | ------------------ 14 | 15 | * `./`
16 | Makefile and Python package module setup 17 | * `config/`
18 | Parses Avalon .toml configuration files 19 | * `database/`
20 | Connector code to a local or remote LMDB database 21 | * `error_code/`
22 | Avalon error code constants 23 | * `listener/`
24 | Avalon JRPC listener 25 | * `utility/`
26 | Avalon Utilities 27 | (hex conversion, JSON file I/O, JRPC error response, logger) 28 | -------------------------------------------------------------------------------- /common/python/config/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /common/python/database/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __all__ = [] 16 | -------------------------------------------------------------------------------- /common/python/error_code/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /common/python/http_client/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | all = [ 16 | 'generic' 17 | ] 18 | -------------------------------------------------------------------------------- /common/python/listener/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __all__ = [] 16 | -------------------------------------------------------------------------------- /common/python/schema_validation/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /common/python/schema_validation/data/WorkOrderGetResult.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "object", 3 | "uniqueItems": true, 4 | "additionalProperties": false, 5 | "properties": { 6 | "workOrderId": { 7 | "type": "string", 8 | "pattern": "^(0[x|X])?[0-9a-fA-F]+$", 9 | "error_msg": 10 | "Invalid work order Id" 11 | } 12 | }, 13 | "required": ["workOrderId"] 14 | } 15 | -------------------------------------------------------------------------------- /common/python/schema_validation/data/WorkOrderReceiptLookUp.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "object", 3 | "uniqueItems": true, 4 | "additionalProperties": false, 5 | "properties": { 6 | "workerServiceId": { 7 | "type": "string", 8 | "pattern": "^(0[x|X])?[0-9a-fA-F]+$", 9 | "error_msg": 10 | "Invalid data format for workerServiceId"}, 11 | "workerId": { 12 | "type": "string", 13 | "pattern": "^(0[x|X])?[0-9a-fA-F]+$", 14 | "error_msg": 15 | "Invalid data format for workerId"}, 16 | "requesterId": { 17 | "type": "string", 18 | "pattern": "^(0[x|X])?[0-9a-fA-F]+$", 19 | "error_msg": 20 | "Invalid data format for requesterId"}, 21 | "receiptStatus": { 22 | "type": "string", 23 | "pattern": "^(0[x|X])?[0-9a-fA-F]+$", 24 | "error_msg": 25 | "Invalid data format for receiptStatus"} 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /common/python/schema_validation/data/WorkOrderReceiptRetrieve.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "object", 3 | "uniqueItems": true, 4 | "additionalProperties": false, 5 | "properties": { 6 | "workOrderId": { 7 | "type": "string", 8 | "pattern": "^(0[x|X])?[0-9a-fA-F]+$", 9 | "error_msg": 10 | "Invalid data format for workOrderId" 11 | } 12 | }, 13 | "required": ["workOrderId"] 14 | } 15 | -------------------------------------------------------------------------------- /common/python/schema_validation/data/WorkOrderReceiptUpdateRetrieve.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "object", 3 | "uniqueItems": true, 4 | "additionalProperties": false, 5 | "properties": { 6 | "workOrderId": { 7 | "type": "string", 8 | "pattern": "^(0[x|X])?[0-9a-fA-F]+$", 9 | "error_msg": 10 | "Invalid data format for workOrderId"}, 11 | "updaterId": { 12 | "type": "string", 13 | "pattern": "^(0[x|X])?[0-9a-fA-F]+$", 14 | "error_msg": 15 | "Invalid data format for updaterId"}, 16 | "updateIndex": { 17 | "type": "integer", 18 | "error_msg": 19 | "Invalid data format for updateIndex"} 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /common/python/schema_validation/data/WorkerLookUp.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "object", 3 | "uniqueItems": true, 4 | "additionalProperties": false, 5 | "properties": { 6 | "workerType": { 7 | "type": "integer", 8 | "enum": [1, 2, 3], 9 | "error_msg": 10 | "WorkType should be an Integer of range 1-3"}, 11 | "organizationId": { 12 | "type": "string", 13 | "pattern": "^(0[x|X])?[0-9a-fA-F]+$", 14 | "error_msg": 15 | "Invalid data format for organizationId"}, 16 | "applicationTypeId": { 17 | "type": "string", 18 | "pattern": "^(0[x|X])?[0-9a-fA-F]+$", 19 | "error_msg": 20 | "Invalid data format for applicationTypeId"} 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /common/python/schema_validation/data/WorkerLookUpNext.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "object", 3 | "uniqueItems": true, 4 | "additionalProperties": false, 5 | "properties": { 6 | "workerType": { 7 | "type": "integer", 8 | "enum": [1, 2, 3], 9 | "error_msg": 10 | "WorkType should be an Integer of range 1-3"}, 11 | "organizationId": { 12 | "type": "string", 13 | "pattern": "^(0[x|X])?[0-9a-fA-F]+$", 14 | "error_msg": 15 | "Invalid data format for organizationId"}, 16 | "applicationTypeId": { 17 | "type": "string", 18 | "pattern": "^(0[x|X])?[0-9a-fA-F]+$", 19 | "error_msg": 20 | "Invalid data format for applicationTypeId"}, 21 | "lookUpTag": { 22 | "type": "string", 23 | "error_msg": 24 | "Invalid data format for lookUpTag"} 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /common/python/schema_validation/data/WorkerRetrieve.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "object", 3 | "uniqueItems": true, 4 | "additionalProperties": false, 5 | "properties": { 6 | "workerId": { 7 | "type": "string", 8 | "pattern": "^(0[x|X])?[0-9a-fA-F]+$", 9 | "error_msg": 10 | "Invalid data format for Worker id" 11 | } 12 | }, 13 | "required": ["workerId"] 14 | } 15 | -------------------------------------------------------------------------------- /common/python/utility/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /common/sgx_workload/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | CMAKE_MINIMUM_REQUIRED(VERSION 3.2 FATAL_ERROR) 16 | 17 | INCLUDE(CMakeVariables.txt) 18 | SET(GENERIC_PRIVATE_INCLUDE_DIRS "." "${TCF_TOP_DIR}/common/cpp") 19 | 20 | ################################################################################ 21 | ADD_SUBDIRECTORY(workload) 22 | ADD_SUBDIRECTORY(iohandler) 23 | 24 | -------------------------------------------------------------------------------- /common/sgx_workload/workload/work_order_data.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2018 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #include "work_order_data.h" 17 | 18 | namespace tcf { 19 | WorkOrderData::WorkOrderData() { 20 | index = 0; 21 | decrypted_data = {}; 22 | } 23 | 24 | WorkOrderData::WorkOrderData(int in_index, ByteArray data) { 25 | index = in_index; 26 | decrypted_data = data; 27 | } 28 | } // namespace tcf 29 | -------------------------------------------------------------------------------- /common/verify_report_utils/dcap/verify_dcap_quote/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | all = [] 16 | -------------------------------------------------------------------------------- /common/verify_report_utils/ias/verify_report/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /coverage/coverage_gen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | lines=$(ps -ef | grep /usr/local/bin/coverage | wc -l) 4 | echo $lines 5 | 6 | # To generate .coverage file, SIGINT signal needs to send to services 7 | # processes running inside avalon containers. 8 | while [ $lines -ne 1 ] 9 | do 10 | PID=$(ps -ef | grep /usr/local/bin/coverage | awk 'NR==1{print $2}') 11 | echo $PID 12 | $(kill -s SIGINT $PID) 13 | lines=$(ps -ef | grep /usr/local/bin/coverage | wc -l) 14 | done 15 | -------------------------------------------------------------------------------- /docker-compose-sgx.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | version: '3.5' 16 | 17 | services: 18 | avalon-enclave-manager: 19 | image: avalon-sgx-enclave-manager-dev 20 | build: 21 | args: 22 | - SGX_MODE=HW 23 | volumes: 24 | # Map aesm service on host to docker, required only in HW mode. 25 | - /var/run/aesmd/aesm.socket:/var/run/aesmd/aesm.socket 26 | devices: 27 | - "/dev/isgx:/dev/isgx" 28 | 29 | -------------------------------------------------------------------------------- /docker/compose/avalon-fib-gsgx.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | version: '3.5' 16 | 17 | services: 18 | graphene-python-workload: 19 | image: gsc-avalon-fibonacci-workload-dev 20 | devices: 21 | - "/dev/gsgx:/dev/gsgx" 22 | - "/dev/isgx:/dev/isgx" 23 | volumes: 24 | - /var/run/aesmd/aesm.socket:/var/run/aesmd/aesm.socket 25 | -------------------------------------------------------------------------------- /docker/compose/avalon-wpe-fib-graphene.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | version: '3.5' 16 | 17 | services: 18 | avalon-enclave-manager: 19 | image: avalon-wpe-enclave-manager-graphene-dev 20 | build: 21 | args: 22 | - ENCLAVE_TYPE=graphene_wpe 23 | 24 | graphene-python-workload: 25 | image: avalon-wpe-fibonacci-workload-dev 26 | 27 | -------------------------------------------------------------------------------- /docker/compose/avalon-wpe-fib-gsgx.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | version: '3.5' 16 | 17 | services: 18 | graphene-python-workload: 19 | image: gsc-avalon-wpe-fibonacci-workload-dev 20 | devices: 21 | - "/dev/gsgx:/dev/gsgx" 22 | - "/dev/isgx:/dev/isgx" 23 | volumes: 24 | - /var/run/aesmd/aesm.socket:/var/run/aesmd/aesm.socket 25 | 26 | -------------------------------------------------------------------------------- /docker/k8s/enclave-manager-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: avalon-enclave-manager 5 | spec: 6 | replicas: 1 7 | selector: 8 | matchLabels: 9 | app: enclave-manager 10 | template: 11 | metadata: 12 | name: enclave-manager 13 | labels: 14 | app: enclave-manager 15 | spec: 16 | containers: 17 | - image: avalon-enclave-manager-dev:latest 18 | name: enclave-manager 19 | imagePullPolicy: Never 20 | command: ["/bin/bash"] 21 | args: ["-c", "enclave_manager --lmdb_url http://avalon-lmdb:9090"] 22 | -------------------------------------------------------------------------------- /docker/k8s/fabric/shell.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: avalon-shell 5 | spec: 6 | replicas: 1 7 | selector: 8 | matchLabels: 9 | app: avalon-shell 10 | template: 11 | metadata: 12 | name: avalon-shell 13 | labels: 14 | app: avalon-shell 15 | spec: 16 | containers: 17 | - image: avalon-shell-dev:latest 18 | name: avalon-shell 19 | imagePullPolicy: Never 20 | command: ["/bin/bash"] 21 | args: ["-c", "cp -rf /mywork/vars/keyfiles /keyfiles \ 22 | && cp /mywork/vars/profiles/mychannel_network_for_pysdk.json \ 23 | /project/avalon/sdk/avalon_sdk/connector/blockchains/fabric/network.json \ 24 | && tail -f /dev/null"] 25 | volumeMounts: 26 | - name: fabric-files 27 | mountPath: /mywork/vars 28 | volumes: 29 | - name: fabric-files 30 | hostPath: 31 | path: /home/ubuntu/mywork/vars 32 | -------------------------------------------------------------------------------- /docker/k8s/listener.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: avalon-http-jrpc-listener 5 | spec: 6 | replicas: 1 7 | selector: 8 | matchLabels: 9 | app: avalon-listener 10 | template: 11 | metadata: 12 | name: avalon-listener 13 | labels: 14 | app: avalon-listener 15 | spec: 16 | containers: 17 | - image: hyperledger/avalon-listener:0.6 18 | name: avalon-listener 19 | imagePullPolicy: Always 20 | command: ["/bin/bash"] 21 | args: ["-c", "avalon_listener --bind http://0.0.0.0:1947 --lmdb_url http://avalon-lmdb:9090"] 22 | --- 23 | apiVersion: v1 24 | kind: Service 25 | metadata: 26 | name: avalon-listener 27 | spec: 28 | ports: 29 | - name: "1947" 30 | port: 1947 31 | targetPort: 1947 32 | - name: "5555" 33 | protocol: TCP 34 | port: 5555 35 | targetPort: 5555 36 | selector: 37 | app: avalon-listener 38 | -------------------------------------------------------------------------------- /docker/k8s/lmdb.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: database 5 | spec: 6 | replicas: 1 7 | selector: 8 | matchLabels: 9 | app: avalon-lmdb 10 | template: 11 | metadata: 12 | name: avalon-lmdb 13 | labels: 14 | app: avalon-lmdb 15 | spec: 16 | containers: 17 | - image: hyperledger/avalon-lmdb:0.6 18 | name: lmdb-server 19 | imagePullPolicy: Always 20 | command: ["/bin/bash"] 21 | args: ["-c", "kv_storage --bind http://0.0.0.0:9090"] 22 | ports: 23 | - containerPort: 9090 24 | protocol: TCP 25 | volumeMounts: 26 | - name: db 27 | mountPath: /lmdb 28 | volumes: 29 | - name: db 30 | emptyDir: {} 31 | --- 32 | apiVersion: v1 33 | kind: Service 34 | metadata: 35 | name: avalon-lmdb 36 | spec: 37 | ports: 38 | - port: 9090 39 | targetPort: 9090 40 | selector: 41 | app: avalon-lmdb 42 | -------------------------------------------------------------------------------- /docker/k8s/persistent-volume-claim.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: nfsname 5 | spec: 6 | accessModes: 7 | - ReadWriteMany 8 | storageClassName: "" 9 | resources: 10 | requests: 11 | storage: 100Mi 12 | selector: 13 | matchLabels: 14 | type: nfs 15 | -------------------------------------------------------------------------------- /docker/k8s/persistent-volume.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolume 3 | metadata: 4 | name: nfsname 5 | labels: 6 | type: nfs 7 | spec: 8 | capacity: 9 | storage: 100Mi 10 | accessModes: 11 | - ReadWriteMany 12 | nfs: 13 | server: 10.1.0.7 # nfs-server IP 14 | path: /export 15 | -------------------------------------------------------------------------------- /docker/k8s/propose-requests-job.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: batch/v1 2 | kind: Job 3 | metadata: 4 | name: propose-request 5 | spec: 6 | template: 7 | metadata: 8 | labels: 9 | app: request 10 | spec: 11 | restartPolicy: OnFailure 12 | containers: 13 | - name: request-proposer 14 | image: avalon-shell-dev:latest 15 | imagePullPolicy: Never 16 | command: ["/bin/bash"] 17 | args: ["/project/avalon/docker/k8s/propose_requests.sh"] 18 | -------------------------------------------------------------------------------- /docker/k8s/propose_requests.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # Copyright 2019 Intel Corporation 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | ClientDir=/project/avalon/examples/apps/generic_client 18 | 19 | python3 ${ClientDir}/generic_client.py --uri "http://avalon-listener:${1:-1947}" \ 20 | --workload_id "heart-disease-eval" \ 21 | --in_data "Data: 25 10 1 67 102 125 1 95 5 10 1 11 36 1" -o 22 | 23 | -------------------------------------------------------------------------------- /docker/k8s/shell.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: avalon-shell 5 | spec: 6 | replicas: 1 7 | selector: 8 | matchLabels: 9 | app: avalon-shell 10 | template: 11 | metadata: 12 | name: avalon-shell 13 | labels: 14 | app: avalon-shell 15 | spec: 16 | containers: 17 | - image: hyperledger/avalon-shell:0.6 18 | name: avalon-shell 19 | imagePullPolicy: Always 20 | command: ["/bin/bash"] 21 | args: ["-c", "tail -f /dev/null"] 22 | -------------------------------------------------------------------------------- /docker/k8s/tcf-config-map.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: tcf-config 5 | data: 6 | HOME: /project/TrustedComputeFramework 7 | TCS_LISTENER_PORT: "8080" 8 | -------------------------------------------------------------------------------- /docker/lb/Dockerfile.haproxy: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # ------------------------------------------------------------------------------ 15 | 16 | FROM ubuntu:bionic 17 | 18 | RUN apt update \ 19 | && apt install -y -q \ 20 | haproxy 21 | 22 | COPY haproxy.cfg . 23 | 24 | # Append front and back end load balancer configurations to existing 25 | # file in /etc/haproxy/haproxy.cfg 26 | RUN echo "$(cat haproxy.cfg)" >> /etc/haproxy/haproxy.cfg 27 | -------------------------------------------------------------------------------- /docker/lb/Dockerfile.nginx: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # ------------------------------------------------------------------------------ 15 | 16 | FROM ubuntu:bionic 17 | 18 | RUN apt update \ 19 | && apt install -y -q \ 20 | nginx 21 | 22 | RUN rm /etc/nginx/sites-available/default 23 | 24 | COPY nginx.conf /etc/nginx/sites-available/default 25 | -------------------------------------------------------------------------------- /docker/lb/haproxy.cfg: -------------------------------------------------------------------------------- 1 | frontend http_front 2 | bind *:9947 3 | default_backend http_back 4 | 5 | backend http_back 6 | balance roundrobin 7 | server node0 avalon-listener:1947 8 | server node1 avalon-listener-1:1947 9 | server node2 avalon-listener-2:1947 10 | server node3 avalon-listener-3:1947 11 | -------------------------------------------------------------------------------- /docker/lb/nginx.conf: -------------------------------------------------------------------------------- 1 | upstream backend { 2 | server avalon-listener:1947; 3 | server avalon-listener-1:1947; 4 | server avalon-listener-2:1947; 5 | server avalon-listener-3:1947; 6 | } 7 | 8 | server { 9 | listen 9947; 10 | 11 | location / { 12 | proxy_pass http://backend; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /docker/pccs/sgx_default_qcnl.conf: -------------------------------------------------------------------------------- 1 | # PCCS server address 2 | PCCS_URL=https://avalon-pccs:8081/sgx/certification/v3/ 3 | # To accept insecure HTTPS cert, set this option to FALSE 4 | USE_SECURE_CERT=FALSE 5 | -------------------------------------------------------------------------------- /docs/avalon-arch.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/avalon/5ef6038df458686a7624aa7b4f8890ed6ed1c61e/docs/avalon-arch.pdf -------------------------------------------------------------------------------- /docs/dev-environments/ethereum/besu/besu/node1/key: -------------------------------------------------------------------------------- 1 | 0xcdacd24910d139c06324524ec65dc3e891dad5597c9abf446dc787a685670448 2 | -------------------------------------------------------------------------------- /docs/dev-environments/ethereum/besu/besu/node1/static-nodes.json: -------------------------------------------------------------------------------- 1 | [ 2 | "enode://447168500d298c3ab2cca7af9ba2b3bddc9b3cc3a21ec7b3e86d96aabc6d1129ba9e2aed09b1a75a4aefff6c4f0ecf9222eefd6f4db7eb89402c4c480187052a@172.13.0.2:30303", 3 | "enode://0b0b5206c1208c3455d30b20f54455b188359782e227503b7dc75c389a38751bd97a5cd043e4710709fdf6aef131c7f7feb424fcda524c9fbc668e7286166cfe@172.13.0.3:30303" 4 | ] 5 | -------------------------------------------------------------------------------- /docs/dev-environments/ethereum/besu/besu/node2/key: -------------------------------------------------------------------------------- 1 | 0xdd2c47c04cc938547ad1e494cbcf78ef416dfe536ca3bd6c5a82ae88bf7955de 2 | -------------------------------------------------------------------------------- /docs/dev-environments/ethereum/besu/besu/node2/static-nodes.json: -------------------------------------------------------------------------------- 1 | [ 2 | "enode://447168500d298c3ab2cca7af9ba2b3bddc9b3cc3a21ec7b3e86d96aabc6d1129ba9e2aed09b1a75a4aefff6c4f0ecf9222eefd6f4db7eb89402c4c480187052a@172.13.0.2:30303", 3 | "enode://0b0b5206c1208c3455d30b20f54455b188359782e227503b7dc75c389a38751bd97a5cd043e4710709fdf6aef131c7f7feb424fcda524c9fbc668e7286166cfe@172.13.0.3:30303" 4 | ] 5 | -------------------------------------------------------------------------------- /docs/dev-environments/ethereum/besu/ethsigner/node1/keystore/account.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "id": "d02dd907-0631-405a-b98a-e41d0cfdd8da", 4 | "address": "7085d4d4c6efea785edfba5880bb62574e115626", 5 | "crypto": { 6 | "ciphertext": "439ee0219318a861fa99d5282e32aec9c15defda5ef7e54265dcfea62e2f2fa6", 7 | "cipherparams": { 8 | "iv": "c3d7102ce530d5540a8c0ce69f083e65" 9 | }, 10 | "cipher": "aes-128-ctr", 11 | "kdf": "scrypt", 12 | "kdfparams": { 13 | "dklen": 32, 14 | "salt": "e4efd6a1aea4fc3334c3a0548b7d4c031f9eefaa95108a84f31a8f3121e356a5", 15 | "n": 8192, 16 | "r": 8, 17 | "p": 1 18 | }, 19 | "mac": "d6ef684cc09cfd595ddcc16404b50e7357ba94c6b0e54324fcefe97c5a4e6aba" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /docs/dev-environments/ethereum/besu/ethsigner/node1/password.txt: -------------------------------------------------------------------------------- 1 | 1a2912c3b57562bd -------------------------------------------------------------------------------- /docs/dev-environments/ethereum/besu/ethsigner/node2/keystore/account.txt: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "id": "52c06d6d-ad51-491a-90b3-cc0b4a3f20b8", 4 | "address": "b36b1934004385bfa5c51eaecb8ec348ec733ca8", 5 | "crypto": { 6 | "ciphertext": "ceb2c3c7219b9725141ee699c3822fab04572673880f4370918d6caea7214986", 7 | "cipherparams": { 8 | "iv": "1dbe867960414e60bf5a4cf1f2a4ef93" 9 | }, 10 | "cipher": "aes-128-ctr", 11 | "kdf": "scrypt", 12 | "kdfparams": { 13 | "dklen": 32, 14 | "salt": "7400639cb9545dee7b3f64b61fb1f36d536efb5d7f9b81aa67ad7a8d6963cff6", 15 | "n": 8192, 16 | "r": 8, 17 | "p": 1 18 | }, 19 | "mac": "2082c7a8667bfa7cc890f789d096b5dbfd59d163495a9d7d8a1effc600f3c31a" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /docs/dev-environments/ethereum/besu/ethsigner/node2/password.txt: -------------------------------------------------------------------------------- 1 | a7a21df7ae910e73 -------------------------------------------------------------------------------- /docs/dev-environments/fabric/getandinstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright IBM Corp All Rights Reserved 4 | # 5 | # SPDX-License-Identifier: Apache-2.0 6 | # 7 | 8 | # This script extracts Avalon Fabric chaincode from Avalon github repository. 9 | git init avalon && cd avalon 10 | git remote add origin https://github.com/hyperledger/avalon 11 | git config core.sparsecheckout true 12 | echo "sdk/avalon_sdk/connector/blockchains/fabric/chaincode" >> .git/info/sparse-checkout 13 | git pull --depth=1 origin master 14 | sudo cp -r sdk/avalon_sdk/connector/blockchains/fabric/chaincode ../vars 15 | cd .. && rm -rf avalon 16 | ./minifab install,approve,instantiate -n worker 17 | ./minifab install,approve,instantiate -n order 18 | ./minifab install,approve,instantiate -n receipt 19 | ./minifab install,approve,instantiate -n registry 20 | -------------------------------------------------------------------------------- /docs/graphene-workload-tutorial/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # ------------------------------------------------------------------------------ 15 | 16 | FROM python:3 17 | 18 | WORKDIR /project/graphene-workload-tutorial 19 | 20 | RUN pip install jinja2 21 | 22 | CMD [ "python" ] 23 | -------------------------------------------------------------------------------- /docs/graphene-workload-tutorial/workload/Dockerfile.template: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | FROM avalon-python-worker-dev 16 | 17 | COPY . /home/python_workloads/{{ my_workload }} 18 | 19 | WORKDIR /home/python_workloads/{{ my_workload }} 20 | 21 | # Build {{ my_workload }} python workload module and install 22 | RUN make && make install 23 | 24 | # Pass python file as docker command line argument 25 | # This is required for Graphene. 26 | CMD ["python"] 27 | 28 | -------------------------------------------------------------------------------- /docs/graphene-workload-tutorial/workload/avalon-workload-gsgx.yaml.template: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | version: '3.5' 16 | 17 | services: 18 | graphene-python-workload: 19 | image: gsc-avalon-{{ my_workload }}-workload-dev 20 | devices: 21 | - "/dev/gsgx:/dev/gsgx" 22 | - "/dev/isgx:/dev/isgx" 23 | volumes: 24 | - /var/run/aesmd/aesm.socket:/var/run/aesmd/aesm.socket 25 | -------------------------------------------------------------------------------- /docs/graphene-workload-tutorial/workload/compose/graphene-sgx.yaml.template: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | version: '3.5' 16 | 17 | services: 18 | process-work-order: 19 | image: gsc-avalon-{{ my_workload }}-workload-dev 20 | devices: 21 | - "/dev/gsgx:/dev/gsgx" 22 | - "/dev/isgx:/dev/isgx" 23 | volumes: 24 | - /var/run/aesmd/aesm.socket:/var/run/aesmd/aesm.socket 25 | -------------------------------------------------------------------------------- /docs/graphene-workload-tutorial/workload/src/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | all = [] 16 | -------------------------------------------------------------------------------- /docs/graphene-workload-tutorial/workload/tests/test_work_orders.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "workOrders": [ 3 | { 4 | "workloadId":"python-{{ my_workload }}", 5 | "params": "" 6 | }, 7 | { 8 | "workloadId":"python-{{ my_workload }}", 9 | "params": "" 10 | }, 11 | { 12 | "workloadId":"python-{{ my_workload }}", 13 | "params": "" 14 | }, 15 | { 16 | "workloadId":"python-{{ my_workload }}", 17 | "params": "" 18 | }, 19 | { 20 | "workloadId":"python-{{ my_workload }}", 21 | "params": "" 22 | } 23 | 24 | ] 25 | } 26 | 27 | -------------------------------------------------------------------------------- /docs/graphene-workload-tutorial/workload/workload.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "python-{{ my_workload }}": { 3 | "module": "src.{{ my_workload }}", 4 | "class": "{{ My_workload }}WorkLoad" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /docs/workload-tutorial/hello_world/stage_1/logic.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #include 17 | #include "logic.h" 18 | 19 | // Add actual workload implementation here ... 20 | -------------------------------------------------------------------------------- /docs/workload-tutorial/hello_world/stage_1/logic.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #pragma once 17 | 18 | #include 19 | 20 | // Add actual workload definitions here ... 21 | -------------------------------------------------------------------------------- /docs/workload-tutorial/hello_world/stage_2/logic.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #include 17 | #include "logic.h" 18 | 19 | std::string ProcessHelloWorld(std::string in_str) { 20 | return "Hello " + in_str; 21 | } 22 | -------------------------------------------------------------------------------- /docs/workload-tutorial/hello_world/stage_2/logic.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #pragma once 17 | 18 | #include 19 | 20 | extern std::string ProcessHelloWorld(std::string in_str); 21 | -------------------------------------------------------------------------------- /docs/workload-tutorial/hello_world/stage_3/io_helper.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #pragma once 17 | 18 | #include 19 | 20 | class IoHelper { 21 | public: 22 | IoHelper(std::string file_name); 23 | 24 | std::string GenerateKey(); 25 | void SetKey(std::string hex_key); 26 | uint32_t WriteFile(std::string data); 27 | uint32_t ReadFile(std::string& read_data); 28 | uint32_t DeleteFile(); 29 | 30 | std::string file_name; 31 | std::string hex_key; 32 | }; // class IoHelper 33 | -------------------------------------------------------------------------------- /docs/workload-tutorial/hello_world/stage_3/logic.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #pragma once 17 | 18 | #include 19 | 20 | extern std::string ProcessHelloWorld(std::string in_str); 21 | 22 | extern std::string GetCountOrKey(std::string name, std::string hex_key); 23 | -------------------------------------------------------------------------------- /docs/workload-tutorial/templates/logic.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #include 17 | #include "logic.h" 18 | 19 | // Add actual workload implementation here ... 20 | -------------------------------------------------------------------------------- /docs/workload-tutorial/templates/logic.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #pragma once 17 | 18 | #include 19 | 20 | // Add actual workload definitions here ... 21 | -------------------------------------------------------------------------------- /enclave_manager/avalon_enclave_manager/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | all = [] 16 | -------------------------------------------------------------------------------- /enclave_manager/avalon_enclave_manager/attestation/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | all = [] 16 | -------------------------------------------------------------------------------- /enclave_manager/avalon_enclave_manager/attestation/dcap/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | all = [] 16 | -------------------------------------------------------------------------------- /enclave_manager/avalon_enclave_manager/attestation/dcap/dcap_enclave_info.i: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | /* Swig pre-processor block, it is used by C++ compiler. */ 17 | %{ 18 | #include "base_enclave_info.h" 19 | #include "dcap_enclave_info.h" 20 | %} 21 | 22 | /* Swig include directive to include header file(Both c++ or other swig file). 23 | It is used by swig compiler. */ 24 | %include "base_enclave_info.h" 25 | %include "dcap_enclave_info.h" 26 | -------------------------------------------------------------------------------- /enclave_manager/avalon_enclave_manager/attestation/dcap/dcap_enclave_info_kme.i: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | %module dcap_enclave_info_kme 17 | 18 | %include enclave_info.i 19 | %include dcap_enclave_info.i 20 | -------------------------------------------------------------------------------- /enclave_manager/avalon_enclave_manager/attestation/dcap/dcap_enclave_info_singleton.i: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | %module dcap_enclave_info_singleton 17 | 18 | %include enclave_info.i 19 | %include dcap_enclave_info.i 20 | -------------------------------------------------------------------------------- /enclave_manager/avalon_enclave_manager/attestation/dcap/dcap_enclave_info_wpe.i: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | %module dcap_enclave_info_wpe 17 | 18 | %include enclave_info.i 19 | %include dcap_enclave_info.i 20 | -------------------------------------------------------------------------------- /enclave_manager/avalon_enclave_manager/attestation/epid/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | all = [] 16 | -------------------------------------------------------------------------------- /enclave_manager/avalon_enclave_manager/attestation/epid/epid_enclave_info.i: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | %include enclave_info.i 17 | 18 | %{ 19 | #include "base_enclave_info.h" 20 | #include "epid_enclave_info.h" 21 | %} 22 | 23 | /* Swig include directive to include header file(Both c++ or other swig file). 24 | It is used by swig compiler. */ 25 | %include "base_enclave_info.h" 26 | %include "epid_enclave_info.h" 27 | -------------------------------------------------------------------------------- /enclave_manager/avalon_enclave_manager/attestation/epid/epid_enclave_info_kme.i: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | %module epid_enclave_info_kme 17 | 18 | %include epid_enclave_info.i 19 | 20 | -------------------------------------------------------------------------------- /enclave_manager/avalon_enclave_manager/attestation/epid/epid_enclave_info_singleton.i: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | %module epid_enclave_info_singleton 17 | 18 | %include epid_enclave_info.i 19 | 20 | -------------------------------------------------------------------------------- /enclave_manager/avalon_enclave_manager/attestation/epid/epid_enclave_info_wpe.i: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | %module epid_enclave_info_wpe 17 | 18 | %include epid_enclave_info.i 19 | 20 | -------------------------------------------------------------------------------- /enclave_manager/avalon_enclave_manager/attestation_common/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | all = [] 16 | -------------------------------------------------------------------------------- /enclave_manager/avalon_enclave_manager/enclave_type.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from enum import Enum, unique 16 | 17 | 18 | @unique 19 | class EnclaveType(Enum): 20 | """ 21 | Enclave Types 22 | 1 - Singleton enclave 23 | 2 - Key management enclave 24 | 3 - Work order processing enclave 25 | From EEA spec 5.2. 26 | """ 27 | SINGLETON = 1 28 | KME = 2 29 | WPE = 3 30 | -------------------------------------------------------------------------------- /enclave_manager/avalon_enclave_manager/graphene/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | all = [] 16 | -------------------------------------------------------------------------------- /enclave_manager/avalon_enclave_manager/graphene_wpe/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | all = [] 16 | -------------------------------------------------------------------------------- /enclave_manager/avalon_enclave_manager/kme/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | all = [] 16 | -------------------------------------------------------------------------------- /enclave_manager/avalon_enclave_manager/singleton/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | all = [ 16 | 'tcs_enclave_manager' 17 | ] 18 | -------------------------------------------------------------------------------- /enclave_manager/avalon_enclave_manager/wpe/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | all = [] 16 | -------------------------------------------------------------------------------- /enclave_manager/avalon_enclave_manager/wpe_common/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | all = [] 16 | -------------------------------------------------------------------------------- /examples/apps/README.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | # Hyperledger Avalon Example Applications 7 | 8 | The following Avalon example applications are available. 9 | They are intended as introductions to the Avalon API to learn how to 10 | create and write new applications. 11 | 12 | - [Echo](echo) 13 | A simple application that echos back the message sent to the echo worker. 14 | The client is a command line client 15 | 16 | - [EEA Token Execution](eea_token) 17 | This application demonstrates EEA token execution logic 18 | 19 | - [Heart Disease Evaluation](heart_disease_eval) 20 | This application performs a heart disease evaluation based on input for 21 | a person. 22 | Clients are available in a X Windows GUI and command line versions 23 | 24 | - [Generic Workload Client](generic_client) 25 | This is a generic client for testing with any worker 26 | -------------------------------------------------------------------------------- /examples/apps/aml/standalone-cipher/README.md: -------------------------------------------------------------------------------- 1 | 5 | ## Python3 (at least 3.5.3) libraries needed to run the cipher 6 | ```bash 7 | pip3 install pycryptodomex starkbank-ecdsa pycrypto pandas Pillow 8 | ``` 9 | 10 | ```bash 11 | sudo apt-get install python3-tk 12 | ``` 13 | 14 | You can execute `./environment.sh` that automatically installs all these 15 | dependencies or install them on your own. 16 | -------------------------------------------------------------------------------- /examples/apps/aml/standalone-cipher/environment.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Banco Santander S.A. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | sudo apt-get -y install python3-pip --fix-missing 16 | sudo pip3 install pycryptodomex starkbank-ecdsa pycrypto pandas Pillow 17 | sudo apt-get install python3-tk 18 | -------------------------------------------------------------------------------- /examples/apps/aml/standalone-cipher/images/santander_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/avalon/5ef6038df458686a7624aa7b4f8890ed6ed1c61e/examples/apps/aml/standalone-cipher/images/santander_logo.png -------------------------------------------------------------------------------- /examples/apps/aml/standalone-cipher/json_building_blocks/base.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkOrderSubmit", 4 | "id": 12, 5 | "params": { 6 | "responseTimeoutMSecs": 6000, 7 | "payloadFormat": "JSON-RPC", 8 | "resultUri": "resulturi", 9 | "notifyUri": "notifyuri", 10 | "workOrderId": "0x11ABCE", 11 | "workerId":"", 12 | "workloadId": "aml-result", 13 | "requesterId": "0x3456", 14 | "dataEncryptionAlgorithm": "AES-GCM-256", 15 | "encryptedSessionKey": "sessionkey", 16 | "sessionKeyIv": "Iv", 17 | "requesterNonce": "", 18 | "encryptedRequestHash": "requesthash", 19 | "requesterSignature": "", 20 | "inData": [] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /examples/apps/aml/standalone-cipher/json_building_blocks/inData.json: -------------------------------------------------------------------------------- 1 | {"index": 0, 2 | "dataHash": "", 3 | "data": "", 4 | "encryptedDataEncryptionKey": "", 5 | "iv": "" 6 | } 7 | -------------------------------------------------------------------------------- /examples/apps/aml/standalone-cipher/test_data/csv_requests/transacES.csv: -------------------------------------------------------------------------------- 1 | from,to,amount,currency,date 2 | ES_2,UK_2,645.83,EUR,Mon Jun 17 2019 02:27:45 GMT+0000 (UTC) 3 | ES_8,ES_0,762.06,EUR,Sat Jun 08 2019 15:02:33 GMT+0000 (UTC) 4 | ES_5,UK_3,1200.15,EUR,Sat Jun 22 2019 22:55:26 GMT+0000 (UTC) 5 | ES_0,ES_1,397.13,EUR,Fri Jun 07 2019 02:07:27 GMT+0000 (UTC) 6 | ES_4,PL_1,3000.18,EUR,Mon Jun 17 2019 19:15:58 GMT+0000 (UTC) 7 | ES_9,UK_2,939.25,EUR,Sun Jun 23 2019 19:59:35 GMT+0000 (UTC) 8 | ES_5,UK_7,917.68,EUR,Fri Jun 21 2019 12:55:51 GMT+0000 (UTC) -------------------------------------------------------------------------------- /examples/apps/aml/standalone-cipher/test_data/csv_requests/transacPL.csv: -------------------------------------------------------------------------------- 1 | from,to,amount,currency,date 2 | PL_1,ES_8,14.56,EUR,Thu Jun 06 2019 00:07:10 GMT+0000 (UTC) 3 | PL_6,PL_5,681.10,EUR,Mon Jun 03 2019 08:08:33 GMT+0000 (UTC) 4 | PL_7,ES_5,1200.32,EUR,Tue Jun 25 2019 04:05:48 GMT+0000 (UTC) 5 | PL_1,UK_7,3000.65,EUR,Wed Jun 19 2019 09:11:59 GMT+0000 (UTC) 6 | PL_0,UK_4,268.15,EUR,Fri May 31 2019 13:03:41 GMT+0000 (UTC) 7 | PL_4,UK_1,122.82,EUR,Mon Jun 24 2019 16:53:50 GMT+0000 (UTC) 8 | PL_4,ES_7,913.14,EUR,Mon Jun 24 2019 11:40:22 GMT+0000 (UTC) -------------------------------------------------------------------------------- /examples/apps/aml/standalone-cipher/test_data/csv_requests/transacUK.csv: -------------------------------------------------------------------------------- 1 | from,to,amount,currency,date 2 | UK_3,PL_7,1200.14,EUR,Sun Jun 02 2019 22:53:54 GMT+0000 (UTC) 3 | UK_7,ES_9,294.11,EUR,Sat Jun 01 2019 02:29:01 GMT+0000 (UTC) 4 | UK_0,UK_5,619.22,EUR,Mon Jun 24 2019 01:25:40 GMT+0000 (UTC) 5 | UK_3,PL_8,487.31,EUR,Wed Jun 05 2019 23:30:54 GMT+0000 (UTC) 6 | UK_7,ES_4,3000.84,EUR,Mon Jun 03 2019 07:24:58 GMT+0000 (UTC) 7 | UK_9,UK_4,34.70,EUR,Sat Jun 15 2019 15:31:43 GMT+0000 (UTC) -------------------------------------------------------------------------------- /examples/apps/aml/standalone-cipher/test_data/csv_requests/usersES.csv: -------------------------------------------------------------------------------- 1 | userId,name 2 | ES_0,Alfonso Tello 3 | ES_1,Rosario Madrigal 4 | ES_2,David Pelayo 5 | ES_3,Maria Eugenia Romo 6 | ES_4,Francisca Valdez 7 | ES_5,Ester Ramos 8 | ES_6,Carolina Ponce 9 | ES_7,Lorena Colon 10 | ES_8,David Lemus 11 | ES_9,Francisco Sanabria -------------------------------------------------------------------------------- /examples/apps/aml/standalone-cipher/test_data/csv_requests/usersPL.csv: -------------------------------------------------------------------------------- 1 | userId,name 2 | PL_0,Hanna Bielak 3 | PL_1,Emil Lis 4 | PL_2,Nina Kruszewski 5 | PL_3,Klarencjusz Wrobel 6 | PL_4,Roger Piatek 7 | PL_5,Ksenia Bialas 8 | PL_6,Arnold Bednarek 9 | PL_7,Hugo Zyla 10 | PL_8,Alfred Zawadzki 11 | PL_9,Kira Jurkiewicz -------------------------------------------------------------------------------- /examples/apps/aml/standalone-cipher/test_data/csv_requests/usersUK.csv: -------------------------------------------------------------------------------- 1 | userId,name 2 | UK_0,Savannah Morar 3 | UK_1,Mikel Eichmann 4 | UK_2,Linda Dickinson 5 | UK_3,Demario Goodwin 6 | UK_4,Beulah Kovacek 7 | UK_5,Anne Mante 8 | UK_6,Sabrina Lang 9 | UK_7,Sabryna Cole 10 | UK_8,Brannon Becker 11 | UK_9,Magnolia Waters -------------------------------------------------------------------------------- /examples/apps/aml/standalone-cipher/test_data/our_signing_key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN EC PRIVATE KEY----- 2 | MHQCAQEEIFqPr+/v3Dt7KyRHcQS/LuXCKXjeNKihkOSccx+mV4IGoAcGBSuBBAAK 3 | oUQDQgAE8gyajdyEVnE9jm3RTSw6Cxln+fCN/slhTtNOyiBAGE+jhwOVlBnxnFPH 4 | yfNKnI+1nOYeufjTEMe/r7nMk/Iq0w== 5 | -----END EC PRIVATE KEY----- -------------------------------------------------------------------------------- /examples/apps/echo/workload/echo_logic.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #include 17 | #include "echo_logic.h" 18 | 19 | std::string Process(std::string str_in) { 20 | return "RESULT: " + str_in; 21 | } 22 | -------------------------------------------------------------------------------- /examples/apps/echo/workload/echo_logic.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #pragma once 17 | 18 | #include 19 | 20 | extern std::string Process(std::string str_in); 21 | 22 | -------------------------------------------------------------------------------- /examples/apps/eea_token/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright 2019 iExec Blockchain Tech 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | token_validation: token_validation.cpp execution_logic.cpp 16 | g++ -Wall -Wno-write-strings token_validation.cpp execution_logic.cpp -o token_validation -I. 17 | 18 | .PHONY: clean 19 | clean : 20 | -rm -rf token_validation 21 | -------------------------------------------------------------------------------- /examples/apps/eea_token/test/token_request: -------------------------------------------------------------------------------- 1 | issue_burn_tokens[]:[{did:ethr:8a5d93cc5613ab0ace80a282029ff721923325ce276db5cadcb62537bb741368,{did:ethr:8a5d93cc5613ab0ace80a282029ff721923325ce276db5cadcb62537bb741361,3,true},{did:ethr:8a5d93cc5613ab0ace80a282029ff721923325ce276db5cadcb62537bb741364,2,true},{did:ethr:8a5d93cc5613ab0ace80a282029ff721923325ce276db5cadcb62537bb741364,3,true}},{did:ethr:111d93cc5613ab0ace80a282029ff721923325ce276db5cadcb62537bb741301,{did:ethr:111d93cc5613ab0ace80a282029ff721923325ce276db5cadcb62537bb841311,3,true},{did:ethr:111d93cc5613ab0ace80a282029ff721923325ce276db5cadcb62537bb841312,2,false}}] 2 | -------------------------------------------------------------------------------- /examples/apps/heart_disease_eval/images/ecg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/avalon/5ef6038df458686a7624aa7b4f8890ed6ed1c61e/examples/apps/heart_disease_eval/images/ecg.jpg -------------------------------------------------------------------------------- /examples/apps/heart_disease_eval/images/heart_gui_screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/avalon/5ef6038df458686a7624aa7b4f8890ed6ed1c61e/examples/apps/heart_disease_eval/images/heart_gui_screenshot.jpg -------------------------------------------------------------------------------- /examples/apps/inside_out_eval/workload/inside_out_eval_logic.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #include 17 | #include 18 | #include "workload_processor.h" 19 | #include "file_io.h" 20 | 21 | class InsideOutEvalLogic { 22 | private: 23 | std::string ReadFile(FileIoExecutor &file_io); 24 | 25 | std::string WriteFile(FileIoExecutor &file_io, std::string content); 26 | 27 | public: 28 | std::string ProcessRequest(std::string str_in); 29 | }; 30 | 31 | -------------------------------------------------------------------------------- /examples/common/java/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /build/ 3 | !gradle/wrapper/gradle-wrapper.jar 4 | 5 | ### STS ### 6 | .apt_generated 7 | .classpath 8 | .factorypath 9 | .project 10 | .settings 11 | .springBeans 12 | .sts4-cache 13 | 14 | ### IntelliJ IDEA ### 15 | .idea 16 | *.iws 17 | *.iml 18 | *.ipr 19 | /out/ 20 | 21 | ### NetBeans ### 22 | /nbproject/private/ 23 | /nbbuild/ 24 | /dist/ 25 | /nbdist/ 26 | /.nb-gradle/ 27 | 28 | src/main/java/org/eea/tcf/worker/utils/version/Version.java 29 | 30 | /bin/ 31 | .vscode/ 32 | .DS_Store 33 | -------------------------------------------------------------------------------- /examples/common/java/direct/worker/README.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | # eea-worker 7 | 8 | ### Overview 9 | 10 | The EEA Worker is a light Java worker client compliant with the 11 | [EEA Off-Chain Trusted Compute Specification v1](https://entethalliance.org/wp-content/uploads/2019/05/EEA_Off_Chain_Trusted_Compute_Specification_V1_0.pdf). 12 | 13 | 14 | ### Run an eea-worker 15 | 16 | 17 | #### With Gradle 18 | 19 | *Please first update your config located in `./src/main/resources/application.yml`* 20 | 21 | * for dev purposes: 22 | 23 | ```bash 24 | cd eea-worker 25 | gradle bootRun --refresh-dependencies 26 | ``` 27 | * or on a remote instance: 28 | ```bash 29 | cd eea-worker 30 | ./gradlew bootRun --refresh-dependencies 31 | ``` 32 | -------------------------------------------------------------------------------- /examples/common/java/direct/worker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.4' 2 | 3 | 4 | networks: 5 | eea-net: 6 | external: true 7 | 8 | services: 9 | worker: 10 | image: nexus.eea/eea-tcf-worker:${WORKER_VERSION} 11 | container_name: worker 12 | environment: 13 | - EEA_CORE_HOST=core 14 | - EEA_CORE_PORT=18090 15 | - EEA_WORKER_NAME=worker 16 | - EEA_TEE_ENABLED:false 17 | - EEA_WORKER_WALLET_PATH=/eea-wallets/encrypted-wallet_worker1.json 18 | - EEA_WORKER_BASE_DIR=/tmp/eea-worker 19 | ports: 20 | - 18091:18091 21 | volumes: 22 | - ./src/main/resources/wallet/encrypted-wallet_worker1.json:/eea-wallets/encrypted-wallet_worker1.json 23 | - /tmp/eea-worker/worker:/tmp/eea-worker/worker 24 | - /var/run/docker.sock:/var/run/docker.sock 25 | restart: on-failure 26 | networks: 27 | - eea-net 28 | 29 | eea-las: 30 | image: nexus.eea/eea-tcf-worker:${EEA_LAS_VERSION} 31 | container_name: eea-las 32 | ports: 33 | - 18766:18766 34 | networks: 35 | - eea-net 36 | devices: 37 | - /dev/isgx 38 | 39 | -------------------------------------------------------------------------------- /examples/common/java/direct/worker/gradle.properties: -------------------------------------------------------------------------------- 1 | nexusUser=fake 2 | nexusPassword=fake 3 | version=0.0.1-SNAPSHOT 4 | -------------------------------------------------------------------------------- /examples/common/java/direct/worker/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/avalon/5ef6038df458686a7624aa7b4f8890ed6ed1c61e/examples/common/java/direct/worker/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /examples/common/java/direct/worker/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Jul 24 16:07:53 CEST 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.2-all.zip 7 | -------------------------------------------------------------------------------- /examples/common/java/direct/worker/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'tcf-worker' 2 | -------------------------------------------------------------------------------- /examples/common/java/direct/worker/src/main/java/org/eea/tcf/worker/dapp/DappType.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2019 iExec Blockchain Tech 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *****************************************************************************/ 16 | package org.eea.tcf.worker.dapp; 17 | 18 | public enum DappType { 19 | 20 | DOCKER, BINARY 21 | } 22 | -------------------------------------------------------------------------------- /examples/common/java/direct/worker/src/main/resources/Version.java.template: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | 15 | package org.eea.tcf.worker.utils.version; 16 | 17 | class Version { 18 | static final String PROJECT_VERSION = "@projectversion@"; 19 | } 20 | -------------------------------------------------------------------------------- /examples/common/java/direct/worker/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | ${Ansi.YELLOW} 2 | ${Ansi.YELLOW} ______ ______ _______ _____ ______ 3 | ${Ansi.YELLOW} | ____| ____| /\ |__ __/ ____| ____| 4 | ${Ansi.YELLOW} | |__ | |__ / \ ______| | | | | |__ 5 | ${Ansi.YELLOW} | __| | __| / /\ \______| | | | | __| 6 | ${Ansi.YELLOW} | |____| |____ / ____ \ | | | |____| | 7 | ${Ansi.YELLOW} |______|______/_/ \_\ |_| \_____|_| 8 | ${Ansi.YELLOW} 9 | ${Ansi.YELLOW} :: Spring Boot${spring-boot.formatted-version} :: ${Ansi.DEFAULT} -------------------------------------------------------------------------------- /examples/common/java/direct/worker/src/main/resources/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ################################################################################ 4 | # Copyright 2019 iExec Blockchain Tech 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | ################################################################################ 18 | 19 | if [ ! -z $EEA_HTTP_PROXY_HOST ] && [ ! -z $EEA_HTTP_PROXY_PORT ]; then 20 | java -Dhttp.proxyHost=$EEA_HTTP_PROXY_HOST -Dhttp.proxyPort=$EEA_HTTP_PROXY_PORT -jar /eea-worker.jar 21 | fi 22 | 23 | java -jar /eea-worker.jar 24 | -------------------------------------------------------------------------------- /examples/common/java/direct/worker/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /examples/common/java/direct/worker/src/main/resources/wallet/wallet1.json: -------------------------------------------------------------------------------- 1 | { 2 | "address": "1a69b2eb604db8eba185df03ea4f5288dcbbd248", 3 | "id": "9428da60-eafb-4771-a64b-fac009946bba", 4 | "version": 3, 5 | "Crypto": { 6 | "cipher": "aes-128-ctr", 7 | "cipherparams": { 8 | "iv": "924d817ab4f4f8786c6ca6c563af4102" 9 | }, 10 | "ciphertext": "0a26992572e1cad527eca658f99f79e0a9efc784144fc0524a1279a971828a43", 11 | "kdf": "scrypt", 12 | "kdfparams": { 13 | "salt": "a59ab4d6069b677bb71473c14cd58f7af0e778f10eba6ac2d24804d2e167ffb5", 14 | "n": 131072, 15 | "dklen": 32, 16 | "p": 1, 17 | "r": 8 18 | }, 19 | "mac": "0155cebb27cd4818e8348afd1c4d84eb77303101ea0ef684ec179041fbb5fed1" 20 | } 21 | } -------------------------------------------------------------------------------- /examples/common/java/direct/worker/src/main/resources/wallet/wallet2.json: -------------------------------------------------------------------------------- 1 | { 2 | "address": "2ab2674aa374fe6415d11f0a8fcbd8027fc1e6a9", 3 | "id": "91a9e9cd-22ff-453e-ba5d-550a4db17664", 4 | "version": 3, 5 | "Crypto": { 6 | "cipher": "aes-128-ctr", 7 | "cipherparams": { 8 | "iv": "cb2c75f83d5a5c57ed22a9d469edd928" 9 | }, 10 | "ciphertext": "0f617ec7e5aec597c4d2fe4fcfab60a95259deb3d02de60a3c8885053951933b", 11 | "kdf": "scrypt", 12 | "kdfparams": { 13 | "salt": "fb78c408b176a43169b8ee0f203d68f5860a40aa7a0f344042d707097a6d6704", 14 | "n": 131072, 15 | "dklen": 32, 16 | "p": 1, 17 | "r": 8 18 | }, 19 | "mac": "59311c76bea529224a3ea4925ce1721b5e6a1fdcf1782628c0b64616d22ef86f" 20 | } 21 | } -------------------------------------------------------------------------------- /examples/common/java/direct/worker/src/main/resources/wallet/wallet3.json: -------------------------------------------------------------------------------- 1 | { 2 | "address": "3a3406e69adf886c442ff1791cbf67cea679275d", 3 | "id": "35867a31-4480-44f6-9936-ee0fa0b9205a", 4 | "version": 3, 5 | "Crypto": { 6 | "cipher": "aes-128-ctr", 7 | "cipherparams": { 8 | "iv": "4aed36e66f7b7492f19083b63b673c24" 9 | }, 10 | "ciphertext": "9d0c461532b97f8056d69a4320367e19981560c98eed4eb7b977384bcabdb5ed", 11 | "kdf": "scrypt", 12 | "kdfparams": { 13 | "salt": "b4013fec30f5fba76ff2deb43a8d2657410346862bbde22e69c8f7626c799bf8", 14 | "n": 131072, 15 | "dklen": 32, 16 | "p": 1, 17 | "r": 8 18 | }, 19 | "mac": "42d018aa05dfd320c31cb93cf4db4c66111a9a189ddf5e9cb7a20d391e080a2f" 20 | } 21 | } -------------------------------------------------------------------------------- /examples/common/java/direct/worker/src/main/resources/wallet/wallet4.json: -------------------------------------------------------------------------------- 1 | { 2 | "address": "4aef50214110fdad4e8b9128347f2ba1ec72f614", 3 | "id": "8d9fa142-76e9-4aaf-8249-8dd09f3bf8ea", 4 | "version": 3, 5 | "Crypto": { 6 | "cipher": "aes-128-ctr", 7 | "cipherparams": { 8 | "iv": "aa6ba8cbca3ecb1786d4eeca58c4aab8" 9 | }, 10 | "ciphertext": "2802cb9297e3038ad0ad6c2471d27eff946792c0bfb60dd8a2f0b30a9bfeb43c", 11 | "kdf": "scrypt", 12 | "kdfparams": { 13 | "salt": "84dcdeb2c8d4164d5e8724b0115bf368daa32ac9d6707e626d712c2539aab34f", 14 | "n": 131072, 15 | "dklen": 32, 16 | "p": 1, 17 | "r": 8 18 | }, 19 | "mac": "2e7a1fe6bb238fc1204d6f47b46c81839881d970275642ed9f45266ab8cddfcd" 20 | } 21 | } -------------------------------------------------------------------------------- /examples/common/java/direct/worker/src/main/resources/wallet/wallet5.json: -------------------------------------------------------------------------------- 1 | { 2 | "address": "5af4eef749db212c594efac14c056a05261deda9", 3 | "id": "c5c7c83d-1639-4d30-9138-8191669ec233", 4 | "version": 3, 5 | "Crypto": { 6 | "cipher": "aes-128-ctr", 7 | "cipherparams": { 8 | "iv": "c1825399efc91f1bf80da973634d4f3c" 9 | }, 10 | "ciphertext": "9734813b66b272da78934b53d4b9311fd1a44fa3406314479e5aac9e0335879b", 11 | "kdf": "scrypt", 12 | "kdfparams": { 13 | "salt": "c44a4db844b3d6e1df19cf52076010a47facd159dc85993ce0c2b9733eefa507", 14 | "n": 131072, 15 | "dklen": 32, 16 | "p": 1, 17 | "r": 8 18 | }, 19 | "mac": "d5aba644474abb97ce0c8990b0fcb34545feaa664ebcfc870472e6f0a6cf4f5f" 20 | } 21 | } -------------------------------------------------------------------------------- /examples/common/java/direct/worker/src/main/resources/worker-details.json: -------------------------------------------------------------------------------- 1 | { 2 | "workOrderSyncUri": "used for direct model", 3 | "workOrderAsyncUri": "used for direct model", 4 | "workOrderPullUri": "used for direct model", 5 | "workOrderNotifyUri": "used for direct model", 6 | "receiptInvocationUri": "used for direct model", 7 | "workOrderInvocationAddress": "??", 8 | "receiptInvocationAddress": "??", 9 | "fromAddress": "0x1a69b2EB604dB8eBa185dF03ea4F5288dcbbD248", 10 | "hashingAlgorithm": "SHA-256,KECCAK-256", 11 | "signingAlgorithm": "SECP256K1,RSA-OAEP-3072", 12 | "keyEncryptionAlgorithm": "", 13 | "encryptionPublicKey": "myPublicKey", 14 | "dataEncryptionAlgorithm": "", 15 | "workOrderPayloadFormats": [], 16 | "workerTypeData" : { 17 | "verificationKey": "", 18 | "extendedMeasurements": "", 19 | "proofDataType": "", 20 | "proofData": {}, 21 | "encryptionKey": "", 22 | "encryptionKeyNonce": "", 23 | "encryptionKeySignature": "", 24 | "enclaveCertificate": "" 25 | } 26 | } -------------------------------------------------------------------------------- /examples/common/java/direct/worker/src/test/resources/tmp/test-worker/bytes32/output/iexec_out/determinism.iexec: -------------------------------------------------------------------------------- 1 | 0xda9a34f3846cc4434eb31ad870aaf47c8a123225732db003c0c19f3c3f6faa01 2 | -------------------------------------------------------------------------------- /examples/common/java/direct/worker/src/test/resources/tmp/test-worker/callback-fake/output/iexec_out/callback.iexec: -------------------------------------------------------------------------------- 1 | 0xnothexa -------------------------------------------------------------------------------- /examples/common/java/direct/worker/src/test/resources/tmp/test-worker/callback/output/iexec_out/callback.iexec: -------------------------------------------------------------------------------- 1 | 0x0000000000000000000000000000000000000000000000000000016a0caa81920000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000004982f5d9a7000000000000000000000000000000000000000000000000000000000000000094254432d5553442d390000000000000000000000000000000000000000000000 -------------------------------------------------------------------------------- /examples/common/java/direct/worker/src/test/resources/tmp/test-worker/notBytes32/output/iexec_out/determinism.iexec: -------------------------------------------------------------------------------- 1 | dummyRandomString 2 | -------------------------------------------------------------------------------- /examples/common/java/direct/worker/src/test/resources/tmp/test-worker/scone-tee-corrupted-file/output/iexec_out/enclaveSig.iexec: -------------------------------------------------------------------------------- 1 | { 2 | "this is" : "a corrupted file", 3 | nihahaha :p 4 | } -------------------------------------------------------------------------------- /examples/common/java/direct/worker/src/test/resources/tmp/test-worker/scone-tee/output/iexec_out/enclaveSig.iexec: -------------------------------------------------------------------------------- 1 | { 2 | "result": "0xc746143d64ef1a1f9e280cee70e2866daad3116bfe0e7028a53e500b2c92a6d6", 3 | "resultHash": "0x5ade3c39f9e83db590cbcb03fee7e0ba6c533fa3fb4e72f9320c3e641e38c31e", 4 | "resultSalt": "0x5119fb3770cc545ff3ab0377842ebcd923a3cc02fc4390c285f5368e2b0f3742", 5 | "signature": "0xa025ac611f80112c4827f316f2babd92d983c4ebcd4fdcebc57a6f02fd587c4d503264885f0c5aceeccac04c0f6257831bff57890786ceb01dcb9d191a788d711b" 6 | } -------------------------------------------------------------------------------- /examples/common/java/direct/worker/truffle_generate.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | ################################################################################ 4 | # Copyright 2019 iExec Blockchain Tech 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | ################################################################################ 18 | 19 | for f in ../TCF-contracts/build/contracts/*.json; do 20 | web3j truffle generate "$f" -o src/main/java/ -p org.eea.tcf.worker.contract.generated 21 | done 22 | -------------------------------------------------------------------------------- /examples/graphene_apps/cppopenvino/compose/python-worker-gsgx.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | version: '3.5' 16 | 17 | services: 18 | process-work-order: 19 | image: gsc-avalon-ov-python-worker-dev 20 | devices: 21 | - "/dev/gsgx:/dev/gsgx" 22 | - "/dev/isgx:/dev/isgx" 23 | volumes: 24 | - /var/run/aesmd/aesm.socket:/var/run/aesmd/aesm.socket 25 | -------------------------------------------------------------------------------- /examples/graphene_apps/cppopenvino/config.toml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # ZMQ URL to listen for request. 16 | # "*" indicates bind socket to all network interfaces. 17 | zmq_url = "tcp://*:8888" 18 | 19 | # Model file 20 | model_file = "/home/openvino/model/VGG_VOC0712Plus_SSD_300x300_ft_iter_160000.xml" 21 | 22 | # Input image directory. 23 | input_image_dir = "/home/openvino/images/" 24 | 25 | # Output image directory. 26 | output_image_dir = "/home/openvino/output/" 27 | -------------------------------------------------------------------------------- /examples/graphene_apps/cppopenvino/docker-compose-sgx.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | version: '3.5' 16 | 17 | services: 18 | ov-work-order: 19 | image: gsc-openvinowl 20 | devices: 21 | - "/dev/gsgx:/dev/gsgx" 22 | - "/dev/isgx:/dev/isgx" 23 | volumes: 24 | - /var/run/aesmd/aesm.socket:/var/run/aesmd/aesm.socket 25 | 26 | 27 | -------------------------------------------------------------------------------- /examples/graphene_apps/cppopenvino/graphene/openvinowl.manifest: -------------------------------------------------------------------------------- 1 | sgx.allow_file_creation = 1 2 | sgx.enclave_size = "2G" 3 | sgx.thread_num = 16 4 | sgx.file_check_policy = "allow_all_but_log" 5 | 6 | # eventfd used by C++ ZMQ library. 7 | sys.insecure__allow_eventfd = 1 8 | -------------------------------------------------------------------------------- /examples/graphene_apps/cppopenvino/images/elephants.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/avalon/5ef6038df458686a7624aa7b4f8890ed6ed1c61e/examples/graphene_apps/cppopenvino/images/elephants.jpg -------------------------------------------------------------------------------- /examples/graphene_apps/cppopenvino/images/horses.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/avalon/5ef6038df458686a7624aa7b4f8890ed6ed1c61e/examples/graphene_apps/cppopenvino/images/horses.jpg -------------------------------------------------------------------------------- /examples/graphene_apps/cppopenvino/images/scenery.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/avalon/5ef6038df458686a7624aa7b4f8890ed6ed1c61e/examples/graphene_apps/cppopenvino/images/scenery.jpg -------------------------------------------------------------------------------- /examples/graphene_apps/cppopenvino/images/street.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/avalon/5ef6038df458686a7624aa7b4f8890ed6ed1c61e/examples/graphene_apps/cppopenvino/images/street.jpg -------------------------------------------------------------------------------- /examples/graphene_apps/cppopenvino/images/test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/avalon/5ef6038df458686a7624aa7b4f8890ed6ed1c61e/examples/graphene_apps/cppopenvino/images/test.png -------------------------------------------------------------------------------- /examples/graphene_apps/cppopenvino/ov_workload/src/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | all = [] 16 | -------------------------------------------------------------------------------- /examples/graphene_apps/cppopenvino/ov_workload/src/ov_workload_config.toml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # ZMQ URL to send openvino work order requests. 16 | # There is a bug in GSC tool which cannot resolve DNS container hostname 17 | # to IP address. So we need to assign static IP to container. 18 | # IP address should match ov-work-order IP address in 19 | # file compose/ov-subnet.yaml. 20 | zmq_url = "tcp://10.5.0.6:8888" 21 | 22 | -------------------------------------------------------------------------------- /examples/graphene_apps/cppopenvino/test/python_worker/ov_workload.json: -------------------------------------------------------------------------------- 1 | { 2 | "ov-inference": { 3 | "module": "src.openvino", 4 | "class": "OpenVinoWorkLoad" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /examples/graphene_apps/cppopenvino/test/python_worker/test_ov_work_orders.json: -------------------------------------------------------------------------------- 1 | { 2 | "workOrders": [ 3 | { 4 | "workloadId": "ov-inference", 5 | "params": "elephants.jpg" 6 | }, 7 | { 8 | "workloadId": "ov-inference", 9 | "params": "scenery.jpg" 10 | }, 11 | { 12 | "workloadId": "ov-inference", 13 | "params": "street.jpg" 14 | }, 15 | { 16 | "workloadId": "ov-inference", 17 | "params": "test.png" 18 | }, 19 | { 20 | "workloadId": "ov-inference", 21 | "params": "horses.jpg" 22 | } 23 | ] 24 | } 25 | 26 | -------------------------------------------------------------------------------- /examples/graphene_apps/cppopenvino/test/test_config.toml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # ZMQ URL to send test work order requests. 16 | zmq_url = "tcp://ov-work-order:8888" 17 | 18 | -------------------------------------------------------------------------------- /examples/graphene_apps/python_workloads/fibonacci/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | ARG BASE_IMAGE 16 | 17 | FROM $BASE_IMAGE 18 | 19 | COPY . /home/python_workloads/fibonacci 20 | 21 | WORKDIR /home/python_workloads/fibonacci 22 | 23 | # Build fibonacci python workload module and install 24 | RUN make && make install 25 | 26 | # Pass python file as docker command line argument 27 | # This is required for Graphene. 28 | CMD ["python"] 29 | 30 | -------------------------------------------------------------------------------- /examples/graphene_apps/python_workloads/fibonacci/compose/graphene-wpe-sgx.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | version: '3.5' 16 | 17 | services: 18 | process-work-order: 19 | image: gsc-avalon-wpe-fibonacci-workload-dev 20 | 21 | -------------------------------------------------------------------------------- /examples/graphene_apps/python_workloads/fibonacci/docker-compose-wpe.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | version: '3.5' 16 | 17 | services: 18 | process-work-order: 19 | container_name: process-work-order-wpe 20 | image: avalon-wpe-fibonacci-workload-dev 21 | build: 22 | context: . 23 | dockerfile: ./Dockerfile 24 | args: 25 | - BASE_IMAGE=avalon-python-worker-wpe-dev 26 | environment: 27 | - http_proxy 28 | - https_proxy 29 | - no_proxy 30 | 31 | -------------------------------------------------------------------------------- /examples/graphene_apps/python_workloads/fibonacci/fib_workload.json: -------------------------------------------------------------------------------- 1 | { 2 | "python-fib": { 3 | "module": "src.fibonacci", 4 | "class": "FibonacciWorkLoad" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /examples/graphene_apps/python_workloads/fibonacci/src/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | all = [] 16 | -------------------------------------------------------------------------------- /examples/graphene_apps/python_workloads/fibonacci/tests/test_fib_work_orders.json: -------------------------------------------------------------------------------- 1 | { 2 | "workOrders": [ 3 | { 4 | "workloadId": "python-fib", 5 | "params": "9" 6 | }, 7 | { 8 | "workloadId": "python-fib", 9 | "params": "10" 10 | }, 11 | { 12 | "workloadId": "python-fib", 13 | "params": "15" 14 | } 15 | ] 16 | } 17 | 18 | -------------------------------------------------------------------------------- /images/HL_Avalon_Logo_Color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/avalon/5ef6038df458686a7624aa7b4f8890ed6ed1c61e/images/HL_Avalon_Logo_Color.png -------------------------------------------------------------------------------- /images/HL_Avalon_Logo_Color_Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/avalon/5ef6038df458686a7624aa7b4f8890ed6ed1c61e/images/HL_Avalon_Logo_Color_Small.png -------------------------------------------------------------------------------- /images/sample-python-code-coverage-report.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/avalon/5ef6038df458686a7624aa7b4f8890ed6ed1c61e/images/sample-python-code-coverage-report.png -------------------------------------------------------------------------------- /images/screenshot-hyperledger-avalon-application-development.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/avalon/5ef6038df458686a7624aa7b4f8890ed6ed1c61e/images/screenshot-hyperledger-avalon-application-development.jpg -------------------------------------------------------------------------------- /images/screenshot-hyperledger-avalon-heart-disease-demo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/avalon/5ef6038df458686a7624aa7b4f8890ed6ed1c61e/images/screenshot-hyperledger-avalon-heart-disease-demo.jpg -------------------------------------------------------------------------------- /images/screenshot-introduction-to-hyperledger-avalon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger-archives/avalon/5ef6038df458686a7624aa7b4f8890ed6ed1c61e/images/screenshot-introduction-to-hyperledger-avalon.jpg -------------------------------------------------------------------------------- /listener/avalon_listener/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __all__ = [] 16 | -------------------------------------------------------------------------------- /scripts/lmdb.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # Copyright 2019 Intel Corporation 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | lmdb_server="${TCF_HOME}/examples/shared_kv_storage/kv_storage/remote_lmdb/lmdb_listener.py" 18 | 19 | echo "start the lmdb server ..." 20 | 21 | python3 ${lmdb_server} 22 | -------------------------------------------------------------------------------- /scripts/sgx-hw.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script updates the spid and ias_api_key in enclave config file. 4 | # Usage: 5 | # export following variables in your terminal: 6 | # export MYSPID='spid = ""' 7 | # export MYIAS='ias_api_key = ""' 8 | # Run the script: 9 | # ./scripts/sgx-hw.sh config/singleton_enclave_config.toml 10 | 11 | if [[ -z "$MYSPID" ]] ; then 12 | echo "MYSPID is not defined" 13 | exit 1 14 | fi 15 | 16 | if [[ -z "$MYIAS" ]] ; then 17 | echo "MYIAS is not defined" 18 | exit 1 19 | fi 20 | 21 | a=$(sed -n '/spid =/=' $1) 22 | sed -i "${a}s/.*/${MYSPID}/" $1 23 | a=$(sed -n '/ias_api_key =/=' $1) 24 | sed -i "${a}s/.*/${MYIAS}/" $1 25 | -------------------------------------------------------------------------------- /scripts/update_env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | distro="" 4 | image="" 5 | file="" 6 | 7 | while getopts 'f:d:i:h' OPTCHAR ; do 8 | case $OPTCHAR in 9 | d ) 10 | distro="DISTRO=$OPTARG" 11 | ;; 12 | 13 | i ) 14 | image="IMAGE=$OPTARG" 15 | ;; 16 | 17 | f) 18 | file=$OPTARG 19 | ;; 20 | 21 | h ) 22 | echo hello 23 | esac 24 | done 25 | 26 | echo $distro 27 | echo $image 28 | 29 | a=$(sed -n '/DISTRO=/=' $file) 30 | sed -i "${a}s/.*/${distro}/" $file 31 | a=$(sed -n '/IMAGE=/=' $file) 32 | sed -i "${a}s/.*/${image}/" $file 33 | -------------------------------------------------------------------------------- /sdk/avalon_sdk/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __all__ = [] 16 | -------------------------------------------------------------------------------- /sdk/avalon_sdk/connector/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __all__ = [] 16 | -------------------------------------------------------------------------------- /sdk/avalon_sdk/connector/blockchains/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __all__ = [] 16 | -------------------------------------------------------------------------------- /sdk/avalon_sdk/connector/blockchains/common/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __all__ = [] 16 | -------------------------------------------------------------------------------- /sdk/avalon_sdk/connector/blockchains/common/contract_response.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from enum import Enum, unique 16 | 17 | 18 | @unique 19 | class ContractResponse(Enum): 20 | """Contract response values.""" 21 | SUCCESS = 0 22 | ERROR = -1 23 | -------------------------------------------------------------------------------- /sdk/avalon_sdk/connector/blockchains/ethereum/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __all__ = [] 16 | -------------------------------------------------------------------------------- /sdk/avalon_sdk/connector/blockchains/ethereum/truffle_artifacts/2_deploy_contracts.js: -------------------------------------------------------------------------------- 1 | var WorkOrderRegistry = artifacts.require("WorkOrderRegistry"); 2 | var WorkerRegistry = artifacts.require("WorkerRegistry"); 3 | 4 | module.exports = function(deployer) { 5 | deployer.deploy(WorkOrderRegistry); 6 | deployer.deploy(WorkerRegistry); 7 | }; 8 | -------------------------------------------------------------------------------- /sdk/avalon_sdk/connector/blockchains/ethereum/unit_tests/work_order_get_result.json: -------------------------------------------------------------------------------- 1 | { 2 | "result": { 3 | "workOrderId": "f2571b1fe96c8a92993c0e98bf541cc9ffdaa27fc6ce2c30f9d83b09dc9b5c2c", 4 | "workloadId": "6563686f2d726573756c74", 5 | "workerId": "15f0e2ad6f58f53252bedf7aef1dfeeb767681e57b41548e0a114474f4b87136", 6 | "requesterId": "da7ba0a257e978731857e79550823bc00e7ecb8f555cdba2c224ed35a50302d5", 7 | "workerNonce": "O1Sfqo+L0BPQ9dGxSMA7/XofY2FoexDy8nvjKkCumh0=", 8 | "workerSignature": "MEUCIQDuhfNsE+h1+KMItP3JhdsQFdpLUQrVpQIUuYaHrXR3cwIgXagC9f8/mP8yFqs+MnewJPH8VUX1Ljnd+AvG6UNi8Wg=", 9 | "outData": [ 10 | { 11 | "index": 0, 12 | "dataHash": "7A558709FBAF72D6CEEFD9AAA285989E852944E3D0A91D7A9409CCB3A2A5E056", 13 | "data": "ER+fXUkeTNIWOyISiYeJUXF1IBXY4VmJanntmllr", 14 | "encryptedDataEncryptionKey": "", 15 | "iv": "" 16 | } 17 | ] 18 | }, 19 | "id": 11140, 20 | "jsonrpc": "2.0" 21 | } 22 | -------------------------------------------------------------------------------- /sdk/avalon_sdk/connector/blockchains/ethereum/unit_tests/work_order_get_result_error.json: -------------------------------------------------------------------------------- 1 | { 2 | "error": { 3 | "code": 2, 4 | "message": "Indata is empty" 5 | }, 6 | "id": 13122, 7 | "jsonrpc": "2.0" 8 | } 9 | -------------------------------------------------------------------------------- /sdk/avalon_sdk/connector/blockchains/fabric/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __all__ = [] 16 | -------------------------------------------------------------------------------- /sdk/avalon_sdk/connector/blockchains/fabric/chaincode/order/go/go.mod: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright IBM Corp. 2020 All Rights Reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | module order 18 | 19 | go 1.12 20 | 21 | require ( 22 | github.com/golang/protobuf v1.3.1 23 | github.com/hyperledger/fabric v1.4.1 24 | ) -------------------------------------------------------------------------------- /sdk/avalon_sdk/connector/blockchains/fabric/chaincode/receipt/go/go.mod: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright IBM Corp. 2020 All Rights Reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | module receipt 18 | 19 | go 1.12 20 | 21 | require ( 22 | github.com/golang/protobuf v1.3.1 23 | github.com/hyperledger/fabric v1.4.1 24 | ) -------------------------------------------------------------------------------- /sdk/avalon_sdk/connector/blockchains/fabric/chaincode/registry/go/go.mod: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright IBM Corp. 2020 All Rights Reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | module registry 18 | 19 | go 1.12 20 | 21 | require ( 22 | github.com/golang/protobuf v1.3.1 23 | github.com/hyperledger/fabric v1.4.1 24 | ) -------------------------------------------------------------------------------- /sdk/avalon_sdk/connector/blockchains/fabric/chaincode/worker/go/go.mod: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright IBM Corp. 2020 All Rights Reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | module worker 18 | 19 | go 1.12 20 | 21 | require ( 22 | github.com/golang/protobuf v1.3.1 23 | github.com/hyperledger/fabric v1.4.1 24 | ) -------------------------------------------------------------------------------- /sdk/avalon_sdk/connector/direct/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __all__ = [] 16 | -------------------------------------------------------------------------------- /sdk/avalon_sdk/connector/direct/jrpc/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __all__ = [] 16 | -------------------------------------------------------------------------------- /sdk/avalon_sdk/connector/interfaces/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __all__ = [] 16 | -------------------------------------------------------------------------------- /sdk/avalon_sdk/registry/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __all__ = [] 16 | -------------------------------------------------------------------------------- /sdk/avalon_sdk/registry/registry_status.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from enum import Enum, unique 16 | 17 | 18 | @unique 19 | class RegistryStatus(Enum): 20 | """ 21 | Worker registry status values: 22 | 1 - registry is ACTIVE 23 | 2 - registry is temporarily OFF_LINE 24 | 3 - registry is DECOMMISSIONED 25 | 26 | From EEA spec 5.2. 27 | """ 28 | ACTIVE = 1 29 | OFF_LINE = 2 30 | DECOMMISSIONED = 3 31 | -------------------------------------------------------------------------------- /sdk/avalon_sdk/work_order/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __all__ = [] 16 | -------------------------------------------------------------------------------- /sdk/avalon_sdk/work_order_receipt/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /sdk/avalon_sdk/worker/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __all__ = [] 16 | -------------------------------------------------------------------------------- /shared_kv_storage/db_store/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | all: packages 16 | 17 | packages: 18 | mkdir -p packages/build 19 | cd packages/build; cmake .. 20 | $(MAKE) -C packages/build 21 | 22 | clean: 23 | rm -rf packages/build 24 | 25 | .PHONY: all 26 | .PHONY: packages 27 | .PHONY: clean 28 | -------------------------------------------------------------------------------- /shared_kv_storage/kv_storage/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __all__ = [] 16 | -------------------------------------------------------------------------------- /shared_kv_storage/kv_storage/interface/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /shared_kv_storage/kv_storage/remote_lmdb/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /shared_kv_storage/kv_storage/remote_lmdb/db_store_csv.i: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | %module db_store_csv 17 | 18 | %include 19 | %{ 20 | #include "db_store_csv.h" 21 | %} 22 | 23 | %include "db_store_csv.h" 24 | 25 | -------------------------------------------------------------------------------- /shared_kv_storage/kv_storage/remote_lmdb/string_escape.py: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | # Return unicode string with special characters escaped 17 | def escape(string): 18 | return string.encode("unicode_escape").decode("utf-8") 19 | 20 | 21 | # Return unicode string with escaped characters unescaped 22 | def unescape(string): 23 | return string.encode("utf-8").decode("unicode_escape") 24 | -------------------------------------------------------------------------------- /shared_kv_storage/lmdb_config.toml: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | [KvStorage] 17 | StoragePath = "Kv_Shared_tmp" 18 | StorageSize = "1 TB" 19 | # the remote version is of higher priority if enabled 20 | bind = "http://localhost:9090" 21 | 22 | [Logging] 23 | LogLevel = "INFO" 24 | LogFile = "__screen__" 25 | 26 | -------------------------------------------------------------------------------- /shared_kv_storage/packaging/lmdb_config.toml.example: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # 16 | # LMDB storage configuration 17 | # 18 | 19 | #[KvStorage] 20 | #StoragePath = "config/Kv_Shared_tmp" 21 | #StorageSize = "1 TB" 22 | # The port and host for the lmdb server to run on 23 | #bind = "http://localhost:9090" 24 | 25 | -------------------------------------------------------------------------------- /shared_kv_storage/packaging/systemd/shared_kv_storage.service: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # ------------------------------------------------------------------------------ 15 | 16 | [Unit] 17 | Description=Avalon KV Storage 18 | After=network.target 19 | 20 | [Service] 21 | User=avalon 22 | Group=avalon 23 | EnvironmentFile= 24 | ExecStart=/usr/bin/kv_storage 25 | Restart=on-failure 26 | 27 | [Install] 28 | WantedBy=multi-user.target 29 | 30 | -------------------------------------------------------------------------------- /tc/graphene/python_worker/avalon_worker/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | all = [] 16 | -------------------------------------------------------------------------------- /tc/graphene/python_worker/avalon_worker/attestation/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | all = [] 16 | -------------------------------------------------------------------------------- /tc/graphene/python_worker/avalon_worker/error_code.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | # Copyright 2020 Intel Corporation 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | from enum import IntEnum, unique 18 | 19 | 20 | @unique 21 | class WorkerError(IntEnum): 22 | SUCCESS = 0 23 | UNKNOWN_ERROR = 1 24 | INVALID_PARAMETER_FORMAT_OR_VALUE = 2 25 | ACCESS_DENIED = 3 26 | INVALID_SIGNATURE = 4 27 | NO_MORE_LOOKUP_RESULTS = 5 28 | UNSUPPORTED_MODE = 6 29 | -------------------------------------------------------------------------------- /tc/graphene/python_worker/avalon_worker/utility/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | all = [] 16 | -------------------------------------------------------------------------------- /tc/graphene/python_worker/avalon_worker/workload/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | all = [] 16 | -------------------------------------------------------------------------------- /tc/graphene/python_worker/compose/graphene-sgx.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | version: '3.5' 16 | 17 | services: 18 | process-work-order: 19 | image: gsc-avalon-python-worker-dev 20 | devices: 21 | - "/dev/gsgx:/dev/gsgx" 22 | - "/dev/isgx:/dev/isgx" 23 | volumes: 24 | - /var/run/aesmd/aesm.socket:/var/run/aesmd/aesm.socket 25 | -------------------------------------------------------------------------------- /tc/graphene/python_worker/graphene_sgx/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | all = [] 16 | -------------------------------------------------------------------------------- /tc/graphene/python_worker/graphene_sgx/manifest/collect2.manifest: -------------------------------------------------------------------------------- 1 | sgx.enclave_size = "256M" 2 | # Uses tmp directory 3 | sgx.allowed_files.tmp = "file:/tmp" 4 | -------------------------------------------------------------------------------- /tc/graphene/python_worker/graphene_sgx/manifest/gcc.manifest: -------------------------------------------------------------------------------- 1 | sgx.enclave_size = "256M" 2 | # Uses tmp directory 3 | sgx.allowed_files.tmp = "file:/tmp" 4 | -------------------------------------------------------------------------------- /tc/graphene/python_worker/graphene_sgx/manifest/ld.manifest: -------------------------------------------------------------------------------- 1 | sgx.enclave_size = "256M" 2 | # Uses tmp directory 3 | sgx.allowed_files.tmp = "file:/tmp" 4 | -------------------------------------------------------------------------------- /tc/graphene/python_worker/graphene_sgx/manifest/python.manifest: -------------------------------------------------------------------------------- 1 | sgx.allow_file_creation = 1 2 | # Set the virtual memory size of the SGX enclave. For SGX v1, the enclave 3 | # size must be specified upfront. If Python worker needs more 4 | # virtual memory than the enclave size, Graphene will not be able to 5 | # allocate it. 6 | sgx.enclave_size = "256M" 7 | sgx.thread_num = 8 8 | sgx.file_check_policy = "allow_all_but_log" 9 | 10 | # Request remote attestation functionality from Graphene 11 | # For EPID based remote attestaion, ra_client_spid and ra_client_linkable 12 | # configs must be filled with proper values. 13 | # For DCAP/ECDSA based attestation, ``ra_client_spid`` must be an empty string. 14 | # All the below configs need to be enabled to request remote attestation 15 | #sgx.remote_attestation = 1 16 | 17 | # Specify your SPID and linkable/unlinkable attestation policy 18 | #sgx.ra_client_spid = "" 19 | #sgx.ra_client_linkable = 20 | -------------------------------------------------------------------------------- /tc/graphene/python_worker/graphene_sgx/manifest/sh.manifest: -------------------------------------------------------------------------------- 1 | sgx.enclave_size = "256M" 2 | -------------------------------------------------------------------------------- /tc/graphene/python_worker/tests/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | all = [] 16 | -------------------------------------------------------------------------------- /tc/graphene/python_worker/tests/hello/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | all = [] 16 | -------------------------------------------------------------------------------- /tc/graphene/python_worker/tests/hello_world_workload.json: -------------------------------------------------------------------------------- 1 | { 2 | "python-hello": { 3 | "module": "tests.hello.hello", 4 | "class": "HelloWorkLoad" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /tc/graphene/python_worker/tests/test_hello_work_orders.json: -------------------------------------------------------------------------------- 1 | { 2 | "workOrders": [ 3 | { 4 | "workloadId": "python-hello", 5 | "params": "Krsna" 6 | }, 7 | { 8 | "workloadId": "python-hello", 9 | "params": "Rama" 10 | }, 11 | { 12 | "workloadId": "python-hello", 13 | "params": "Shiva" 14 | }, 15 | { 16 | "workloadId": "python-hello", 17 | "params": "Ganesha" 18 | }, 19 | { 20 | "workloadId": "python-hello", 21 | "params": "Lakshmi" 22 | }, 23 | { 24 | "workloadId": "python-hello", 25 | "params": "Parvathy" 26 | } 27 | ] 28 | } 29 | 30 | -------------------------------------------------------------------------------- /tc/sgx/trusted_worker_manager/enclave/enclave.edl: -------------------------------------------------------------------------------- 1 | /* Copyright 2018 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | enclave { 17 | from "sgx_tstdc.edl" import *; 18 | from "sgx_tsgxssl.edl" import *; 19 | from "sgx_dcap_tvl.edl" import *; 20 | from "base.edl" import *; 21 | from "iohandler.edl" import *; 22 | from "signup.edl" import *; 23 | from "work_order.edl" import *; 24 | }; 25 | -------------------------------------------------------------------------------- /tc/sgx/trusted_worker_manager/enclave/enclave_common_t.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | // this header file includes worker specific header file generated from edl files 17 | // present in singleton or kme or wpe modules 18 | 19 | #ifdef BUILD_SINGLETON 20 | #include "singleton_enclave_t.h" 21 | #elif BUILD_KME 22 | #include "kme_enclave_t.h" 23 | #elif BUILD_WPE 24 | #include "wpe_enclave_t.h" 25 | #else 26 | #error Unknown enclave build argument 27 | #endif 28 | 29 | -------------------------------------------------------------------------------- /tc/sgx/trusted_worker_manager/enclave/kme/avalon_kme_enclave.config.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 0x90E7 19 | 1 20 | 0x80000 21 | 0x800000 22 | 2 23 | 1 24 | 0 25 | 0 26 | 0xFFFFFFFF 27 | 28 | -------------------------------------------------------------------------------- /tc/sgx/trusted_worker_manager/enclave/kme/avalon_kme_enclave.lds: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | kme_enclave.so 17 | { 18 | global: 19 | g_global_data_sim; 20 | g_global_data; 21 | enclave_entry; 22 | g_peak_heap_used; 23 | local: 24 | *; 25 | }; 26 | -------------------------------------------------------------------------------- /tc/sgx/trusted_worker_manager/enclave/kme/kme_enclave.edl: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | enclave { 17 | from "signup_kme.edl" import *; 18 | from "enclave.edl" import *; 19 | }; 20 | -------------------------------------------------------------------------------- /tc/sgx/trusted_worker_manager/enclave/signup_enclave_util.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #include 17 | 18 | void ComputeSHA256Hash(const std::string& src, uint8_t* data); 19 | -------------------------------------------------------------------------------- /tc/sgx/trusted_worker_manager/enclave/signup_helper.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2021 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #include "signup_helper.h" 17 | 18 | std::string SignupHelper::get_enclave_id() { 19 | return this->enclave_id; 20 | } 21 | 22 | std::string SignupHelper::get_enclave_encryption_key() { 23 | return this->enclave_encryption_key; 24 | } 25 | 26 | 27 | sgx_report_data_t SignupHelper::get_report_data() { 28 | return this->report_data; 29 | } 30 | 31 | -------------------------------------------------------------------------------- /tc/sgx/trusted_worker_manager/enclave/singleton/avalon_singleton_enclave.config.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 0x90E7 19 | 1 20 | 0x80000 21 | 0x800000 22 | 2 23 | 1 24 | 0 25 | 0 26 | 0xFFFFFFFF 27 | 28 | -------------------------------------------------------------------------------- /tc/sgx/trusted_worker_manager/enclave/singleton/avalon_singleton_enclave.lds: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | singleton_enclave.so 17 | { 18 | global: 19 | g_global_data_sim; 20 | g_global_data; 21 | enclave_entry; 22 | g_peak_heap_used; 23 | local: 24 | *; 25 | }; 26 | -------------------------------------------------------------------------------- /tc/sgx/trusted_worker_manager/enclave/singleton/singleton_enclave.edl: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | enclave { 17 | from "signup_singleton.edl" import *; 18 | from "enclave.edl" import *; 19 | }; 20 | -------------------------------------------------------------------------------- /tc/sgx/trusted_worker_manager/enclave/tcf_enclave.config.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 0x90E7 19 | 1 20 | 0x80000 21 | 0x800000 22 | 2 23 | 1 24 | 0 25 | 0 26 | 0xFFFFFFFF 27 | 28 | -------------------------------------------------------------------------------- /tc/sgx/trusted_worker_manager/enclave/tcf_enclave.lds: -------------------------------------------------------------------------------- 1 | /* Copyright 2018 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | enclave.so 17 | { 18 | global: 19 | g_global_data_sim; 20 | g_global_data; 21 | enclave_entry; 22 | g_peak_heap_used; 23 | local: 24 | *; 25 | }; 26 | -------------------------------------------------------------------------------- /tc/sgx/trusted_worker_manager/enclave/wpe/avalon_wpe_enclave.config.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 0x90E7 19 | 1 20 | 0x80000 21 | 0x800000 22 | 2 23 | 1 24 | 0 25 | 0 26 | 0xFFFFFFFF 27 | 28 | -------------------------------------------------------------------------------- /tc/sgx/trusted_worker_manager/enclave/wpe/avalon_wpe_enclave.lds: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | wpe_enclave.so 17 | { 18 | global: 19 | g_global_data_sim; 20 | g_global_data; 21 | enclave_entry; 22 | g_peak_heap_used; 23 | local: 24 | *; 25 | }; 26 | -------------------------------------------------------------------------------- /tc/sgx/trusted_worker_manager/enclave/wpe/wpe_enclave.edl: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | enclave { 17 | from "signup_wpe.edl" import *; 18 | from "enclave.edl" import *; 19 | }; 20 | -------------------------------------------------------------------------------- /tc/sgx/trusted_worker_manager/enclave_untrusted/enclave_bridge/attestation.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #include "attestation.h" 17 | 18 | Attestation::Attestation() {} 19 | 20 | Attestation::~Attestation() {} 21 | -------------------------------------------------------------------------------- /tc/sgx/trusted_worker_manager/enclave_untrusted/enclave_bridge/io_handler.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #include 17 | #include 18 | 19 | uint32_t ocall_Process(uint32_t handlerId, const uint8_t* command, 20 | size_t commandSize, uint8_t* result, size_t resultSize, const char* inBuf, 21 | size_t inBufSize, uint8_t* outBuf, size_t outBufSize); 22 | -------------------------------------------------------------------------------- /tc/sgx/trusted_worker_manager/enclave_untrusted/enclave_bridge/log.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2018 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #pragma once 17 | 18 | #include "tcf_error.h" 19 | 20 | namespace tcf { 21 | 22 | void SetLogFunction( 23 | tcf_log_t logFunction); 24 | 25 | void Log( 26 | tcf_log_level_t logLevel, 27 | const char* message, 28 | ...); 29 | 30 | uint64_t GetTimer(); 31 | } // namespace tcf 32 | -------------------------------------------------------------------------------- /tc/sgx/trusted_worker_manager/enclave_untrusted/enclave_bridge/signup.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2018 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #pragma once 17 | 18 | #include 19 | 20 | #include "types.h" 21 | 22 | class SignupData { 23 | public: 24 | static size_t CalculateSealedEnclaveDataSize(void); 25 | 26 | static size_t CalculatePublicEnclaveDataSize(void); 27 | }; 28 | -------------------------------------------------------------------------------- /tc/sgx/trusted_worker_manager/enclave_untrusted/enclave_bridge_wrapper/tcf_enclave.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2018 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #pragma once 17 | 18 | #include 19 | #include 20 | 21 | #include "work_order_wrap.h" 22 | 23 | void InitializeTCFEnclaveModule(); 24 | 25 | void _SetLogger( 26 | PyObject*); 27 | -------------------------------------------------------------------------------- /tc/sgx/trusted_worker_manager/enclave_untrusted/enclave_bridge_wrapper/work_order_wrap.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2018 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #include 17 | 18 | #include "types.h" 19 | 20 | // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 21 | std::string HandleWorkOrderRequest( 22 | const std::string& serializedRequest, 23 | const std::string& ext_wo_data); 24 | 25 | -------------------------------------------------------------------------------- /tc/sgx/trusted_worker_manager/tests/testCrypto.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2018 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #pragma once 17 | namespace tcf 18 | { 19 | namespace crypto 20 | { 21 | // test unit 22 | int testCrypto(); 23 | int testVerifyReport(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tc/sgx/trusted_worker_manager/tests/trusted/enclave/TestEnclave.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2018 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #ifndef _ENCLAVE_H_ 17 | #define _ENCLAVE_H_ 18 | 19 | #include 20 | #include 21 | 22 | #if defined(__cplusplus) 23 | extern "C" { 24 | #endif 25 | 26 | void printf(const char* fmt, ...); 27 | 28 | #if defined(__cplusplus) 29 | } 30 | #endif 31 | 32 | #endif /* !_ENCLAVE_H_ */ 33 | -------------------------------------------------------------------------------- /tc/sgx/trusted_worker_manager/tests/trusted/enclave/TestEnclave.lds: -------------------------------------------------------------------------------- 1 | /* Copyright 2018 Intel Corporation 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | TestEnclave.so 17 | { 18 | global: 19 | g_global_data_sim; 20 | g_global_data; 21 | TestEnclave_entry; 22 | local: 23 | *; 24 | }; 25 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __all__ = [ 16 | 'helpers' 17 | ] 18 | -------------------------------------------------------------------------------- /tests/json_requests/json_01.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkerLookUp", 4 | "id": 1, 5 | "params": { 6 | "workerType": 1 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/json_requests/json_02.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkerRetrieve", 4 | "id": 2, 5 | "params": { 6 | "workerId": "" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/json_requests/json_04.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkOrderGetResult", 4 | "id": 11, 5 | "params": { 6 | "workOrderId": "0x11ABCD" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/json_requests/json_05.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkOrderReceiptRetrieve", 4 | "id": 11, 5 | "params": { 6 | "workOrderId": "0x11ABCD" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/json_requests/json_06.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkOrderSubmit", 4 | "id": 12, 5 | "params": { 6 | "responseTimeoutMSecs": 6000, 7 | "payloadFormat": "JSON-RPC", 8 | "resultUri": "resulturi", 9 | "notifyUri": "notifyuri", 10 | "workOrderId": "0x11ABCE", 11 | "workerId":"", 12 | "workloadId": "echo-result", 13 | "requesterId": "0x3456453453453456", 14 | "dataEncryptionAlgorithm": "AES-GCM-256", 15 | "encryptedSessionKey": "sessionkey", 16 | "sessionKeyIv": "Iv", 17 | "requesterNonce": "", 18 | "encryptedRequestHash": "requesthash", 19 | "requesterSignature": "", 20 | "inData": [ 21 | {"index": 1, 22 | "data": "Hello world", 23 | "encryptedDataEncryptionKey": "", 24 | "iv": "" 25 | } 26 | ], 27 | "verifyingKey": "" 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /tests/json_requests/json_07.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkOrderGetResult", 4 | "id": 12, 5 | "params": { 6 | "workOrderId": "0x11ABCE" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/json_requests/json_09.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkOrderGetResult", 4 | "id": 13, 5 | "params": { 6 | "workOrderId": "0x23" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/json_requests/json_10.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkOrderSubmit", 4 | "id": 14, 5 | "params": { 6 | "responseTimeoutMSecs": 6000, 7 | "payloadFormat": "JSON-RPC", 8 | "resultUri": "resulturi", 9 | "notifyUri": "notifyuri", 10 | "workOrderId": "0x1234ABCD", 11 | "workerId":"", 12 | "workloadId": "heart-disease-eval", 13 | "requesterId": "0x3456453453453456", 14 | "dataEncryptionAlgorithm": "AES-GCM-256", 15 | "encryptedSessionKey": "sessionkey", 16 | "sessionKeyIv": "Iv", 17 | "requesterNonce": "", 18 | "encryptedRequestHash": "requesthash", 19 | "requesterSignature": "", 20 | "inData": [ 21 | {"index": 1, 22 | "data": "Heart disease evaluation data: 32 1 1 156 132 125 1 95 1 0 1 1 3 1", 23 | "encryptedDataEncryptionKey": "-", 24 | "iv": "" 25 | } 26 | ], 27 | "verifyingKey": "" 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /tests/json_requests/json_11.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkOrderGetResult", 4 | "id": 14, 5 | "params": { 6 | "workOrderId": "0x1234ABCD" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/json_requests/json_12.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkOrderSubmit", 4 | "id": 15, 5 | "params": { 6 | "responseTimeoutMSecs": 6000, 7 | "payloadFormat": "JSON-RPC", 8 | "resultUri": "resulturi", 9 | "notifyUri": "notifyuri", 10 | "workOrderId": "0x1234FFFF", 11 | "workerId":"", 12 | "workloadId": "heart-disease-eval", 13 | "requesterId": "0x3456453453453456", 14 | "workerEncryptionKey": "0xabcdef", 15 | "dataEncryptionAlgorithm": "AES-GCM-256", 16 | "encryptedSessionKey": "sessionkey", 17 | "sessionKeyIv": "Iv", 18 | "requesterNonce": "", 19 | "encryptedRequestHash": "requesthash", 20 | "requesterSignature": "", 21 | "inData": [ 22 | {"index": 1, 23 | "data": "Heart disease evaluation data: 32 1 1 156 132 125 1 95 1 0 1 1 3 1", 24 | "encryptedDataEncryptionKey": "null", 25 | "iv": "" 26 | } 27 | ], 28 | "verifyingKey": "" 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /tests/json_requests/json_13.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkOrderGetResult", 4 | "id": 15, 5 | "params": { 6 | "workOrderId": "0x1234FFFF" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/signature/wo_request_01.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkerLookUp", 4 | "id": 1, 5 | "params": { 6 | "workerType": 1 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/signature/wo_request_02.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkerRetrieve", 4 | "id": 2, 5 | "params": { 6 | "workerId": "" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/signature/wo_request_03.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkOrderSubmit", 4 | "id": 11, 5 | "params": { 6 | "responseTimeoutMSecs": 6000, 7 | "payloadFormat": "JSON-RPC", 8 | "resultUri": "resulturi", 9 | "notifyUri": "notifyuri", 10 | "workOrderId": "0x22ABCD", 11 | "workerId":"", 12 | "workloadId": "heart-disease-eval", 13 | "requesterId": "0x3456", 14 | "dataEncryptionAlgorithm": "AES-GCM-256", 15 | "encryptedSessionKey": "sessionkey", 16 | "sessionKeyIv": "Iv", 17 | "requesterNonce": "", 18 | "encryptedRequestHash": "", 19 | "requesterSignature": "", 20 | "inData": [ 21 | {"index": 1, 22 | "data": "Heart disease evaluation data: 32 1 1 156 132 125 1 95 1 0 1 1 3 1", 23 | "encryptedDataEncryptionKey": "", 24 | "iv": "" 25 | } 26 | ], 27 | "verifyingKey": "" 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /tests/signature/wo_request_04.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkOrderGetResult", 4 | "id": 11, 5 | "params": { 6 | "workOrderId": "0x22ABCD" 7 | } 8 | } 9 | 10 | -------------------------------------------------------------------------------- /tests/signature/wo_request_05.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkOrderReceiptRetrieve", 4 | "id": 11, 5 | "params": { 6 | "workOrderId": "0x22ABCD" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/test_utility/test_file_utils/path_test_file: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Intel Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | #### Test file to test file presence 16 | -------------------------------------------------------------------------------- /tests/test_utility/test_file_utils/sample1.json: -------------------------------------------------------------------------------- 1 | { 2 | "field1": 1, 3 | "field2": 2 4 | } 5 | -------------------------------------------------------------------------------- /tests/test_utility/test_file_utils/sample2.json: -------------------------------------------------------------------------------- 1 | {"field1":1,"field2":2} 2 | -------------------------------------------------------------------------------- /tests/test_utility/test_file_utils/sample3.json: -------------------------------------------------------------------------------- 1 | { 2 | 1:"one", 3 | 2:"two", 4 | 3:["one","two","three"] 5 | } 6 | -------------------------------------------------------------------------------- /tests/work_orders/01_worker_lookup.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkerLookUp", 4 | "id": 1, 5 | "params": { 6 | "workerType": 1 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/work_orders/01a_worker_retrieve.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkerRetrieve", 4 | "id": 2, 5 | "params": { 6 | "workerId": "" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/work_orders/02_work_order_encryptionkey_get.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "EncryptionKeyGet", 4 | "id": 3, 5 | "params": { 6 | "workerId": "123", 7 | "lastUsedKeyNonce": "", 8 | "tag": "", 9 | "requesterId": "", 10 | "signatureNonce": "", 11 | "signature": "" 12 | } 13 | } -------------------------------------------------------------------------------- /tests/work_orders/03_work_order_encryptionkey_set.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "EncryptionKeySet", 4 | "id": 4, 5 | "params": { 6 | "workerId": "123", 7 | "encryptionKey": "", 8 | "encryptionKeyNonce": "", 9 | "tag": "", 10 | "signatureNonce": "", 11 | "signature": "" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/work_orders/04_work_order_submit.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkOrderSubmit", 4 | "id": 5, 5 | "params": { 6 | "responseTimeoutMSecs": 6000, 7 | "payloadFormat": "JSON-RPC", 8 | "resultUri": "resulturi", 9 | "notifyUri": "notifyuri", 10 | "workOrderId": "0x11", 11 | "workerId":"", 12 | "workloadId": "heart-disease-eval", 13 | "requesterId": "0x3456", 14 | "dataEncryptionAlgorithm": "AES-GCM-256", 15 | "encryptedSessionKey": "sessionkey", 16 | "sessionKeyIv": "Iv", 17 | "requesterNonce": "", 18 | "encryptedRequestHash": "", 19 | "requesterSignature": "", 20 | "inData": [ 21 | {"index": 1, 22 | "data": "Heart disease evaluation data: 32 1 1 156 132 125 1 95 1 0 1 1 3 1", 23 | "encryptedDataEncryptionKey": "", 24 | "iv": "" 25 | } 26 | ], 27 | "verifyingKey": "" 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /tests/work_orders/05_work_order_get_result.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkOrderGetResult", 4 | "id": 6, 5 | "params": { 6 | "workOrderId": "0x11" 7 | } 8 | } 9 | 10 | -------------------------------------------------------------------------------- /tests/worker/worker_01.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkerRegister", 4 | "id": 1, 5 | "params": { 6 | "workerId":"123", 7 | "workerType":321, 8 | "organizationId":"0Xd", 9 | "applicationTypeId": "0XAD", 10 | "workerEncryptionKey" : " " , 11 | "details": { 12 | "hashingAlgorithm": "SHA-256", 13 | "signingAlgorithm": "SECP256K1" , 14 | "keyEncryptionAlgorithm": "RSA-OAEP-3072" , 15 | "dataEncryptionAlgorithm": "AES-GCM-256" , 16 | "workerTypeData": { 17 | "verificationKey": "0xA", 18 | "encryptionKey": "ekey", 19 | "encryptionKeyNonce": "enounce", 20 | "encryptionKeySignature": "esig", 21 | "enclaveCertificate": "ecert" 22 | } 23 | } 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /tests/worker/worker_01a.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkerRetrieve", 4 | "id": 11, 5 | "params": { 6 | "workerId":"123" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/worker/worker_02.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkerUpdate", 4 | "id": 2, 5 | "params": { 6 | "workerId":"123", 7 | "details":{ 8 | "hashingAlgorithm": "KECCAK-256" 9 | } 10 | } 11 | } 12 | 13 | -------------------------------------------------------------------------------- /tests/worker/worker_03.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkerSetStatus", 4 | "id": 3, 5 | "params": { 6 | "workerId": "123", 7 | "status": 1 8 | } 9 | } 10 | 11 | -------------------------------------------------------------------------------- /tests/worker/worker_04.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkerRetrieve", 4 | "id": 1, 5 | "params": { 6 | "workerId":"123" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/worker/worker_05.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkerLookUp", 4 | "id": 3, 5 | "params": { 6 | "workerType": 123, 7 | "organizationId": "0XD" 8 | } 9 | } 10 | 11 | -------------------------------------------------------------------------------- /tests/workorder_receipt/workorderreceipt_01.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkOrderReceiptCreate", 4 | "id": 90, 5 | "params": { 6 | "workOrderId": "90", 7 | "workerServiceId": "50", 8 | "workerId": "90", 9 | "requesterId":"r_id", 10 | "requesterGeneratedNonce": "r_nounce", 11 | "requesterSignature":"r_sig", 12 | "receiptCreateStatus":0, 13 | "workOrderRequestHash": "whash", 14 | "signatureRules": "SHA-256/RSA-OAEP-4096" 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /tests/workorder_receipt/workorderreceipt_02.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkOrderReceiptUpdate", 4 | "id": 90, 5 | "params": { 6 | "workOrderId": "90", 7 | "updaterId": "u1", 8 | "updateType": 1, 9 | "updateData": "", 10 | "updateSignature": "uSig", 11 | "signatureRules": "SHA-256/RSA-OAEP-4096" 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /tests/workorder_receipt/workorderreceipt_02a.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkOrderReceiptUpdate", 4 | "id": 90, 5 | "params": { 6 | "workOrderId": "90", 7 | "updaterId": "u1", 8 | "updateType": 2, 9 | "updateData": "", 10 | "updateSignature": "uSig", 11 | "signatureRules": "SHA-256/RSA-OAEP-4096" 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /tests/workorder_receipt/workorderreceipt_02b.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkOrderReceiptUpdate", 4 | "id": 90, 5 | "params": { 6 | "workOrderId": "90", 7 | "updaterId": "u2", 8 | "updateType": 1, 9 | "updateData": "", 10 | "updateSignature": "uSig", 11 | "signatureRules": "SHA-256/RSA-OAEP-4096" 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /tests/workorder_receipt/workorderreceipt_03.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkOrderReceiptRetrieve", 4 | "id": 90, 5 | "params": { 6 | "workOrderId":"90" 7 | } 8 | } 9 | 10 | -------------------------------------------------------------------------------- /tests/workorder_receipt/workorderreceipt_04.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkOrderReceiptLookUp", 4 | "id": 90, 5 | "params": { 6 | "workerServiceId":"50" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/workorder_receipt/workorderreceipt_05.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkOrderReceiptCreate", 4 | "id": 81, 5 | "params": { 6 | "workOrderId": "81", 7 | "workerServiceId": "50", 8 | "workerId": "81", 9 | "requesterId":"r_id", 10 | "requesterGeneratedNonce": "r_nounce", 11 | "requesterSignature":"r_sig" 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /tests/workorder_receipt/workorderreceipt_07.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkOrderReceiptLookUpNext", 4 | "id": 90, 5 | "params": { 6 | "workerServiceId": 50, 7 | "lastLookUpTag": 90 8 | } 9 | } 10 | 11 | -------------------------------------------------------------------------------- /tests/workorder_receipt/workorderreceipt_08.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "method": "WorkOrderReceiptUpdateRetrieve", 4 | "id": 90, 5 | "params": { 6 | "workOrderId": "90", 7 | "updaterId": "u1", 8 | "updateIndex": 1 9 | } 10 | } 11 | 12 | --------------------------------------------------------------------------------