-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patherror.go
37 lines (34 loc) · 1.43 KB
/
error.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
36
37
package srp
const (
// ErrNoGroupParams is returned when SRP group parameters N and G
// are not initialized.
ErrNoGroupParams = Error("srp.Group not initialized")
// ErrNoPremasterKey is returned when a calculation is attempted
// that requires the key.
ErrNoPremasterKey = Error("premaster key required for calculation")
// ErrBadClientProof is returned when the client submits invalid
// proof.
ErrBadClientProof = Error("invalid client proof received")
// ErrNoHash is returned when a client or server attempts a calculation
// with no hashing function set.
ErrNoHash = Error("hash not initialized")
// ErrCalcVerifier is returned when the client fails to calculate a
// verifier value.
ErrCalcVerifier = Error("failed to generate verifier")
// ErrNoEphemeralKeys is returned when a calculation is done with missing
// ephemeral keys A or B.
ErrNoEphemeralKeys = Error("shared keys A/B not calculated")
// ErrPublicKeyModuloZero is returned when a public key % N is 0.
ErrPublicKeyModuloZero = Error("key % N cannot be 0")
// ErrInvalidPrime is returned when a Group is created with an invalid prime
// value.
ErrInvalidPrime = Error("invalid prime value provided")
// ErrInvalidPrimitiveRoot is returned when a Group is created with an invalid
// primitive root.
ErrInvalidPrimitiveRoot = Error("invalid primitive root provided")
)
// Error represents an SRP error
type Error string
func (e Error) Error() string {
return string(e)
}