コード例 #1
0
ファイル: sha384.go プロジェクト: postfix/go-ssl
// New returns a new sha256 hash.Hash
func New384() hash.Hash {
	hash := new(SHA384Hash)
	if C.SHA384_Init(&hash.sha) != 1 {
		panic("problem creating hash")
	}
	return hash
}
コード例 #2
0
ファイル: sha512.go プロジェクト: runcom/gossl
// New returns a new sha384 hash.Hash
// if the returned hash is empty, then make a call to sslerr.Error()
func New384() hash.Hash {
	d := new(digest)
	d.function = crypto.SHA384
	if C.SHA384_Init(&d.ctx) != 1 {
		return nil
	}
	return d
}
コード例 #3
0
ファイル: sha512.go プロジェクト: runcom/gossl
func (d *digest) Reset() {
	switch d.function {
	case crypto.SHA384:
		C.SHA384_Init(&d.ctx)
	default:
		C.SHA512_Init(&d.ctx)
	}
}
コード例 #4
0
ファイル: sha384.go プロジェクト: postfix/go-ssl
func (self *SHA384Hash) Reset() {
	C.SHA384_Init(&self.sha)
}
コード例 #5
0
ファイル: sha.go プロジェクト: eftychis/crypto-1
func (h *sha384) Reset() {
	if C.SHA384_Init(&h.ctx) != 1 {
		panic("SHA384_Init failed") // hash funcs shouldn't fail
	}
}