aboutsummaryrefslogtreecommitdiff
path: root/bhash
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2017-04-15 02:59:31 +0200
committerDimitri Sokolyuk <demon@dim13.org>2017-04-15 02:59:31 +0200
commit34cb368fbfaeabc11d02cc60791c5495710e4bd0 (patch)
treec268825dc3f5535d39fc8c0c80a9a934e1ed3233 /bhash
parent861d6822cf0617551fcfd5bd1e16b08e8664c6f7 (diff)
Make lint happy
Diffstat (limited to 'bhash')
-rw-r--r--bhash/bhash.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/bhash/bhash.go b/bhash/bhash.go
index ea3081c..f5fb395 100644
--- a/bhash/bhash.go
+++ b/bhash/bhash.go
@@ -1,3 +1,7 @@
+// Package bhash implements bcrypt_pbkdf key derivation function compatible to
+// OpenBSD implementation
+//
+// http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libutil/bcrypt_pbkdf.c
package bhash
import (
@@ -15,6 +19,7 @@ var (
hashSize = words * 4
)
+// Hash computes bcrypt hash
func Hash(pass, salt []byte) []byte {
c, err := blowfish.NewSaltedCipher(pass, salt)
if err != nil {
@@ -41,6 +46,7 @@ func Hash(pass, salt []byte) []byte {
return buf.Bytes()
}
+// Pbkdf returns derivated key
func Pbkdf(pass, salt []byte, iter, keyLen int) []byte {
// collapse password
h := sha512.New()