Revision d0fc5d3e836f7d466341b83c75d9209aa0e38d68 authored by juerg on 11 March 2024, 19:51:28 UTC, committed by Copybara-Service on 11 March 2024, 19:53:06 UTC
It tests encrypting and decrypting 1k data with different algorithms.

It also adds tests for algorithms that are supported but don't have templates:
- curve P-384 and curve P-521.
- AES-SIV as DEK.

Output on a Xeon CPU:
BenchmarkEncrypt/HPKE_X25519_AES128GCM-8                    6207            195023 ns/op           12713 B/op         89 allocs/op
BenchmarkEncrypt/HPKE_X25519_Chacha20Poly1305-8             6316            190371 ns/op            9384 B/op         78 allocs/op
BenchmarkEncrypt/ECIES_P256_AES128GCM-8                     9159            128020 ns/op            8368 B/op         63 allocs/op
BenchmarkEncrypt/ECIES_P256_AES128CTRHMAC-8                 8188            143934 ns/op           11744 B/op         83 allocs/op
BenchmarkEncrypt/ECIES_P384_AES128GCM-8                     1159           1035242 ns/op            9896 B/op         78 allocs/op
BenchmarkEncrypt/ECIES_P521_AES128GCM-8                      379           3344359 ns/op           11410 B/op         79 allocs/op
BenchmarkEncrypt/ECIES_P256_AESSIV-8                        8876            140409 ns/op            8784 B/op         75 allocs/op
BenchmarkDecrypt/HPKE_X25519_AES128GCM-8                    6236            193576 ns/op           10376 B/op         86 allocs/op
BenchmarkDecrypt/HPKE_X25519_Chacha20Poly1305-8             6615            188628 ns/op            6920 B/op         75 allocs/op
BenchmarkDecrypt/ECIES_P256_AES128GCM-8                    10000            109699 ns/op            8848 B/op         61 allocs/op
BenchmarkDecrypt/ECIES_P256_AES128CTRHMAC-8                10000            118861 ns/op            8392 B/op         72 allocs/op
BenchmarkDecrypt/ECIES_P384_AES128GCM-8                     1494            802661 ns/op           10048 B/op         73 allocs/op
BenchmarkDecrypt/ECIES_P521_AES128GCM-8                      478           2513675 ns/op           11040 B/op         73 allocs/op
BenchmarkDecrypt/ECIES_P256_AESSIV-8                       10000            116103 ns/op            6984 B/op         66 allocs/op

PiperOrigin-RevId: 614762423
1 parent 239cf37
History
File Mode Size
examples
testdata
tink
tools
.bazelignore -rw-r--r-- 9 bytes
.bazelrc -rw-r--r-- 1.3 KB
.bazelversion -rw-r--r-- 6 bytes
BUILD.bazel -rw-r--r-- 0 bytes
MANIFEST.in -rw-r--r-- 575 bytes
README.md -rw-r--r-- 1.0 KB
VERSION -rw-r--r-- 76 bytes
WORKSPACE -rw-r--r-- 588 bytes
requirements.in -rw-r--r-- 89 bytes
requirements.txt -rw-r--r-- 1.5 KB
requirements_all.txt -rw-r--r-- 16.6 KB
requirements_awskms.in -rw-r--r-- 15 bytes
requirements_gcpkms.in -rw-r--r-- 69 bytes
requirements_hcvault.in -rw-r--r-- 45 bytes
setup.py -rw-r--r-- 9.9 KB
tink_py_deps.bzl -rw-r--r-- 1.7 KB
tink_py_deps_init.bzl -rw-r--r-- 809 bytes

README.md

back to top