This repository holds a Rust port of Google's Tink cryptography library.
The following warnings apply to use of this repo:
- This is not an official port of Tink, and is not supported by Google's cryptography teams.
- The repo is under construction and so details of the API and the code may change without warning.
Also, this repository does not implement cryptographic functionality itself; the underlying cryptographic operations are currently provided by the RustCrypto crates – this repo focuses on making those cryptographic operations available via the Tink API.
This means that all of the security warnings for the underlying RustCrypto crates apply to this repo too.
This is not an officially supported Google product.
An introduction to working with the Tink API is provided here.
The tink-core
crate holds common functionality and includes the trait
definitions for all
primitives, but includes
very little cryptographic functionality.
Individual cryptographic primitives are implemented in tink-<primitive>
crates, which depend on:
- the
tink-core
crate for common types and helpers - the
tink-proto
crate for protobuf-derivedstruct
s - the RustCrypto crates to provide underlying cryptographic implementations.
For example, the tink-aead
crate provides code that performs authenticated encryption with additional data (AEAD),
implementing the Aead
trait from tink-core
.
All of the tests for the Tink crates are integration tests (i.e. only use public APIs) and reside in a separate
tink-tests
crate.
The following crate features are available.
- The
tink-proto
crate has ajson
feature that enables methods for serializing keysets to/from JSON. This additional functionality requiresserde
andserde_json
as dependencies. - The
tink-core
crate also has ajson
feature that enables methods for serializing keysets to/from JSON, usingtink-proto/json
as above. - The
tink-core
crate also has aninsecure
feature, which enables methods that expose unencrypted key material. This feature should only be enabled for testing and development.
A separate document describes the design choices involved in the Rust port.