tink-crypto / tink

Tink is a multi-language, cross-platform, open source library that provides cryptographic APIs that are secure, easy to use correctly, and hard(er) to misuse.
https://developers.google.com/tink
Apache License 2.0
13.47k stars 1.18k forks source link

Add AES-GCM-SIV key templates to Go implementation #673

Closed jwright-stripe closed 1 year ago

jwright-stripe commented 1 year ago

This PR adds support for AES-GCM-SIV templates in the Tink library for Go.

I noticed that functionality exists within the Go library to manage keys used for an AES-GCM-SIV AEAD scheme, but there were no templates to make it easy for developers to create new instances of these keys.

In terms of what key sizes / outputs to support, for now I mirrored what AES-GCM supports today. That is:

I'm flexible here and can adjust if you'd prefer something else!

I've updated unit tests accordingly and, if needed, this is safe to revert.