Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Choncholas committed Aug 15, 2023
0 parents commit 33a2696
Show file tree
Hide file tree
Showing 65 changed files with 5,672 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .bazeliskrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
USE_BAZEL_VERSION=6.3.1
BAZELISK_VERIFY_SHA256=81130d324e145dcf3192338b875669fe5f410fef26344985dd4cdcdb1c7cab5b
2 changes: 2 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
BasedOnStyle: Google
QualifierAlignment: Right
12 changes: 12 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM mcr.microsoft.com/vscode/devcontainers/base:ubuntu-22.04

# Install Bazel
ARG BAZELISK_VERSION=v1.10.1
ARG BAZELISK_DOWNLOAD_SHA=dev-mode
RUN curl -fSsL -o /usr/local/bin/bazelisk https://github.com/bazelbuild/bazelisk/releases/download/${BAZELISK_VERSION}/bazelisk-linux-amd64 \
&& ([ "${BAZELISK_DOWNLOAD_SHA}" = "dev-mode" ] || echo "${BAZELISK_DOWNLOAD_SHA} */usr/local/bin/bazelisk" | sha256sum --check - ) \
&& chmod 0755 /usr/local/bin/bazelisk

RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get install -y python3 python3-pip python-is-python3 clang-format python3-venv cloc \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts
35 changes: 35 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "Bazel (Community)",
"build": {
"dockerfile": "Dockerfile",
"args": {
"BAZELISK_VERSION": "v1.17.0",
"BAZELISK_DOWNLOAD_SHA": "61699e22abb2a26304edfa1376f65ad24191f94a4ffed68a58d42b6fee01e124"
}
},

// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python",
"ms-vscode.cpptools-extension-pack",
"BazelBuild.vscode-bazel",
"minherz.copyright-inserter"
]
}
},

"mounts": [ "source=/tmp,target=/tmp,type=bind,consistency=cached" ],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
//"postCreateCommand": "echo hi",
// Uncomment when using a ptrace-based debugger like C++, Go, and Rust
// "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],
// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
bazel-bin
bazel-tfshell
bazel-out
bazel-testlogs
requirements.txt
__pycache__
.bazelrc
**.venv
*.whl
MODULE.bazel.lock
90 changes: 90 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"files.associations": {
"*.inc": "cpp",
"any": "cpp",
"bit": "cpp",
"array": "cpp",
"fstream": "cpp",
"functional": "cpp",
"future": "cpp",
"system_error": "cpp",
"compare": "cpp",
"new": "cpp",
"string": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"*.tcc": "cpp",
"optional": "cpp",
"regex": "cpp",
"atomic": "cpp",
"bitset": "cpp",
"cctype": "cpp",
"cfenv": "cpp",
"chrono": "cpp",
"cinttypes": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"codecvt": "cpp",
"complex": "cpp",
"concepts": "cpp",
"condition_variable": "cpp",
"csignal": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"forward_list": "cpp",
"list": "cpp",
"map": "cpp",
"set": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"vector": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"iterator": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"random": "cpp",
"ratio": "cpp",
"string_view": "cpp",
"utility": "cpp",
"hash_map": "cpp",
"hash_set": "cpp",
"slist": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"limits": "cpp",
"mutex": "cpp",
"numbers": "cpp",
"ostream": "cpp",
"scoped_allocator": "cpp",
"semaphore": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"stop_token": "cpp",
"streambuf": "cpp",
"thread": "cpp",
"typeindex": "cpp",
"typeinfo": "cpp",
"valarray": "cpp",
"variant": "cpp"
},
"search.exclude": {
"**/.git": true,
"**/bazel-*": true,
},
"editor.tabSize": 2,
"bazel.enableCodeLens": true,
"bazel.executable": "bazelisk"
}
17 changes: 17 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "cd test-project && bazel build",
"type": "shell",
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
}
]
}
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Google Inc.
90 changes: 90 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
load("//:version.bzl", "VERSION_LABEL")
load("@rules_python//python:pip.bzl", "compile_pip_requirements")
load("@pip//:requirements.bzl", "requirement")
load("@rules_python//python:defs.bzl", "py_binary")
load("@rules_python//python:packaging.bzl", "py_wheel")
load("@buildifier_prebuilt//:rules.bzl", "buildifier")

exports_files([
"LICENSE",
"setup.py",
"requirements.in",
"requirements.txt",
"README.md",
"DESCRIPTION.md",
])

compile_pip_requirements(
name = "requirements",
extra_args = ["--allow-unsafe"], # need setuptools
requirements_in = "//:requirements.in",
requirements_txt = "//:requirements.txt",
visibility = ["//visibility:public"],
)

buildifier(
name = "bazel_formatter",
exclude_patterns = [
"./bazel-*/*",
"./.git/*",
],
lint_mode = "warn",
)

py_binary(
name = "python_formatter",
srcs = ["//tools:python_formatter.py"],
python_version = "PY3",
srcs_version = "PY3",
visibility = [
"//:__pkg__",
],
deps = [
requirement("black"),
],
)

py_binary(
name = "clang_formatter",
srcs = ["//tools:clang_formatter.py"],
python_version = "PY3",
srcs_version = "PY3",
visibility = [
"//:__pkg__",
],
)

py_wheel(
name = "wheel",
abi = "ABI",
author = "Google Inc.",
author_email = "[email protected]",
classifiers = [
"Programming Language :: Python :: 3",
"Topic :: Security :: Cryptography",
],
description_file = "//:DESCRIPTION.md",
distribution = "tf-shell",
extra_distinfo_files = {
"//:LICENSE": "LICENSE",
"//:README.md": "README",
},
homepage = "https://github.com/google/tf-shell",
license = "Apache 2.0",
platform = select({
"@bazel_tools//src/conditions:windows_x64": "win_amd64",
"@bazel_tools//src/conditions:windows_arm64": "win_arm64",
"@bazel_tools//src/conditions:darwin_x86_64": "macosx_12_0_x86_64",
"@bazel_tools//src/conditions:darwin_arm64": "macosx_12_0_arm64",
"@bazel_tools//src/conditions:linux_x86_64": "LINUX_x86_64",
"@bazel_tools//src/conditions:linux_aarch64": "LINUX_aarch64",
}),
python_requires = ">=3.8.0",
python_tag = "INTERPRETER",
requires = ["tensorflow-cpu==2.13.0"],
version = VERSION_LABEL,
deps = [
"//shell_ml:shell_ml_pkg",
"//shell_tensor:shell_tensor_pkg",
],
)
33 changes: 33 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# How to contribute

We'd love to accept your patches and contributions to this project.

## Before you begin

### Sign our Contributor License Agreement

Contributions to this project must be accompanied by a
[Contributor License Agreement](https://cla.developers.google.com/about) (CLA).
You (or your employer) retain the copyright to your contribution; this simply
gives us permission to use and redistribute your contributions as part of the
project.

If you or your current employer have already signed the Google CLA (even if it
was for a different project), you probably don't need to do it again.

Visit <https://cla.developers.google.com/> to see your current agreements or to
sign a new one.

### Review our community guidelines

This project follows
[Google's Open Source Community Guidelines](https://opensource.google/conduct/).

## Contribution process

### Code reviews

All submissions, including submissions by project members, require review. We
use GitHub pull requests for this purpose. Consult
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
information on using pull requests.
1 change: 1 addition & 0 deletions DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TFShell: Tensorflow integration for the SHELL encryption library
Loading

0 comments on commit 33a2696

Please sign in to comment.