From 1ada521ca01a12654337ce292b6c6e6f18a90580 Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Thu, 8 Sep 2016 09:10:50 +0900 Subject: avoid copy of instance at Go --- src/bls_if.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/bls_if.cpp') diff --git a/src/bls_if.cpp b/src/bls_if.cpp index c8fb5d3..7576c93 100644 --- a/src/bls_if.cpp +++ b/src/bls_if.cpp @@ -57,6 +57,10 @@ void blsIdDestroy(blsId *id) { delete (bls::Id*)id; } +void blsIdCopy(blsId *dst, const blsId *src) +{ + *((bls::Id*)dst) = *((const bls::Id*)src); +} int blsIdSetStr(blsId *id, const char *buf, size_t bufSize) { @@ -82,6 +86,10 @@ void blsSecretKeyDestroy(blsSecretKey *sec) { delete (bls::SecretKey*)sec; } +void blsSecretKeyCopy(blsSecretKey *dst, const blsSecretKey *src) +{ + *((bls::SecretKey*)dst) = *((const bls::SecretKey*)src); +} void blsSecretKeyPut(const blsSecretKey *sec) { @@ -143,6 +151,10 @@ void blsPublicKeyDestroy(blsPublicKey *pub) { delete (bls::PublicKey*)pub; } +void blsPublicKeyCopy(blsPublicKey *dst, const blsPublicKey *src) +{ + *((bls::PublicKey*)dst) = *((const bls::PublicKey*)src); +} void blsPublicKeyPut(const blsPublicKey *pub) { std::cout << *(const bls::PublicKey*)pub << std::endl; @@ -178,6 +190,10 @@ void blsSignDestroy(blsSign *sign) { delete (bls::Sign*)sign; } +void blsSignCopy(blsSign *dst, const blsSign *src) +{ + *((bls::Sign*)dst) = *((const bls::Sign*)src); +} void blsSignPut(const blsSign *sign) { std::cout << *(const bls::Sign*)sign << std::endl; -- cgit v1.2.3