Skip to content

Commit

Permalink
use 32 bytes for random
Browse files Browse the repository at this point in the history
  • Loading branch information
schollz committed May 7, 2021
1 parent 69697df commit 886f7d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pake.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func InitCurve(pw []byte, role int, curve string) (p *Pake, err error) {
// STEP: A computes X
p.Vpwᵤ, p.Vpwᵥ = p.curve.ScalarMult(p.Vᵤ, p.Vᵥ, p.Pw)
p.Upwᵤ, p.Upwᵥ = p.curve.ScalarMult(p.Uᵤ, p.Uᵥ, p.Pw)
p. = make([]byte, 8) // randomly generated secret
p. = make([]byte, 32) // randomly generated secret
_, err = rand.Read(p.)
if err != nil {
return
Expand Down Expand Up @@ -180,7 +180,7 @@ func (p *Pake) Update(qBytes []byte) (err error) {
// STEP: B computes Y
p.Vpwᵤ, p.Vpwᵥ = p.curve.ScalarMult(p.Vᵤ, p.Vᵥ, p.Pw)
p.Upwᵤ, p.Upwᵥ = p.curve.ScalarMult(p.Uᵤ, p.Uᵥ, p.Pw)
p. = make([]byte, 8) // randomly generated secret
p. = make([]byte, 32) // randomly generated secret
rand.Read(p.)
p.Aαᵤ, p.Aαᵥ = p.curve.ScalarBaseMult(p.)
p.Yᵤ, p.Yᵥ = p.curve.Add(p.Vpwᵤ, p.Vpwᵥ, p.Aαᵤ, p.Aαᵥ) // "Y"
Expand Down

0 comments on commit 886f7d5

Please sign in to comment.