papyrus

package
v2.0.0-...-2642f33 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyLen = 256
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthService

type AuthService struct {
	// contains filtered or unexported fields
}

func NewAuthService

func NewAuthService() *AuthService

func (*AuthService) FinishHandshake

func (s *AuthService) FinishHandshake(token string, clientProof []byte) ([]byte, error)

func (*AuthService) RegisterNewUser

func (s *AuthService) RegisterNewUser(login string) (*UserInfo, error)

func (*AuthService) SaveVerifier

func (s *AuthService) SaveVerifier(login string, verifier []byte) error

func (*AuthService) StartHandshake

func (s *AuthService) StartHandshake(login string, clientEphemeral []byte) (*HandshakeInfo, error)

func (*AuthService) VerifySignature

func (s *AuthService) VerifySignature(token string, sig []byte, body []byte) bool

type HandshakeInfo

type HandshakeInfo struct {
	// contains filtered or unexported fields
}

func (*HandshakeInfo) ConvertToResponse

func (h *HandshakeInfo) ConvertToResponse() HandshakeRes

type HandshakeReq

type HandshakeReq struct {
	Login           string `json:"l"`
	ClientEphemeral string `json:"A"`
}

type HandshakeRes

type HandshakeRes struct {
	Token           string `json:"token"`
	Salt            string `json:"s"`
	ServerEphemeral string `json:"B"`
}

type SaltReq

type SaltReq struct {
	Login string `json:"l"`
}

type SaltRes

type SaltRes struct {
	Salt string `json:"s"`
}

type SessionInfo

type SessionInfo struct {
	// contains filtered or unexported fields
}

type SessionReq

type SessionReq struct {
	Token                 string `json:"token"`
	ClientSessionKeyProof string `json:"M"`
}

type SessionRes

type SessionRes struct {
	ServerSessionKeyProof string `json:"M"`
}

type Suite

type Suite struct {
	N *big.Int
	// contains filtered or unexported fields
}

func NewSuite

func NewSuite(seed int64) *Suite

func (*Suite) GenClientEphemeralKey

func (s *Suite) GenClientEphemeralKey(p, a []byte)

func (*Suite) GenClientSessionKey

func (s *Suite) GenClientSessionKey(a, A, B, p, salt []byte) []byte

func (*Suite) GenClientSessionKeyProof

func (s *Suite) GenClientSessionKeyProof(l, salt, A, B, key []byte) []byte

func (*Suite) GenRandVal

func (s *Suite) GenRandVal(p []byte) error

func (*Suite) GenServerEphemeralKey

func (s *Suite) GenServerEphemeralKey(p, b, v []byte)

func (*Suite) GenServerSessionKey

func (s *Suite) GenServerSessionKey(b, A, B, v []byte) []byte

func (*Suite) GenServerSessionKeyProof

func (s *Suite) GenServerSessionKeyProof(A, clientProof, key []byte) []byte

func (*Suite) GenVerifier

func (s *Suite) GenVerifier(v, password, salt []byte)

type UserInfo

type UserInfo struct {
	Salt []byte
	// contains filtered or unexported fields
}

type VerifierReq

type VerifierReq struct {
	Login    string `json:"l"`
	Verifier string `json:"v"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL