blob: ab1496d3f6778d284d4ec3554b3ced88eee7f58e [file] [log] [blame]
khenaidood948f772021-08-11 17:49:24 -04001// Package etype provides the Kerberos Encryption Type interface
2package etype
3
4import "hash"
5
6// EType is the interface defining the Encryption Type.
7type EType interface {
8 GetETypeID() int32
9 GetHashID() int32
10 GetKeyByteSize() int
11 GetKeySeedBitLength() int
12 GetDefaultStringToKeyParams() string
13 StringToKey(string, salt, s2kparams string) ([]byte, error)
14 RandomToKey(b []byte) []byte
15 GetHMACBitLength() int
16 GetMessageBlockByteSize() int
17 EncryptData(key, data []byte) ([]byte, []byte, error)
18 EncryptMessage(key, message []byte, usage uint32) ([]byte, []byte, error)
19 DecryptData(key, data []byte) ([]byte, error)
20 DecryptMessage(key, ciphertext []byte, usage uint32) ([]byte, error)
21 GetCypherBlockBitLength() int
22 GetConfounderByteSize() int
23 DeriveKey(protocolKey, usage []byte) ([]byte, error)
24 DeriveRandom(protocolKey, usage []byte) ([]byte, error)
25 VerifyIntegrity(protocolKey, ct, pt []byte, usage uint32) bool
26 GetChecksumHash(protocolKey, data []byte, usage uint32) ([]byte, error)
27 VerifyChecksum(protocolKey, data, chksum []byte, usage uint32) bool
28 GetHashFunc() func() hash.Hash
29}