Tink C++ 2.2.0
Tink is a multi-language, cross-platform library that provides simple and misuse-proof APIs for common cryptographic tasks.
This is Tink C++ 2.2.0.
To get started using Tink, see the setup guide.
CMake
You can import Tink C++ as an in-tree dependency.
cmake_minimum_required(VERSION 3.13)
project(Example CXX)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_BUILD_TYPE Release)
# Import Tink as an in-tree dependency.
# Option 1: tink-cc is in third_party.
add_subdirectory(third_party/tink-cc tink)
# Option 2: Use FetchContent
# include(FetchContent)
#
# FetchContent_Declare(
# tink
# URL https://github.com/tink-crypto/tink-cc/archive/refs/tags/v2.2.0.zip
# URL_HASH SHA256=88e1442182452caa16d0954ceaf73e17b0aa30837ee6c0cc16bf0112313ce753
# )
# FetchContent_GetProperties(tink)
# if(NOT googletest_POPULATED)
# FetchContent_Populate(tink)
# add_subdirectory(${tink_SOURCE_DIR} ${tink_BINARY_DIR} EXCLUDE_FROM_ALL)
# endif()
add_executable(example_app example_app.cc)
target_link_libraries(example_app tink::static)
Bazel
workspace(name = "example")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "com_github_tink_crypto_tink_cc",
urls = ["https://github.com/tink-crypto/tink-cc/archive/refs/tags/v2.2.0.zip"],
strip_prefix = "tink-cc-2.2.0",
sha256 = "88e1442182452caa16d0954ceaf73e17b0aa30837ee6c0cc16bf0112313ce753",
)
# Load Tink dependencies.
load("@com_github_tink_crypto_tink_cc//:tink_cc_deps.bzl", "tink_cc_deps")
tink_cc_deps()
load("@com_github_tink_crypto_tink_cc//:tink_cc_deps_init.bzl", "tink_cc_deps_init")
tink_cc_deps_init()
# ... Your dependencies here ...
What's new
The complete list of changes since 2.1.0 can be found here.
-
Added APIs to import and export keys for the following key types:
- AES-CTR-HMAC-AEAD
- AES-EAX
- ECDSA
- ECIES
- JWT ECDSA
- JWT HMAC
- XChaCha20-Poly1305
-
Removed the method
HmacPrfKeyManager::MaxOutputLength
from the public
API. This method was never intended to be public and there is no reason
to assume anyone uses it. -
Enabled building against pre-installed protobuf with CMake.
-
Moved Bazel test-only deps to
tink_cc_testonly_deps()
. -
Dependency upgrades:
- protobuf (=> 26.1)
- googletest (=> 1.14)
- absl (=> 20230802.1)
- BoringSSL (=> 07fa2780386fbbc001937fabf116c1fe4ddd2705)
- bazel_skylib (=> 1.5.0)
- Bazel (=> 6.4.0)
-
Added class to represent elliptic curve points.
-
Added
SecretDataEquals
.SecretData::operator==
is currently not
constant time, and should not be called by users. Tink 3.0 will change
this, but in the mean time, it should not be called and SecretDataEquals
should be used instead.
Future
To see what we're working towards, check our project roadmap.