common

package
v0.0.0-...-c815c82 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnexpectedSize is the error used if the size of a parameter does not match its expected value.
	ErrUnexpectedSize = errors.New("blindsign/blindrsa: unexpected input size")

	// ErrInvalidMessageLength is the error used if the size of a protocol message does not match its expected value.
	ErrInvalidMessageLength = errors.New("blindsign/blindrsa: invalid message length")

	// ErrInvalidBlind is the error used if the blind generated by the Verifier fails.
	ErrInvalidBlind = errors.New("blindsign/blindrsa: invalid blind")

	// ErrInvalidRandomness is the error used if caller did not provide randomness to the Blind() function.
	ErrInvalidRandomness = errors.New("blindsign/blindrsa: invalid random parameter")

	// ErrUnsupportedHashFunction is the error used if the specified hash is not supported.
	ErrUnsupportedHashFunction = errors.New("blindsign/blindrsa: unsupported hash function")
)

Functions

func ConvertHashFunction

func ConvertHashFunction(hash crypto.Hash) hash.Hash

ConvertHashFunction converts a crypto.Hash function to an equivalent hash.Hash type.

func DecryptAndCheck

func DecryptAndCheck(random io.Reader, priv *keys.BigPrivateKey, c *big.Int) (m *big.Int, err error)

DecryptAndCheck checks that the private key operation is consistent (fault attack detection).

func EncodeMessageEMSAPSS

func EncodeMessageEMSAPSS(message []byte, N *big.Int, hash hash.Hash, salt []byte) ([]byte, error)

EncodeMessageEMSAPSS hashes the input message and then encodes it using PSS encoding.

func GenerateBlindingFactor

func GenerateBlindingFactor(random io.Reader, N *big.Int) (*big.Int, *big.Int, error)

GenerateBlindingFactor generates a blinding factor and its multiplicative inverse to use for RSA blinding.

func VerifyBlindSignature

func VerifyBlindSignature(pub *keys.BigPublicKey, hashed, sig []byte) error

VerifyBlindSignature verifies the signature of the hashed and encoded message against the input public key.

func VerifyMessageSignature

func VerifyMessageSignature(message, signature []byte, saltLength int, pk *keys.BigPublicKey, hash crypto.Hash) error

VerifyMessageSignature verifies the input message signature against the expected public key

Types

This section is empty.

Jump to

Keyboard shortcuts

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