Skip to content

Commit

Permalink
[libc][cgo] refs fibercrypto#105 Correcting cipher.secp256k1 to err…
Browse files Browse the repository at this point in the history
…or memory to pyskycoin
  • Loading branch information
Maykel Arias Torres committed Sep 25, 2019
1 parent c402645 commit 472036f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/cgo/cipher.secp256k1-go.secp256k1.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"reflect"
"unsafe"

"github.com/skycoin/skycoin/src/cipher/secp256k1-go"
Expand All @@ -15,11 +16,11 @@ import (
import "C"

//export SKY_secp256k1_PubkeyFromSeckey
func SKY_secp256k1_PubkeyFromSeckey(__seckey []byte, _arg1 *[]byte) (____error_code uint32) {
func SKY_secp256k1_PubkeyFromSeckey(__seckey []byte, _arg1 *C.GoSlice_) (____error_code uint32) {
seckey := *(*[]byte)(unsafe.Pointer(&__seckey))
__arg1 := secp256k1.PubkeyFromSeckey(seckey)
if __arg1 != nil {
*_arg1 = __arg1
copyToGoSlice(reflect.ValueOf(__arg1), _arg1)
____error_code = SKY_OK
return
}
Expand All @@ -42,12 +43,12 @@ func SKY_secp256k1_VerifySecKey(__seckey []byte) (____error_code int) {
}

//export SKY_secp256k1_ECDH
func SKY_secp256k1_ECDH(_pub []byte, _sec []byte, _arg1 *[]byte) (____error_code uint32) {
func SKY_secp256k1_ECDH(_pub []byte, _sec []byte, _arg1 *C.GoSlice_) (____error_code uint32) {
pubkey := *(*[]byte)(unsafe.Pointer(&_pub))
seckey := *(*[]byte)(unsafe.Pointer(&_sec))
__arg1 := secp256k1.ECDH(pubkey, seckey)
if __arg1 != nil {
*_arg1 = __arg1
copyToGoSlice(reflect.ValueOf(__arg1), _arg1)
____error_code = SKY_OK
return
}
Expand Down

0 comments on commit 472036f

Please sign in to comment.