This is Tink Go 2.3.0
What's new
The complete list of changes since 2.2.0 can be found here.
New APIs
Keyset Handle and Manager
- Added methods to
keyset.Handle
:Len()
,Primary()
, andEntry(i int)
. keyset.Manager
makes a deep copy of the keyset on calls toHandle()
.- Added
AddKey
andAddNewKeyFromParameters
tokeyset.Manager
- Added
Key
andParameters
interface which represent keys and their
parameters. Addedkey.Parameters
andkey.Key
definitions for:- AEAD
- AES-CTR-HMAC
- AES-GCM
- AES-GCM-SIV
- ChaCha20Poly1305
- X-AES-GCM
- XChaCha20Poly1305
- Signature
- Ed25519
- ECDSA
- RSA-SSA-PKCS1
- RSA-SSA-PSS
- AEAD
- Made
keyset.Handle
NewHandle.*
APIs accept only valid keysets; expect
parsing of invalid proto keysets to fail for invalid keysets. With this
change, tests that create keysets with an empty or invalidKeyData
and
expect a failure on primitive creation will now fail. The user can still
create an emptykeyset.Handle
, for which all methods fail. A valid keyset
is such that:- Is non-empty
- Keys have key data and valid output prefix and status
- Has only one primary key, which must be
ENABLED
- Added
keyset.ReadWithContext
andkeyset.WriteWithContext
that use the
tink.AEADWithContext
interface. - Made
WriteWithNoSecrets
fail with anil
proto keyset consistently with
all otherWrite.*
methods.
Other
- Added the
insecuresecretdataaccess.Token
struct to track and optionally
restrict raw key material access, andsecretdata.Bytes
to wrap access
controlled key bytes. In tests,insecuresecretkeyaccesstest.Token()
can be
used. - Added the
tink.AEADWithContext
interface, which allows acontext.Context
to be passed along. KMS implementations should prefer this interface when
implementing a remote AEAD. - When serializing ECDSA keys, the encoding changed (as padding of the points
changed). Users should not rely on specific encodings produced by Tink. - Set Go 1.22 as the minimum supported version.
- Upgraded deps:
golang.org/x/crypto
to v0.31.0google.golang.org/protobuf
to v1.36.0golang.org/x/sys
to v0.28.0
- Add HPKE KEM support for the NIST curves.
- Add HPKE KDF support for SHA-384 and SHA-512.
- Performance improvments for AEAD primitives.
Removed APIs
- Removed Bazel config. With this change Bazel users will no longer be able to
import tink-go as a pure Bazel dependency (bazel_dep
) in their
MODULE.bazel
file. However, Bazel users can continue importing tink-go
using bazel-gazelle. If this
causes any issues in your project, please file an issue. - Removed ChaCha20Poly1305 subtle's exported
Key
field. This was added by
mistake. - Removed
primitiveset.PrimitiveSet
,keyset.Primitives
and
keyset.PrimitivesWithKeyManager
from the public API. This API was never
really intended to be used outside Tink. We are making changes to Tink
internals and we prefer to break users at compile time. If this affects you,
please file an issue.
Future work
To see what we're working towards, check our project roadmap.
Get started
To get started using Tink, see the setup guide.
Go tooling
go get github.com/tink-crypto/tink-go/v2@v2.3.0