File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ package cgo
55import "C"
66
77import (
8+ "crypto"
89 "hash"
910 "unsafe"
1011)
@@ -14,6 +15,10 @@ const (
1415 BlockSize = 64
1516)
1617
18+ func init () {
19+ crypto .RegisterHash (crypto .SHA1 , New )
20+ }
21+
1722func New () hash.Hash {
1823 d := new (digest )
1924 d .Reset ()
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ package sha1cd
1212// Original: https://github.com/golang/go/blob/master/src/crypto/sha1/sha1.go
1313
1414import (
15+ "crypto"
1516 "encoding/binary"
1617 "errors"
1718 "hash"
@@ -21,6 +22,10 @@ import (
2122
2223//go:generate go run -C asm . -out ../sha1cdblock_amd64.s -pkg $GOPACKAGE
2324
25+ func init () {
26+ crypto .RegisterHash (crypto .SHA1 , New )
27+ }
28+
2429// The size of a SHA-1 checksum in bytes.
2530const Size = shared .Size
2631
You can’t perform that action at this time.
0 commit comments