Documentation ¶
Index ¶
- Variables
- func K(f func(*SRP) *big.Int) func(*SRP) error
- func U(f func(*SRP, *big.Int, *big.Int) *big.Int) func(*SRP) error
- func X(f func(*SRP, []byte, []byte, []byte) *big.Int) func(*SRP) error
- type Client
- type Group
- type ISV
- type SRP
- func (s *SRP) Group() *Group
- func (s *SRP) HashBytes(a ...[]byte) []byte
- func (s *SRP) HashInt(a ...[]byte) *big.Int
- func (s *SRP) NewClient(identity, password []byte) (*Client, error)
- func (s *SRP) NewISV(identity, password []byte) (*ISV, error)
- func (s *SRP) NewServer(i *ISV, xA []byte) (*Server, error)
- func (s *SRP) SetK(f func(*SRP) *big.Int) error
- func (s *SRP) SetU(f func(*SRP, *big.Int, *big.Int) *big.Int) error
- func (s *SRP) SetX(f func(*SRP, []byte, []byte, []byte) *big.Int) error
- type Server
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidPublicKey means the public key is invalid. ErrInvalidPublicKey = errors.New("invalid public key") // ErrTrailingBytes means there were additional trailing bytes when // unmarshalling. ErrTrailingBytes = errors.New("trailing bytes") // ErrTooBig means the length of the value exceeds the size of a 16-bit // integer. ErrTooBig = fmt.Errorf("value exceeds %d bytes", math.MaxUint16) )
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents the client-side of an SRP session.
func (*Client) Compute ¶
Compute takes the salt and public value provided by the server and computes the proofs and shared key. It returns the M1 proof to be sent to the server.
func (*Client) S ¶
S returns the computed S value after c.Compute() has been called, otherwise an error is returned.
func (*Client) SetIdentity ¶
SetIdentity sets the client identity.
type Group ¶
Group represents the SRP group parameters.
type ISV ¶
type ISV struct { Identity []byte `json:"identity"` Salt []byte `json:"salt"` Verifier []byte `json:"verifier"` }
ISV holds the triplet of the Identity, Salt, and Verifier. It implements encoding.BinaryMarshaler and encoding.BinaryUnmarshaler so it can be serialized to and from persistent storage.
func (*ISV) MarshalBinary ¶
MarshalBinary satisfies the encoding.BinaryMarshaler interface.
func (*ISV) UnmarshalBinary ¶
UnmarshalBinary satisfies the encoding.BinaryUnmarshaler interface.
type SRP ¶
type SRP struct {
// contains filtered or unexported fields
}
SRP manages the various computations used in the SRP protocol.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents the server-side of an SRP session. It implements encoding.BinaryMarshaler and encoding.BinaryUnmarshaler so it can be serialized to and from persistent storage.
func (*Server) Check ¶
Check compares the M1 proof computed by the client with the servers copy. If it is identical then the servers M2 proof is returned to be sent back to the client.
func (*Server) MarshalBinary ¶
MarshalBinary satisfies the encoding.BinaryMarshaler interface.
func (*Server) UnmarshalBinary ¶
UnmarshalBinary satisfies the encoding.BinaryUnmarshaler interface.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package cognito contains the SRP primitives that differ between RFC 5054 and the AWS Cognito implementation.
|
Package cognito contains the SRP primitives that differ between RFC 5054 and the AWS Cognito implementation. |
internal
|
|
rfc5054
Package rfc5054 provides the prime numbers and test vectors documented in RFC 5054.
|
Package rfc5054 provides the prime numbers and test vectors documented in RFC 5054. |