Documentation ¶
Index ¶
- Variables
- type Buf
- type Error
- type Pythia
- func (p *Pythia) Blind(password []byte) (blindedPassword, blindingSecret []byte, err error)
- func (p *Pythia) ComputeTransformationKeypair(transformationKeyId, pythiaSecret, pythiaScopeSecret []byte) (privateKey, publicKey []byte, err error)
- func (p *Pythia) Deblind(transformedPassword []byte, blindingSecret []byte) (deblindedPassword []byte, err error)
- func (p *Pythia) GenerateKeypair(keypairType virgil_crypto_go.KeyType, seed []byte) (keypair interface{ ... }, err error)
- func (p *Pythia) GetPasswordUpdateToken(previousTransformationPrivateKey, newTransformationPrivateKey []byte) (passwordUpdateToken []byte, err error)
- func (p *Pythia) Prove(transformedPassword, blindedPassword, transformedTweak, ... []byte) (proofValueC, proofValueU []byte, err error)
- func (p *Pythia) Transform(blindedPassword, tweak, transformationPrivateKey []byte) (transformedPassword, transformedTweak []byte, err error)
- func (p *Pythia) UpdateDeblindedWithToken(deblindedPassword, passwordUpdateToken []byte) (updatedDeblindedPassword []byte, err error)
- func (p *Pythia) Verify(...) (err error)
Constants ¶
This section is empty.
Variables ¶
var ( BN_SIZE = int(C.PYTHIA_BN_BUF_SIZE) G1_SIZE = int(C.PYTHIA_G1_BUF_SIZE) G2_SIZE = int(C.PYTHIA_G2_BUF_SIZE) GT_SIZE = int(C.PYTHIA_GT_BUF_SIZE) )
Functions ¶
This section is empty.
Types ¶
type Buf ¶
type Buf struct {
// contains filtered or unexported fields
}
Buf is needed to pass memory from Go to C and back
func NewBufWithData ¶
NewBufWithData allocates new buffer and sets it memory to data
type Error ¶
func NewPythiaError ¶
type Pythia ¶
type Pythia struct { }
func (*Pythia) ComputeTransformationKeypair ¶
func (p *Pythia) ComputeTransformationKeypair(transformationKeyId, pythiaSecret, pythiaScopeSecret []byte) (privateKey, publicKey []byte, err error)
*
- ComputeTransformationKeypair Computes transformation private and public key. *
- @param [in] transformation_key_id - ensemble key ID used to enclose operations in subsets.
- @param [in] pythia_secret - global common for all secret random Key.
- @param [in] pythia_scope_secret - ensemble secret generated and versioned transparently.
- @param [out] transformation_private_key - BN transformation_private_key Pythia's private key
- which was generated using pythia_secret and pythia_scope_secret.
- This key is used to emit proof tokens (proof_value_c, proof_value_u).
- @param [out] transformation_public_key *
- @return 0 if succeeded, -1 otherwise
func (*Pythia) Deblind ¶
func (p *Pythia) Deblind(transformedPassword []byte, blindingSecret []byte) (deblindedPassword []byte, err error)
Deblind unmasks value y with previously returned secret from Blind()
func (*Pythia) GenerateKeypair ¶
func (*Pythia) GetPasswordUpdateToken ¶
func (p *Pythia) GetPasswordUpdateToken(previousTransformationPrivateKey, newTransformationPrivateKey []byte) (passwordUpdateToken []byte, err error)
GetPasswordUpdateToken generates token that can update protected passwords from the combination of (old) w1, msk1, ssk1 to (new) w2, msk2, ssk2
func (*Pythia) Prove ¶
func (p *Pythia) Prove(transformedPassword, blindedPassword, transformedTweak, transformationPrivateKey, transformationPublicKey []byte) (proofValueC, proofValueU []byte, err error)
Prove proves that server possesses secret values that are used to protect password
func (*Pythia) Transform ¶
func (p *Pythia) Transform(blindedPassword, tweak, transformationPrivateKey []byte) (transformedPassword, transformedTweak []byte, err error)
Transform turns blinded password into cryptographically strong value. *
- @brief Transforms blinded password using the private key, generated from pythia_secret + pythia_scope_secret. *
- @param [in] blinded_password - G1 password obfuscated into a pseudo-random string.
- @param [in] tweak - some random value used to transform a password.
- @param [in] transformation_private_key - BN transformation private key.
- @param [out] transformed_password - GT blinded password, protected using server secret
- (transformation private key + tweak).
- @param [out] transformed_tweak - G2 tweak value turned into an elliptic curve point.
- This value is used by Prove() operation. *
- @return 0 if succeeded, -1 otherwise
func (*Pythia) UpdateDeblindedWithToken ¶
func (p *Pythia) UpdateDeblindedWithToken(deblindedPassword, passwordUpdateToken []byte) (updatedDeblindedPassword []byte, err error)
UpdateDeblindedWithToken updates previously stored deblinded protected password with token. After this call, Transform() called with new arguments will return corresponding values
func (*Pythia) Verify ¶
func (p *Pythia) Verify(transformedPassword, blindedPassword, tweak, transformationPublicKey, proofValueC, proofValueU []byte) (err error)
Verify The protocol enables a client to verify that the output of Transform() is correct, assuming the client has previously stored p. The server accompanies the output y of the Transform() with a zero-knowledge proof (c, u) of correctness