コード例 #1
0
ファイル: sha1.go プロジェクト: runcom/gossl
// New returns a new sha1 hash.Hash
// if the returned hash is nil, then make a call to sslerr.Error() to know
// what went wrong
func New() hash.Hash {
	d := new(digest)
	if C.SHA1_Init(&d.ctx) != 1 {
		return nil
	}
	return d
}
コード例 #2
0
ファイル: sha1.go プロジェクト: partkyle/gossl
// New returns a new sha1 hash.Hash
func New() hash.Hash {
	h := new(SHA1Hash)
	if C.SHA1_Init(&h.sha) != 1 {
		panic("problem creating hash")
	}
	return h
}
コード例 #3
0
ファイル: sha1.go プロジェクト: jgrahamc/go-openssl
func (d *digest) Reset() {
	d.context = &_Ctype_SHA_CTX{}
	C.SHA1_Init(d.context)
}
コード例 #4
0
ファイル: sha1.go プロジェクト: runcom/gossl
func (d *digest) Reset() {
	C.SHA1_Init(&d.ctx)
}
コード例 #5
0
ファイル: sha1.go プロジェクト: partkyle/gossl
func (self *SHA1Hash) Reset() {
	C.SHA1_Init(&self.sha)
}
コード例 #6
0
ファイル: sha.go プロジェクト: eftychis/crypto-1
func (h *sha1) Reset() {
	if C.SHA1_Init(&h.ctx) != 1 {
		panic("SHA1_Init failed") // hash funcs shouldn't fail
	}
}
コード例 #7
0
ファイル: sha1.go プロジェクト: d3zd3z/gosure
func NewSha1() *ShaContext {
	context := new(ShaContext)
	C.SHA1_Init((*C.SHA_CTX)(context))
	return context
}