mirror of https://github.com/waku-org/go-rln.git
fix
This commit is contained in:
parent
970c92157e
commit
e928e8a25a
|
@ -15,15 +15,12 @@ type RLN struct {
|
|||
|
||||
func (r *RLN) Hash(input []byte) []byte {
|
||||
size := int(unsafe.Sizeof(C.Buffer{}))
|
||||
out_ptr := C.malloc(C.size_t(size))
|
||||
|
||||
size = int(unsafe.Sizeof(C.Buffer{}))
|
||||
in_ptr := C.malloc(C.size_t(size))
|
||||
in := (*C.Buffer)(in_ptr)
|
||||
*in = toBuffer(input)
|
||||
in := (*C.Buffer)(C.malloc(C.size_t(size)))
|
||||
|
||||
out := (*C.Buffer)(out_ptr)
|
||||
C.hash(r.ptr, in, &in.len, out)
|
||||
out := (*C.Buffer)(C.malloc(C.size_t(size)))
|
||||
C.hash(r.ptr, in, size, out)
|
||||
|
||||
return C.GoBytes(unsafe.Pointer(out.ptr), C.int(out.len))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue