Source File
blake2b.go
Belonging Package
golang.org/x/crypto/argon2
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package argon2
import (
)
// blake2bHash computes an arbitrary long hash value of in
// and writes the hash to out.
func ( []byte, []byte) {
var hash.Hash
if := len(); < blake2b.Size {
, _ = blake2b.New(, nil)
} else {
, _ = blake2b.New512(nil)
}
var [blake2b.Size]byte
binary.LittleEndian.PutUint32([:4], uint32(len()))
.Write([:4])
.Write()
if len() <= blake2b.Size {
.Sum([:0])
return
}
:= len()
.Sum([:0])
.Reset()
copy(, [:32])
= [32:]
for len() > blake2b.Size {
.Write([:])
.Sum([:0])
copy(, [:32])
= [32:]
.Reset()
}
if %blake2b.Size > 0 { // outLen > 64
:= (( + 31) / 32) - 2 // ⌈τ /32⌉-2
, _ = blake2b.New(-32*, nil)
}
.Write([:])
.Sum([:0])
}
The pages are generated with Golds v0.4.9. (GOOS=linux GOARCH=amd64)