Movatterモバイル変換


[0]ホーム

URL:


ed25519

package
v0.46.0Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2025 License:BSD-3-ClauseImports:2Imported by:2,945

Details

Repository

cs.opensource.google/go/x/crypto

Links

Documentation

Overview

Package ed25519 implements the Ed25519 signature algorithm.

These functions are also compatible with the “Ed25519” function defined inRFC 8032. However, unlikeRFC 8032's formulation, this package's private keyrepresentation includes a public key suffix to make multiple signingoperations with the same key more efficient. This package refers to theRFC8032 private key as the “seed”.

The ed25519 package is a wrapper for the Ed25519 implementation in thecrypto/ed25519 package. It isfrozen and is not accepting new features.

Index

Constants

View Source
const (// PublicKeySize is the size, in bytes, of public keys as used in this package.PublicKeySize = 32// PrivateKeySize is the size, in bytes, of private keys as used in this package.PrivateKeySize = 64// SignatureSize is the size, in bytes, of signatures generated and verified by this package.SignatureSize = 64// SeedSize is the size, in bytes, of private key seeds. These are the private key representations used byRFC 8032.SeedSize = 32)

Variables

This section is empty.

Functions

funcGenerateKey

func GenerateKey(randio.Reader) (PublicKey,PrivateKey,error)

GenerateKey generates a public/private key pair using entropy from rand.If rand is nil, crypto/rand.Reader will be used.

funcSign

func Sign(privateKeyPrivateKey, message []byte) []byte

Sign signs the message with privateKey and returns a signature. It willpanic if len(privateKey) is not PrivateKeySize.

funcVerify

func Verify(publicKeyPublicKey, message, sig []byte)bool

Verify reports whether sig is a valid signature of message by publicKey. Itwill panic if len(publicKey) is not PublicKeySize.

Types

typePrivateKey

type PrivateKey =ed25519.PrivateKey

PrivateKey is the type of Ed25519 private keys. It implements crypto.Signer.

This type is an alias for crypto/ed25519's PrivateKey type.See the crypto/ed25519 package for the methods on this type.

funcNewKeyFromSeed

func NewKeyFromSeed(seed []byte)PrivateKey

NewKeyFromSeed calculates a private key from a seed. It will panic iflen(seed) is not SeedSize. This function is provided for interoperabilitywithRFC 8032.RFC 8032's private keys correspond to seeds in thispackage.

typePublicKey

type PublicKey =ed25519.PublicKey

PublicKey is the type of Ed25519 public keys.

This type is an alias for crypto/ed25519's PublicKey type.See the crypto/ed25519 package for the methods on this type.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp