Documentation
¶
Index ¶
- func CalculateX(s int8, r, N *big.Int) (X *big.Int)
- func GetSign() int8
- type AuthenticationRequest
- type AuthenticationResponse
- type AuthenticationVerifyRequest
- type AuthenticationVerifyResponse
- type BigIntArray
- type FeigeFiatShamirInitiator
- func (ffsi *FeigeFiatShamirInitiator) CalculateVerifyValues(secretVals BigIntArray, n *big.Int) (verifyVals BigIntArray)
- func (ffsi *FeigeFiatShamirInitiator) CreatePrimes() (p, q, N *big.Int)
- func (ffsi *FeigeFiatShamirInitiator) GenerateSecretValues(noSecretVals int, N *big.Int) (secretVals BigIntArray)
- func (ffsi *FeigeFiatShamirInitiator) InitiateAuthentication() AuthenticationRequest
- func (ffsi *FeigeFiatShamirInitiator) OnAuthenticationResponse(as []int8) AuthenticationVerifyRequest
- func (ffsi *FeigeFiatShamirInitiator) OnAuthenticationVerifyResponse(isAccessGranted bool)
- func (ffsi *FeigeFiatShamirInitiator) Prepare()
- func (ffsi *FeigeFiatShamirInitiator) PrintAuthenticationStep1Values(publicOnly bool)
- type FeigeFiatShamirResponder
- type InitAuthenticationWithServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthenticationRequest ¶
type AuthenticationRequest struct {
VerifyVals BigIntArray
X *big.Int
N *big.Int
}
func NewAuthenticationRequest ¶
func NewAuthenticationRequest(verifyVals BigIntArray, x, n *big.Int) AuthenticationRequest
type AuthenticationResponse ¶
type AuthenticationResponse struct {
ChosenSecrets []int8
}
func NewAuthenticationResponse ¶
func NewAuthenticationResponse(chosenSecrets []int8) AuthenticationResponse
type AuthenticationVerifyRequest ¶
func NewAuthenticationVerifyRequest ¶
func NewAuthenticationVerifyRequest(y *big.Int) AuthenticationVerifyRequest
type AuthenticationVerifyResponse ¶
type AuthenticationVerifyResponse struct {
IsAccessGranted bool
}
func NewAuthenticationVerifyResponse ¶
func NewAuthenticationVerifyResponse(isAccessGranted bool) AuthenticationVerifyResponse
type BigIntArray ¶
func (BigIntArray) String ¶
func (m BigIntArray) String() string
type FeigeFiatShamirInitiator ¶
type FeigeFiatShamirInitiator struct {
// N = p * q
N *big.Int
// Calculated for each authentication attempt
// X = s * r² mod N
X *big.Int
// verification values: used for someone to verify that initiator has the secrets (are trasnmitted on a public channel)
// vᵢ = sᵢ² mod N for 0 < i <= noSecretVals
VerifyVals BigIntArray
// contains filtered or unexported fields
}
func NewFeigeFiatShamirInitiator ¶
func NewFeigeFiatShamirInitiator(noSecretBits, noSecretVals int) FeigeFiatShamirInitiator
Create new Feige-Fiat-Shamir Initiator. noSecretBits must be >= 5 noSecretVals must be >= 1
func (*FeigeFiatShamirInitiator) CalculateVerifyValues ¶
func (ffsi *FeigeFiatShamirInitiator) CalculateVerifyValues(secretVals BigIntArray, n *big.Int) (verifyVals BigIntArray)
func (*FeigeFiatShamirInitiator) CreatePrimes ¶
func (ffsi *FeigeFiatShamirInitiator) CreatePrimes() (p, q, N *big.Int)
Creates two different prime numbers p and q and return them along with their product N
func (*FeigeFiatShamirInitiator) GenerateSecretValues ¶
func (ffsi *FeigeFiatShamirInitiator) GenerateSecretValues(noSecretVals int, N *big.Int) (secretVals BigIntArray)
func (*FeigeFiatShamirInitiator) InitiateAuthentication ¶
func (ffsi *FeigeFiatShamirInitiator) InitiateAuthentication() AuthenticationRequest
send verification values, X and N to authentication responder (these are public and even when eavesdropped do not compromise security of protocol)
func (*FeigeFiatShamirInitiator) OnAuthenticationResponse ¶
func (ffsi *FeigeFiatShamirInitiator) OnAuthenticationResponse(as []int8) AuthenticationVerifyRequest
func (*FeigeFiatShamirInitiator) OnAuthenticationVerifyResponse ¶
func (ffsi *FeigeFiatShamirInitiator) OnAuthenticationVerifyResponse(isAccessGranted bool)
func (*FeigeFiatShamirInitiator) Prepare ¶
func (ffsi *FeigeFiatShamirInitiator) Prepare()
func (*FeigeFiatShamirInitiator) PrintAuthenticationStep1Values ¶
func (ffsi *FeigeFiatShamirInitiator) PrintAuthenticationStep1Values(publicOnly bool)
type FeigeFiatShamirResponder ¶
type FeigeFiatShamirResponder struct {
X *big.Int
ChosenSecrets []int8
N *big.Int
// verification values: used for someone to verify that initiator has the secrets (are trasnmitted on a public channel)
VerifyVals BigIntArray
}
func NewFeigeFiatShamirResponder ¶
func NewFeigeFiatShamirResponder() FeigeFiatShamirResponder
Create new instance of FeigeFiatShamirResponder. This is the server instance authenticating clients on
func (*FeigeFiatShamirResponder) OnAuthenticateRequest ¶
func (ffsr *FeigeFiatShamirResponder) OnAuthenticateRequest(verifyVals BigIntArray, X, N *big.Int) AuthenticationResponse
Called when a Feige-Fiat-Shamir Initiator wants to authenticate itself against a responder. The initiator will send k ∈ N verification values, an X value and N. The responder now needs to generate k elements aᵢ with 0 < i <= k where each one is randomly either a 0 or a 1.
func (*FeigeFiatShamirResponder) OnAuthenticationVerify ¶
func (ffsr *FeigeFiatShamirResponder) OnAuthenticationVerify(y *big.Int) AuthenticationVerifyResponse
Decides wether authentication is successful or not. Authentication is successful if y² = +-X * (vᵢ)ᵃᵢ mod N is true. Otherwise authentication failed.
type InitAuthenticationWithServer ¶
func NewInitAuthenticationWithServer ¶
func NewInitAuthenticationWithServer(server actor.PID) InitAuthenticationWithServer