Skip to content

Commit

Permalink
Update pake.go
Browse files Browse the repository at this point in the history
  • Loading branch information
schollz committed Nov 12, 2019
1 parent 72f2495 commit f35d86a
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions pake.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,15 +258,9 @@ func (p *Pake) Update(qBytes []byte) (err error) {
return
}

// hashK generates a bcrypt hash of the password using work factor 12.
// hashK generates a bcrypt hash of the password using work factor 10.
func hashK(k []byte, durationToWork time.Duration) (b []byte, err error) {
for i := 1; i < 24; i++ {
s := time.Now()
b, err = bcrypt.GenerateFromPassword(k, i)
if time.Since(s) > durationToWork {
return
}
}
b, err = bcrypt.GenerateFromPassword(k, 10)
return
}

Expand Down

0 comments on commit f35d86a

Please sign in to comment.