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