Skip to content

Commit

Permalink
blake2s: register BLAKE2s
Browse files Browse the repository at this point in the history
Register BLAKE2s-256 if the package is imported.
Change-Id: Ib415ae641f21d863720bf9c089017ee97654a555
Reviewed-on: https://go-review.googlesource.com/36878
Reviewed-by: Matt Layher <[email protected]>
Reviewed-by: Adam Langley <[email protected]>
Run-TryBot: Matt Layher <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
  • Loading branch information
Andreas Auernhammer authored and agl committed Mar 2, 2017
1 parent 83de8c7 commit 40541cc
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions blake2s/register.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// 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.

// +build go1.9

package blake2s

import (
"crypto"
"hash"
)

func init() {
newHash256 := func() hash.Hash {
h, _ := New256(nil)
return h
}

crypto.RegisterHash(crypto.BLAKE2s_256, newHash256)
}

0 comments on commit 40541cc

Please sign in to comment.