Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
proposal: crypto/cipher: Specify nonce and tag sizes for GCM #34594
Is there any reason for why NewGCM, NewGCMWithNonceSize, and NewGCMWithTagSize are public while newGCMWithNonceAndTagSize isn't? Unless I'm missing something, creating an AEAD with custom sizes for both nonce and tag seems impossible.
So the proposal would be to transform newGCMWithNonceAndTagSize -> NewGCMWithNonceAndTagSize.
It appears that this was done on purpose. Look at 33f1768: it renamed
Moreover, in #24171 (comment), rsc wrote:
Overall, it seems that the limitation of not being able to set the nonce size is intentional.
I guess it feels weird to offer two different options but not the composition of both, especially since they're only there for compatibility reasons. It would make sense if both helpers had a major use case for development, but they're meant to be used reluctantly.