stupidgcm: unexport stupidGCM struct

No need to have it exported.
This commit is contained in:
Jakob Unterwurzacher 2021-09-07 17:48:55 +02:00
parent 3a80db953d
commit d598536709
2 changed files with 4 additions and 5 deletions

View File

@ -215,7 +215,7 @@ func testOpenAllZero(t *testing.T, c cipher.AEAD) {
func testWipe(t *testing.T, c cipher.AEAD) { func testWipe(t *testing.T, c cipher.AEAD) {
switch c2 := c.(type) { switch c2 := c.(type) {
case *StupidGCM: case *stupidGCM:
c2.Wipe() c2.Wipe()
if !c2.Wiped() { if !c2.Wiped() {
t.Error("c2.wiped is not set") t.Error("c2.wiped is not set")

View File

@ -21,20 +21,19 @@ const (
tagLen = 16 tagLen = 16
) )
// StupidGCM implements the cipher.AEAD interface type stupidGCM struct {
type StupidGCM struct {
stupidAEADCommon stupidAEADCommon
} }
// Verify that we satisfy the interface // Verify that we satisfy the interface
var _ cipher.AEAD = &StupidGCM{} var _ cipher.AEAD = &stupidGCM{}
// New returns a new cipher.AEAD implementation.. // New returns a new cipher.AEAD implementation..
func New(keyIn []byte, forceDecode bool) cipher.AEAD { func New(keyIn []byte, forceDecode bool) cipher.AEAD {
if len(keyIn) != keyLen { if len(keyIn) != keyLen {
log.Panicf("Only %d-byte keys are supported", keyLen) log.Panicf("Only %d-byte keys are supported", keyLen)
} }
return &StupidGCM{ return &stupidGCM{
stupidAEADCommon{ stupidAEADCommon{
// Create a private copy of the key // Create a private copy of the key
key: append([]byte{}, keyIn...), key: append([]byte{}, keyIn...),