github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/gnovm/stdlibs/crypto/ed25519/ed25519_test.gno (about)

     1  package ed25519
     2  
     3  import (
     4  	"crypto/ed25519"
     5  	"encoding/hex"
     6  	"std"
     7  	"testing"
     8  )
     9  
    10  func TestVerify(t *testing.T) {
    11  	publicKey, _ := hex.DecodeString("0D853FA898A07EB91F618BB3E8B738B0E45BE9B3053799A2C42F8204F5FA3505")
    12  	signature, _ := hex.DecodeString("2B39638983858715AD2FA059665ADFE267936B8F20C4DA01E9650958E0CA65C0255C75164360F468087FE8385140E48EE3471E332472A50AEE599F9D0EADD106")
    13  	if !ed25519.Verify(publicKey, []byte("hello gno.land"), signature) {
    14  		t.Error("verify failed")
    15  	}
    16  }