aboutsummaryrefslogtreecommitdiffstats
path: root/go
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2017-05-30 05:23:51 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2017-05-30 05:23:51 +0800
commitcdea71ee335760b0f9cb8422dd995176cf6bdc5f (patch)
tree140cb75fc796420c77ca415b2b28a03d0826634c /go
parent4854a50087865b7f4f4147a43e9ff21c26df7e1f (diff)
downloaddexon-bls-cdea71ee335760b0f9cb8422dd995176cf6bdc5f.tar
dexon-bls-cdea71ee335760b0f9cb8422dd995176cf6bdc5f.tar.gz
dexon-bls-cdea71ee335760b0f9cb8422dd995176cf6bdc5f.tar.bz2
dexon-bls-cdea71ee335760b0f9cb8422dd995176cf6bdc5f.tar.lz
dexon-bls-cdea71ee335760b0f9cb8422dd995176cf6bdc5f.tar.xz
dexon-bls-cdea71ee335760b0f9cb8422dd995176cf6bdc5f.tar.zst
dexon-bls-cdea71ee335760b0f9cb8422dd995176cf6bdc5f.zip
rename IsSame to IsEqual
Diffstat (limited to 'go')
-rw-r--r--go/bls/bls.go24
-rw-r--r--go/bls/bls_test.go22
2 files changed, 23 insertions, 23 deletions
diff --git a/go/bls/bls.go b/go/bls/bls.go
index c569f1f..adcacff 100644
--- a/go/bls/bls.go
+++ b/go/bls/bls.go
@@ -139,9 +139,9 @@ func (id *ID) SetDecString(s string) error {
return nil
}
-// IsSame --
-func (id *ID) IsSame(rhs *ID) bool {
- return C.blsIdIsSame(id.getPointer(), rhs.getPointer()) == 1
+// IsEqual --
+func (id *ID) IsEqual(rhs *ID) bool {
+ return C.blsIdIsEqual(id.getPointer(), rhs.getPointer()) == 1
}
// SecretKey --
@@ -220,9 +220,9 @@ func (sec *SecretKey) SetDecString(s string) error {
return nil
}
-// IsSame --
-func (sec *SecretKey) IsSame(rhs *SecretKey) bool {
- return C.blsSecretKeyIsSame(sec.getPointer(), rhs.getPointer()) == 1
+// IsEqual --
+func (sec *SecretKey) IsEqual(rhs *SecretKey) bool {
+ return C.blsSecretKeyIsEqual(sec.getPointer(), rhs.getPointer()) == 1
}
// Init --
@@ -334,9 +334,9 @@ func (pub *PublicKey) SetHexString(s string) error {
return nil
}
-// IsSame --
-func (pub *PublicKey) IsSame(rhs *PublicKey) bool {
- return C.blsPublicKeyIsSame(pub.getPointer(), rhs.getPointer()) == 1
+// IsEqual --
+func (pub *PublicKey) IsEqual(rhs *PublicKey) bool {
+ return C.blsPublicKeyIsEqual(pub.getPointer(), rhs.getPointer()) == 1
}
// Add --
@@ -416,9 +416,9 @@ func (sign *Sign) SetHexString(s string) error {
return nil
}
-// IsSame --
-func (sign *Sign) IsSame(rhs *Sign) bool {
- return C.blsSignatureIsSame(sign.getPointer(), rhs.getPointer()) == 1
+// IsEqual --
+func (sign *Sign) IsEqual(rhs *Sign) bool {
+ return C.blsSignatureIsEqual(sign.getPointer(), rhs.getPointer()) == 1
}
// GetPublicKey --
diff --git a/go/bls/bls_test.go b/go/bls/bls_test.go
index 2561e83..418a664 100644
--- a/go/bls/bls_test.go
+++ b/go/bls/bls_test.go
@@ -21,14 +21,14 @@ func testPre(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- if !id.IsSame(&id2) {
+ if !id.IsEqual(&id2) {
t.Errorf("not same id\n%s\n%s", id.GetHexString(), id2.GetHexString())
}
err = id2.SetDecString(id.GetDecString())
if err != nil {
t.Fatal(err)
}
- if !id.IsSame(&id2) {
+ if !id.IsEqual(&id2) {
t.Errorf("not same id\n%s\n%s", id.GetDecString(), id2.GetDecString())
}
}
@@ -87,7 +87,7 @@ func testStringConversion(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- if !sec.IsSame(&sec2) {
+ if !sec.IsEqual(&sec2) {
t.Error("not equal")
}
}
@@ -122,7 +122,7 @@ func testRecoverSecretKey(t *testing.T) {
if err != nil {
t.Error(err)
}
- if !sec.IsSame(&sec2) {
+ if !sec.IsEqual(&sec2) {
t.Errorf("Mismatch in recovered secret key:\n %s\n %s.", sec.GetHexString(), sec2.GetHexString())
}
}
@@ -154,7 +154,7 @@ func testEachSign(t *testing.T, m string, msk []SecretKey, mpk []PublicKey) ([]I
}
t.Logf("pubVec[%d]=%s\n", i, pubVec[i].GetHexString())
- if !pubVec[i].IsSame(secVec[i].GetPublicKey()) {
+ if !pubVec[i].IsEqual(secVec[i].GetPublicKey()) {
t.Errorf("Pubkey derivation does not match\n%s\n%s", pubVec[i].GetHexString(), secVec[i].GetPublicKey().GetHexString())
}
@@ -187,7 +187,7 @@ func testSign(t *testing.T) {
if err != nil {
t.Error(err)
}
- if !sec0.IsSame(&sec1) {
+ if !sec0.IsEqual(&sec1) {
t.Error("Mismatch in recovered seckey.")
}
var pub1 PublicKey
@@ -195,7 +195,7 @@ func testSign(t *testing.T) {
if err != nil {
t.Error(err)
}
- if !pub0.IsSame(&pub1) {
+ if !pub0.IsEqual(&pub1) {
t.Error("Mismatch in recovered pubkey.")
}
var s1 Sign
@@ -203,7 +203,7 @@ func testSign(t *testing.T) {
if err != nil {
t.Error(err)
}
- if !s0.IsSame(&s1) {
+ if !s0.IsEqual(&s1) {
t.Error("Mismatch in recovered signature.")
}
}
@@ -254,7 +254,7 @@ func testData(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- if !sec1.IsSame(&sec2) {
+ if !sec1.IsEqual(&sec2) {
t.Error("SecretKey not same")
}
pub1 := sec1.GetPublicKey()
@@ -264,7 +264,7 @@ func testData(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- if !pub1.IsSame(&pub2) {
+ if !pub1.IsEqual(&pub2) {
t.Error("PublicKey not same")
}
m := "doremi"
@@ -275,7 +275,7 @@ func testData(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- if !sign1.IsSame(&sign2) {
+ if !sign1.IsEqual(&sign2) {
t.Error("Sign not same")
}
}