Rename files for better understanding of files content
This commit is contained in:
parent
96032a8774
commit
9f501e7035
|
@ -4,11 +4,32 @@ import (
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"crypto/subtle"
|
"crypto/subtle"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"golang.org/x/crypto/argon2"
|
"golang.org/x/crypto/argon2"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type params struct {
|
||||||
|
memory uint32
|
||||||
|
iterations uint32
|
||||||
|
parallelism uint8
|
||||||
|
saltLength uint32
|
||||||
|
keyLength uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
ErrInvalidHash = errors.New("the encoded hash is not in the correct format")
|
||||||
|
ErrIncompatibleVersion = errors.New("incompatible version of argon2")
|
||||||
|
p = ¶ms{
|
||||||
|
memory: 64 * 1024,
|
||||||
|
iterations: 3,
|
||||||
|
parallelism: 2,
|
||||||
|
saltLength: 16,
|
||||||
|
keyLength: 32,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
func generateRandomBytes(n uint32) ([]byte, error) {
|
func generateRandomBytes(n uint32) ([]byte, error) {
|
||||||
b := make([]byte, n)
|
b := make([]byte, n)
|
||||||
_, err := rand.Read(b)
|
_, err := rand.Read(b)
|
|
@ -1,23 +0,0 @@
|
||||||
package argon2
|
|
||||||
|
|
||||||
import "errors"
|
|
||||||
|
|
||||||
type params struct {
|
|
||||||
memory uint32
|
|
||||||
iterations uint32
|
|
||||||
parallelism uint8
|
|
||||||
saltLength uint32
|
|
||||||
keyLength uint32
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
|
||||||
ErrInvalidHash = errors.New("the encoded hash is not in the correct format")
|
|
||||||
ErrIncompatibleVersion = errors.New("incompatible version of argon2")
|
|
||||||
p = ¶ms{
|
|
||||||
memory: 64 * 1024,
|
|
||||||
iterations: 3,
|
|
||||||
parallelism: 2,
|
|
||||||
saltLength: 16,
|
|
||||||
keyLength: 32,
|
|
||||||
}
|
|
||||||
)
|
|
Loading…
Reference in New Issue
Block a user