Exemple #1
0
// 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
}
Exemple #2
0
// 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
}
Exemple #3
0
func (d *digest) Reset() {
	d.context = &_Ctype_SHA_CTX{}
	C.SHA1_Init(d.context)
}
Exemple #4
0
func (d *digest) Reset() {
	C.SHA1_Init(&d.ctx)
}
Exemple #5
0
func (self *SHA1Hash) Reset() {
	C.SHA1_Init(&self.sha)
}
Exemple #6
0
func (h *sha1) Reset() {
	if C.SHA1_Init(&h.ctx) != 1 {
		panic("SHA1_Init failed") // hash funcs shouldn't fail
	}
}
Exemple #7
0
func NewSha1() *ShaContext {
	context := new(ShaContext)
	C.SHA1_Init((*C.SHA_CTX)(context))
	return context
}