...

Source file src/golang.org/x/crypto/blake2b/register.go

Documentation: golang.org/x/crypto/blake2b

     1  // Copyright 2017 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package blake2b
     6  
     7  import (
     8  	"crypto"
     9  	"hash"
    10  )
    11  
    12  func init() {
    13  	newHash256 := func() hash.Hash {
    14  		h, _ := New256(nil)
    15  		return h
    16  	}
    17  	newHash384 := func() hash.Hash {
    18  		h, _ := New384(nil)
    19  		return h
    20  	}
    21  
    22  	newHash512 := func() hash.Hash {
    23  		h, _ := New512(nil)
    24  		return h
    25  	}
    26  
    27  	crypto.RegisterHash(crypto.BLAKE2b_256, newHash256)
    28  	crypto.RegisterHash(crypto.BLAKE2b_384, newHash384)
    29  	crypto.RegisterHash(crypto.BLAKE2b_512, newHash512)
    30  }
    31  

View as plain text