-
Notifications
You must be signed in to change notification settings - Fork 0
/
errors.go
35 lines (25 loc) · 837 Bytes
/
errors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package goech
import (
"errors"
"fmt"
)
var (
ErrNotSupportedVersion = fmt.Errorf("goech: %d is the only supported version", DraftTLSESNI16)
ErrInvalidLen = errors.New("goech: invalid length")
)
type InvalidPublicNameLenError uint
func (length InvalidPublicNameLenError) Error() string {
return fmt.Sprintf("goech: the length of public name (%d) must be: 0 < len <= 255", length)
}
type InvalidKEMError uint16
func (kem InvalidKEMError) Error() string {
return fmt.Sprintf("goech: %d is not a valid KEM identifier", kem)
}
type InvalidKDFError uint16
func (kdf InvalidKDFError) Error() string {
return fmt.Sprintf("goech: %d is not a valid KDF identifier", kdf)
}
type InvalidAEADError uint16
func (aead InvalidAEADError) Error() string {
return fmt.Sprintf("goech: %d is not a valid AEAD identifier", aead)
}