go113_test.go 554 B

123456789101112131415161718192021222324
  1. // Copyright 2019 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // +build go1.13
  5. package ed25519_test
  6. import (
  7. ed25519std "crypto/ed25519"
  8. "golang.org/x/crypto/ed25519"
  9. "testing"
  10. )
  11. func TestTypeAlias(t *testing.T) {
  12. var zero zeroReader
  13. public, private, _ := ed25519std.GenerateKey(zero)
  14. message := []byte("test message")
  15. sig := ed25519.Sign(private, message)
  16. if !ed25519.Verify(public, message, sig) {
  17. t.Errorf("valid signature rejected")
  18. }
  19. }