|
@ -160,7 +160,7 @@ func TestSignatureScannerValuer(t *testing.T) { |
|
|
assert.Equal(t, value, scan) |
|
|
assert.Equal(t, value, scan) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func TestPubKeyScannerValuer(t *testing.T) { |
|
|
|
|
|
|
|
|
func TestPublicKeyScannerValuer(t *testing.T) { |
|
|
privKValue := NewRandPrivKey() |
|
|
privKValue := NewRandPrivKey() |
|
|
pubKValue := privKValue.Public() |
|
|
pubKValue := privKValue.Public() |
|
|
privKScan := NewRandPrivKey() |
|
|
privKScan := NewRandPrivKey() |
|
@ -175,6 +175,21 @@ func TestPubKeyScannerValuer(t *testing.T) { |
|
|
assert.Equal(t, value, scan) |
|
|
assert.Equal(t, value, scan) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func TestPublicKeyCompScannerValuer(t *testing.T) { |
|
|
|
|
|
privKValue := NewRandPrivKey() |
|
|
|
|
|
pubKCompValue := privKValue.Public().Compress() |
|
|
|
|
|
privKScan := NewRandPrivKey() |
|
|
|
|
|
pubKCompScan := privKScan.Public().Compress() |
|
|
|
|
|
var value driver.Valuer |
|
|
|
|
|
var scan sql.Scanner |
|
|
|
|
|
value = &pubKCompValue |
|
|
|
|
|
scan = &pubKCompScan |
|
|
|
|
|
fromDB, err := value.Value() |
|
|
|
|
|
assert.Nil(t, err) |
|
|
|
|
|
assert.Nil(t, scan.Scan(fromDB)) |
|
|
|
|
|
assert.Equal(t, value, scan) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
func BenchmarkBabyjubEddsa(b *testing.B) { |
|
|
func BenchmarkBabyjubEddsa(b *testing.B) { |
|
|
var k PrivateKey |
|
|
var k PrivateKey |
|
|
_, err := hex.Decode(k[:], |
|
|
_, err := hex.Decode(k[:], |
|
|