2018-03-23 15:46:14 +00:00
|
|
|
package mcrypto
|
|
|
|
|
|
|
|
import (
|
|
|
|
. "testing"
|
|
|
|
|
2018-07-03 00:20:00 +00:00
|
|
|
"github.com/mediocregopher/mediocre-go-lib/mrand"
|
2018-03-23 15:46:14 +00:00
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestKeyPair(t *T) {
|
|
|
|
pub, priv := NewWeakKeyPair()
|
|
|
|
|
|
|
|
// test signing/verifying
|
2018-07-03 00:20:00 +00:00
|
|
|
str := mrand.Hex(512)
|
2018-03-23 15:46:14 +00:00
|
|
|
sig := SignString(priv, str)
|
|
|
|
assert.NoError(t, VerifyString(pub, sig, str))
|
|
|
|
}
|