Skip to content

Commit

Permalink
Project import generated by Copybara.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 191113399
GitOrigin-RevId: cfebd59d1f086e907f468004c7d033199d116fad
  • Loading branch information
thaidn committed Apr 4, 2018
1 parent 72412ae commit 31387e2
Show file tree
Hide file tree
Showing 95 changed files with 131,371 additions and 22 deletions.
186 changes: 186 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
# java

java_library(
name = "utils",
srcs = [
"java/com/google/security/wycheproof/EcUtil.java",
"java/com/google/security/wycheproof/RandomUtil.java",
"java/com/google/security/wycheproof/TestUtil.java",
],
)

common_deps = [
":utils",
"@com_google_code_gson",
"@junit",
]

test_srcs = glob([
"java/**/WycheproofRunner.java",
"java/**/testcases/*Test.java",
])

# These targets run all tests.

load("//tools:build_defs.bzl", "bouncycastle_all_tests", "spongycastle_all_tests")

# Generates BouncyCastleAllTests_1_xx target for all available versions,
# plus a BouncyCastleAllTests alias for latest stable.
#
# To test latest stable:
# $ bazel test BouncyCastleAllTests
#
# To test other versions, e.g., v1.52:
# $ bazel test BouncyCastleAllTests_1_52
#
# To test all known versions (warning, will take a long time):
# $ bazel test BouncyCastleAllTest_*
bouncycastle_all_tests(
# This test takes a long time, because key generation for DSA and DH generate new parameters.
size = "large",
srcs = ["java/com/google/security/wycheproof/BouncyCastleAllTests.java"] + test_srcs,
test_class = "com.google.security.wycheproof.BouncyCastleAllTests",
deps = common_deps,
)

java_test(
name = "BouncyCastleAllTestsLocal",
size = "large",
srcs = ["java/com/google/security/wycheproof/BouncyCastleAllTests.java"] + test_srcs,
# this target requires specifing a shell variable, thus won't work with the wildcard target patterns.
# with tags=["manual"] it'll be excluded from said patterns.
tags = ["manual"],
test_class = "com.google.security.wycheproof.BouncyCastleAllTests",
deps = common_deps + ["@local//:bouncycastle_jar"],
)

# Generates SpongyCastleAllTests_1_xx target for all available versions,
# plus a SpongyCastleAllTests alias for latest stable.
#
# To test latest stable:
# $ bazel test SpongyCastleAllTests
#
# To test other versions, e.g., v1.52.0.0:
# $ bazel test SpongyCastleAllTests_1_52
#
# To test all known versions (warning, will take a long time):
# $ bazel test SpongyCastleAllTests_*
spongycastle_all_tests(
# This test takes a long time, because key generation for DSA and DH generate new parameters.
size = "large",
srcs = ["java/com/google/security/wycheproof/SpongyCastleAllTests.java"] + test_srcs,
test_class = "com.google.security.wycheproof.SpongyCastleAllTests",
deps = common_deps,
)

# These targets exclude slow tests.

load("//tools:build_defs.bzl", "bouncycastle_tests", "spongycastle_tests")

# Generates BouncyCastleTest_1_xx target for all available versions,
# plus a BouncyCastleTest alias for latest stable.
#
# To test latest stable:
# $ bazel test BouncyCastleTest
#
# To test other versions, e.g., v1.52:
# $ bazel test BouncyCastleTest_1_52
#
# To test all known versions:
# $ bazel test BouncyCastleTest_*
bouncycastle_tests(
size = "large",
srcs = ["java/com/google/security/wycheproof/BouncyCastleTest.java"] + test_srcs,
test_class = "com.google.security.wycheproof.BouncyCastleTest",
deps = common_deps,
)

java_test(
name = "BouncyCastleTestLocal",
size = "large",
srcs = ["java/com/google/security/wycheproof/BouncyCastleTest.java"] + test_srcs,
# this target requires specifing a shell variable, thus won't work with the wildcard target patterns.
# with tags=["manual"] it'll be excluded from said patterns.
tags = ["manual"],
test_class = "com.google.security.wycheproof.BouncyCastleTest",
deps = common_deps + ["@local//:bouncycastle_jar"],
)

# Generates SpongyCastleTest_1_xx target for all available versions,
# plus a SpongyCastleTest alias for latest stable.
#
# To test latest stable:
# $ bazel test SpongyCastleTest
#
# To test other versions, e.g., v1.52.0.0:
# $ bazel test SpongyCastleTest_1_52
#
# To test all known versions:
# $ bazel test SpongyCastleTest_*
spongycastle_tests(
size = "large",
srcs = ["java/com/google/security/wycheproof/SpongyCastleTest.java"] + test_srcs,
test_class = "com.google.security.wycheproof.SpongyCastleTest",
deps = common_deps,
)

# Conscrypt tests
load("//tools:build_defs.bzl", "conscrypt_tests", "conscrypt_all_tests")

conscrypt_tests(
size = "large",
srcs = ["java/com/google/security/wycheproof/ConscryptTest.java"] + test_srcs,
test_class = "com.google.security.wycheproof.ConscryptTest",
deps = common_deps,
)

conscrypt_all_tests(
size = "large",
srcs = ["java/com/google/security/wycheproof/ConscryptAllTests.java"] + test_srcs,
test_class = "com.google.security.wycheproof.ConscryptAllTests",
deps = common_deps,
)

# OpenJDK tests
java_test(
name = "OpenJDKTest",
size = "large",
srcs = ["java/com/google/security/wycheproof/OpenJDKTest.java"] + test_srcs,
test_class = "com.google.security.wycheproof.OpenJDKTest",
deps = common_deps,
)

java_test(
name = "OpenJDKAllTests",
size = "large",
srcs = ["java/com/google/security/wycheproof/OpenJDKAllTests.java"] + test_srcs,
test_class = "com.google.security.wycheproof.OpenJDKAllTests",
deps = common_deps,
)

# Platform-independent tests
java_test(
name = "ProviderIndependentTest",
size = "small",
srcs = ["java/com/google/security/wycheproof/ProviderIndependentTest.java"] + test_srcs,
deps = common_deps,
)

# Tests using JSON formatted test vectors.

java_test(
name = "JsonTest",
size = "small",
srcs = ["java/com/google/security/wycheproof/JsonTest.java"] + test_srcs,
data = ["//testvectors:all"],
deps = common_deps,
)

# javascript

load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_deps")

closure_js_deps(
name = "E2EDeps",
deps = ["@google_e2e//:e2e"],
)
43 changes: 43 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Want to contribute? Great! First, read this page (including the small print at
the end).

### Before you contribute
Before we can use your code, you must sign the
[Google Individual Contributor License Agreement]
(https://cla.developers.google.com/about/google-individual)
(CLA), which you can do online. The CLA is necessary mainly because you own the
copyright to your changes, even after your contribution becomes part of our
codebase, so we need your permission to use and distribute your code. We also
need to be sure of various other things—for instance that you'll tell us if you
know that your code infringes on other people's patents. You don't have to sign
the CLA until after you've submitted your code for review and a member has
approved it, but you must do it before we can put your code into our codebase.
Before you start working on a larger contribution, you should get in touch with
us first through the issue tracker with your idea so that we can help out and
possibly guide you. Coordinating up front makes it much easier to avoid
frustration later on.

### Disclosure
If your tests uncover security vulnerabilities, please first report directly to
the maintainers of the libraries. You should only submit tests to us once the
bugs have been acknowledged or fixed.

Google has several
[security reward programs](https://www.google.com/about/appsecurity/programs-home/)
that provide cash rewards for quality security research that identifies or fixes
security vulnerabilities in products that we provide or proactive security
improvements to select open-source products. If your tests found or helped fix
vulnerabilities that are in scope you should submit them to these programs.

If you have any question with regard to disclosure, please email us at
[email protected].

### Code reviews
All submissions, including submissions by project members, require review. We
use GitHub pull requests for this purpose.

### The small print
Contributions made by corporations are covered by a different agreement than
the one above, the
[Software Grant and Corporate Contributor License Agreement]
(https://cla.developers.google.com/about/google-corporate).
Loading

0 comments on commit 31387e2

Please sign in to comment.