Skip to content

Commit

Permalink
[cgo] refs fibercrypto#116 Finalized cipher.bitcoin
Browse files Browse the repository at this point in the history
  • Loading branch information
Maykel Arias Torres committed Jan 18, 2020
1 parent e7628aa commit c90ce99
Showing 1 changed file with 2 additions and 48 deletions.
50 changes: 2 additions & 48 deletions lib/cgo/cipher.bitcoin.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ import (
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include "skytypes.h"
#include "skyfee.h"
*/
import "C"

//export SKY_cipher_BitcoinPubKeyRipemd160
func SKY_cipher_BitcoinPubKeyRipemd160(_pubKey *C.cipher__PubKey, _arg1 *C.cipher__Ripemd160) (____error_code uint32) {
____error_code = 0
pubKey := *(*cipher.PubKey)(unsafe.Pointer(_pubKey))
__arg1 := cipher.BitcoinPubKeyRipemd160(pubKey)
copyToBuffer(reflect.ValueOf(__arg1[:]), unsafe.Pointer(_arg1), uint(SizeofRipemd160))
Expand All @@ -27,7 +28,6 @@ func SKY_cipher_BitcoinPubKeyRipemd160(_pubKey *C.cipher__PubKey, _arg1 *C.ciphe

//export SKY_cipher_BitcoinAddressFromPubKey
func SKY_cipher_BitcoinAddressFromPubKey(_pubKey *C.cipher__PubKey, _arg1 *C.cipher__BitcoinAddress) (____error_code uint32) {
____error_code = 0
pubKey := *(*cipher.PubKey)(unsafe.Pointer(_pubKey))
__arg1 := cipher.BitcoinAddressFromPubKey(pubKey)
*_arg1 = *(*C.cipher__BitcoinAddress)(unsafe.Pointer(&__arg1))
Expand All @@ -36,7 +36,6 @@ func SKY_cipher_BitcoinAddressFromPubKey(_pubKey *C.cipher__PubKey, _arg1 *C.cip

//export SKY_cipher_BitcoinAddressFromSecKey
func SKY_cipher_BitcoinAddressFromSecKey(_secKey *C.cipher__SecKey, _arg1 *C.cipher__BitcoinAddress) (____error_code uint32) {
____error_code = 0
secKey := *(*cipher.SecKey)(unsafe.Pointer(_secKey))
__arg1, ____return_err := cipher.BitcoinAddressFromSecKey(secKey)
____error_code = libErrorCode(____return_err)
Expand All @@ -46,18 +45,8 @@ func SKY_cipher_BitcoinAddressFromSecKey(_secKey *C.cipher__SecKey, _arg1 *C.cip
return
}

//export SKY_cipher_MustBitcoinAddressFromSecKey
func SKY_cipher_MustBitcoinAddressFromSecKey(_secKey *C.cipher__SecKey, _arg1 *C.cipher__BitcoinAddress) (____error_code uint32) {
____error_code = 0
secKey := *(*cipher.SecKey)(unsafe.Pointer(_secKey))
__arg1 := cipher.MustBitcoinAddressFromSecKey(secKey)
*_arg1 = *(*C.cipher__BitcoinAddress)(unsafe.Pointer(&__arg1))
return
}

//export SKY_cipher_DecodeBase58BitcoinAddress
func SKY_cipher_DecodeBase58BitcoinAddress(_addr string, _arg1 *C.cipher__BitcoinAddress) (____error_code uint32) {
____error_code = 0
addr := _addr
__arg1, ____return_err := cipher.DecodeBase58BitcoinAddress(addr)
____error_code = libErrorCode(____return_err)
Expand All @@ -67,18 +56,8 @@ func SKY_cipher_DecodeBase58BitcoinAddress(_addr string, _arg1 *C.cipher__Bitcoi
return
}

//export SKY_cipher_MustDecodeBase58BitcoinAddress
func SKY_cipher_MustDecodeBase58BitcoinAddress(_addr string, _arg1 *C.cipher__BitcoinAddress) (____error_code uint32) {
____error_code = 0
addr := _addr
__arg1 := cipher.MustDecodeBase58BitcoinAddress(addr)
*_arg1 = *(*C.cipher__BitcoinAddress)(unsafe.Pointer(&__arg1))
return
}

//export SKY_cipher_BitcoinAddressFromBytes
func SKY_cipher_BitcoinAddressFromBytes(_b []byte, _arg1 *C.cipher__BitcoinAddress) (____error_code uint32) {
____error_code = 0
b := *(*[]byte)(unsafe.Pointer(&_b))
__arg1, ____return_err := cipher.BitcoinAddressFromBytes(b)
____error_code = libErrorCode(____return_err)
Expand All @@ -88,18 +67,8 @@ func SKY_cipher_BitcoinAddressFromBytes(_b []byte, _arg1 *C.cipher__BitcoinAddre
return
}

//export SKY_cipher_MustBitcoinAddressFromBytes
func SKY_cipher_MustBitcoinAddressFromBytes(_b []byte, _arg1 *C.cipher__BitcoinAddress) (____error_code uint32) {
____error_code = 0
b := *(*[]byte)(unsafe.Pointer(&_b))
__arg1 := cipher.MustBitcoinAddressFromBytes(b)
*_arg1 = *(*C.cipher__BitcoinAddress)(unsafe.Pointer(&__arg1))
return
}

//export SKY_cipher_BitcoinAddress_Null
func SKY_cipher_BitcoinAddress_Null(_addr *C.cipher__BitcoinAddress, _arg0 *bool) (____error_code uint32) {
____error_code = 0
addr := *(*cipher.BitcoinAddress)(unsafe.Pointer(_addr))
__arg0 := addr.Null()
*_arg0 = __arg0
Expand All @@ -108,7 +77,6 @@ func SKY_cipher_BitcoinAddress_Null(_addr *C.cipher__BitcoinAddress, _arg0 *bool

//export SKY_cipher_BitcoinAddress_Bytes
func SKY_cipher_BitcoinAddress_Bytes(_addr *C.cipher__BitcoinAddress, _arg0 *C.GoSlice_) (____error_code uint32) {
____error_code = 0
addr := *(*cipher.BitcoinAddress)(unsafe.Pointer(_addr))
__arg0 := addr.Bytes()
copyToGoSlice(reflect.ValueOf(__arg0), _arg0)
Expand All @@ -117,7 +85,6 @@ func SKY_cipher_BitcoinAddress_Bytes(_addr *C.cipher__BitcoinAddress, _arg0 *C.G

//export SKY_cipher_BitcoinAddress_Verify
func SKY_cipher_BitcoinAddress_Verify(_addr *C.cipher__BitcoinAddress, _key *C.cipher__PubKey) (____error_code uint32) {
____error_code = 0
addr := *(*cipher.BitcoinAddress)(unsafe.Pointer(_addr))
key := *(*cipher.PubKey)(unsafe.Pointer(_key))
____return_err := addr.Verify(key)
Expand All @@ -129,7 +96,6 @@ func SKY_cipher_BitcoinAddress_Verify(_addr *C.cipher__BitcoinAddress, _key *C.c

//export SKY_cipher_BitcoinAddress_String
func SKY_cipher_BitcoinAddress_String(_addr *C.cipher__BitcoinAddress, _arg0 *C.GoString_) (____error_code uint32) {
____error_code = 0
addr := *(*cipher.BitcoinAddress)(unsafe.Pointer(_addr))
__arg0 := addr.String()
copyString(__arg0, _arg0)
Expand All @@ -138,7 +104,6 @@ func SKY_cipher_BitcoinAddress_String(_addr *C.cipher__BitcoinAddress, _arg0 *C.

//export SKY_cipher_BitcoinAddress_Checksum
func SKY_cipher_BitcoinAddress_Checksum(_addr *C.cipher__BitcoinAddress, _arg0 *C.cipher__Checksum) (____error_code uint32) {
____error_code = 0
addr := *(*cipher.BitcoinAddress)(unsafe.Pointer(_addr))
__arg0 := addr.Checksum()
*_arg0 = *(*C.cipher__Checksum)(unsafe.Pointer(&__arg0))
Expand All @@ -147,7 +112,6 @@ func SKY_cipher_BitcoinAddress_Checksum(_addr *C.cipher__BitcoinAddress, _arg0 *

//export SKY_cipher_BitcoinWalletImportFormatFromSeckey
func SKY_cipher_BitcoinWalletImportFormatFromSeckey(_seckey *C.cipher__SecKey, _arg1 *C.GoString_) (____error_code uint32) {
____error_code = 0
seckey := *(*cipher.SecKey)(unsafe.Pointer(_seckey))
__arg1 := cipher.BitcoinWalletImportFormatFromSeckey(seckey)
copyString(__arg1, _arg1)
Expand All @@ -156,7 +120,6 @@ func SKY_cipher_BitcoinWalletImportFormatFromSeckey(_seckey *C.cipher__SecKey, _

//export SKY_cipher_SecKeyFromBitcoinWalletImportFormat
func SKY_cipher_SecKeyFromBitcoinWalletImportFormat(_input string, _arg1 *C.cipher__SecKey) (____error_code uint32) {
____error_code = 0
input := _input
__arg1, ____return_err := cipher.SecKeyFromBitcoinWalletImportFormat(input)
____error_code = libErrorCode(____return_err)
Expand All @@ -165,12 +128,3 @@ func SKY_cipher_SecKeyFromBitcoinWalletImportFormat(_input string, _arg1 *C.ciph
}
return
}

//export SKY_cipher_MustSecKeyFromBitcoinWalletImportFormat
func SKY_cipher_MustSecKeyFromBitcoinWalletImportFormat(_input string, _arg1 *C.cipher__SecKey) (____error_code uint32) {
____error_code = 0
input := _input
__arg1 := cipher.MustSecKeyFromBitcoinWalletImportFormat(input)
copyToBuffer(reflect.ValueOf(__arg1[:]), unsafe.Pointer(_arg1), uint(SizeofSecKey))
return
}

0 comments on commit c90ce99

Please sign in to comment.