Skip to content

Commit bea8a34

Browse files
committed
fix reset
1 parent dc77acd commit bea8a34

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cshake.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import (
1111
"unsafe"
1212
)
1313

14-
func shakeOneShot(size int, p []byte, sum []byte) bool {
15-
return C.go_openssl_EVP_Digest(unsafe.Pointer(&*addr(p)), C.size_t(len(p)), (*C.uchar)(unsafe.Pointer(&*addr(sum))), nil, loadShake(size).md, nil) != 0
14+
func shakeOneShot(secuirtyBits int, data []byte, out []byte) bool {
15+
return C.go_openssl_EVP_Digest(unsafe.Pointer(&*addr(data)), C.size_t(len(data)), (*C.uchar)(unsafe.Pointer(&*addr(out))), nil, loadShake(secuirtyBits).md, nil) != 0
1616
}
1717

1818
// SumSHAKE128 applies the SHAKE128 extendable output function to data and
@@ -161,6 +161,7 @@ func (s *SHAKE) Reset() {
161161
if C.go_openssl_EVP_DigestInit_ex(s.ctx, nil, nil) != 1 {
162162
panic(newOpenSSLError("EVP_DigestInit_ex"))
163163
}
164+
s.lastXofLen = 0
164165
}
165166

166167
// BlockSize returns the rate of the XOF.

0 commit comments

Comments
 (0)