summaryrefslogtreecommitdiff
path: root/internal/internal.go
blob: 970232ca20dd53e82d00bf954d7d62100eac45d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package internal

import "errors"

type (
	KEK        []byte
	DEK        []byte
	WrappedDEK []byte
	Ciphertext []byte
)

type EncryptedDataPayload struct {
	DEK     WrappedDEK
	Payload Ciphertext
}

var (
	aadWrapDEK  = []byte("wrap:dek:v1")
	aadDataMsg  = []byte("data:msg:v1")
	errBadKeyLn = errors.New("invalid key length: must be 16, 24, or 32 bytes")
)