2
2
package kdf
3
3
4
4
import (
5
- "crypto/sha512 "
5
+ "crypto/sha256 "
6
6
7
7
// package is old but corresponds to "golang.org/x/crypto/ssh/internal/bcrypt_pbkdf"
8
8
"github.com/dchest/bcrypt_pbkdf"
@@ -15,7 +15,7 @@ import (
15
15
var KDFS = map [string ]KDF {
16
16
"scrypt" : sCrypt {},
17
17
"bcrypt" : bCrypt {},
18
- "pbkdf2_hmac_sha256" : pbkdf2sha512 {},
18
+ "pbkdf2_hmac_sha256" : pbkdf2sha256 {},
19
19
}
20
20
21
21
// KDF interface holding "Derive" method.
@@ -37,9 +37,9 @@ func (bCrypt) Derive(rounds int, password, salt []byte) (derivedKey []byte, err
37
37
return bcrypt_pbkdf .Key (password , salt , rounds , chacha20poly1305 .KeySize )
38
38
}
39
39
40
- type pbkdf2sha512 struct {
40
+ type pbkdf2sha256 struct {
41
41
}
42
42
43
- func (pbkdf2sha512 ) Derive (rounds int , password , salt []byte ) (derivedKey []byte , err error ) {
44
- return pbkdf2 .Key (password , salt , rounds , chacha20poly1305 .KeySize , sha512 .New ), nil
43
+ func (pbkdf2sha256 ) Derive (rounds int , password , salt []byte ) (derivedKey []byte , err error ) {
44
+ return pbkdf2 .Key (password , salt , rounds , chacha20poly1305 .KeySize , sha256 .New ), nil
45
45
}
0 commit comments