Tink C++ 2.1.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.1.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)
# Assumes tink-cc is in third_party.
add_subdirectory(third_party/tink-cc tink)
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.1.0.zip"],
strip_prefix = "tink-cc-2.1.0",
sha256 = "3804afecbe7096d3786b660e9cd5f365f064743eec52d76984abb9da38dd0fb3",
)
# 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.0.0 can be found here.
- Tink now supports building with OpenSSL 3.0 (commit)
- Tink now supports key derivation (commit)
- For the following key types, an API to import and export keys has been added:
(When exporting, this can be used with KeysetHandle::operator[]
and a dynamic cast. When importing keys, this can be used with the KeysetHandleBuilder
)
- Methods
KeysetHandle::GetPrimitive
,KeysetHandle::GenerateNew
, andKeysetHandle::GetPublicKeysetHandle
now take a configuration argument - Tink defines
crypto::tink::ConfigV0()
andcrypto::tink::ConfigFips140_2()
- Upgraded dependencies:
- The abseil dependency has been upgraded to LTS 20230802.0
- Bug-fixing
- Calling
RandomAccessStream::size()
forRandomAccessStream
objects obtained fromStreamingAead::NewDecryptingRandomAccessStream
now attempts to find the correct key in the keyset. Previously, users had to first callPRead
to make sure callingsize
works. (commit)
- Calling
Future work
To see what we're working towards, check our project roadmap.