Exemple #1
0
// New returns a new sha224 hash.Hash
func New224() hash.Hash {
	hash := new(SHA224Hash)
	if C.SHA224_Init(&hash.sha) != 1 {
		panic("problem creating hash")
	}
	return hash
}
Exemple #2
0
func (d *digest) Reset() {
	if d.is224 {
		C.SHA224_Init(&d.ctx)
		return
	}
	C.SHA256_Init(&d.ctx)
}
Exemple #3
0
func New224() hash.Hash {
	d := new(digest)
	d.is224 = true
	if C.SHA224_Init(&d.ctx) != 1 {
		return nil
	}
	return d
}
Exemple #4
0
func (self *SHA224Hash) Reset() {
	C.SHA224_Init(&self.sha)
}
Exemple #5
0
func (h *sha224) Reset() {
	if C.SHA224_Init(&h.ctx) != 1 {
		panic("SHA224_Init failed") // hash funcs shouldn't fail
	}
}