crypto

package
v0.0.0-...-84d53aa Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2019 License: GPL-3.0 Imports: 5 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AESCTRXOR

func AESCTRXOR(key, inText, iv []byte) ([]byte, error)

AESCTRXOR encrypts text.

func CheckCryptoAlgorithm

func CheckCryptoAlgorithm(alg algorithm.CryptoAlgorithm) error

CheckCryptoAlgorithm checks algorithm.

func GenerateKey

GenerateKey generates PrivateKey.

func NewSignature

func NewSignature(alg algorithm.CryptoAlgorithm) (signature.Signature, error)

NewSignature returns signature from algorithm.

Types

type Signature

type Signature interface {

	// Algorithm returns the standard algorithm for this key.
	Algorithm() algorithm.CryptoAlgorithm

	// InitSign this object for signing. If this method is called
	// again with a different argument, it negates the effect
	// of this call.
	InitSign(privateKey signature.PrivateKey)

	// Sign returns the signature bytes of all the data input.
	// The format of the signature depends on the underlying
	// signature scheme.
	Sign(data []byte) (out []byte, err error)

	// RecoverPublic returns a public key, which is recovered by data and signature
	RecoverPublic(data []byte, signature []byte) (signature.PublicKey, error)

	// InitVerify initializes this object for verification. If this method is called
	// again with a different argument, it negates the effect
	// of this call.
	InitVerify(publicKey signature.PublicKey)

	// Verify the passed-in signature.
	//
	// <p>A call to this method resets this signature object to the state
	// it was in when previously initialized for verification via a
	// call to <code>initVerify(PublicKey)</code>. That is, the object is
	// reset and available to verify another signature from the identity
	// whose public key was specified in the call to <code>initVerify</code>.
	Verify(data []byte, signature []byte) (bool, error)
}

Signature interface of different signature algorithm

Directories

Path Synopsis
secp256k1
Package secp256k1 wraps the bitcoin secp256k1 C library.
Package secp256k1 wraps the bitcoin secp256k1 C library.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL