diff --git a/algorithms/argon2/Hash.go b/algorithms/argon2/Hash.go index d77f768..ba1f65c 100644 --- a/algorithms/argon2/Hash.go +++ b/algorithms/argon2/Hash.go @@ -19,6 +19,6 @@ func (algorithm Algorithm) Hash(data []byte) (string, error) { if err != nil { return "", err } - // Hash + // Return Hash return fmt.Sprintf("$argon2id$v=%d$m=%d,t=%d,p=%d$%s$%s", argon2.Version, algorithm.memory, algorithm.time, algorithm.threads, base64.RawStdEncoding.EncodeToString(salt), base64.RawStdEncoding.EncodeToString(argon2.IDKey(data, salt, algorithm.time, algorithm.memory, algorithm.threads, algorithm.keyLen))), err } diff --git a/algorithms/blake2/Algorithm.go b/algorithms/blake2/Algorithm.go index b590128..4709a8d 100644 --- a/algorithms/blake2/Algorithm.go +++ b/algorithms/blake2/Algorithm.go @@ -9,6 +9,6 @@ type Algorithm struct { func New(size int) Algorithm { // Return Algorithm return Algorithm{ - size: size, + size: size / 2, } } diff --git a/algorithms/sha256/CheckHash.go b/algorithms/sha256/CheckHash.go index c30115e..548cdc6 100644 --- a/algorithms/sha256/CheckHash.go +++ b/algorithms/sha256/CheckHash.go @@ -23,6 +23,6 @@ func (Algorithm) CheckHash(data []byte, hashToCheck string) (bool, error) { if err != nil { return false, err } - // Return Hash + // Return Match return subtle.ConstantTimeCompare(hasher.Sum(nil), decodedHashToCheck) == 1, err } diff --git a/algorithms/sha512/CheckHash.go b/algorithms/sha512/CheckHash.go index bee3c1e..3a8b532 100644 --- a/algorithms/sha512/CheckHash.go +++ b/algorithms/sha512/CheckHash.go @@ -23,6 +23,6 @@ func (Algorithm) CheckHash(data []byte, hashToCheck string) (bool, error) { if err != nil { return false, err } - // Return Hash + // Return Match return subtle.ConstantTimeCompare(hasher.Sum(nil), decodedHashToCheck) == 1, err }