var ( ErrUnexpectedSize = common.ErrUnexpectedSize ErrInvalidMessageLength = common.ErrInvalidMessageLength ErrInvalidBlind = common.ErrInvalidBlind ErrInvalidRandomness = common.ErrInvalidRandomness ErrUnsupportedHashFunction = common.ErrUnsupportedHashFunction )
An Signer represents the Signer in the blind RSA protocol. It carries the raw RSA private key used for signing blinded messages.
type Signer struct {
// contains filtered or unexported fields
}
func NewSigner(sk *rsa.PrivateKey) Signer
NewSigner creates a new Signer for the blind RSA protocol using an RSA private key.
func (signer Signer) BlindSign(data []byte) ([]byte, error)
BlindSign blindly computes the RSA operation using the Signer's private key on the blinded message input, if it's of valid length, and returns an error should the function fail.
See the specification for more details: https://www.rfc-editor.org/rfc/rfc9474.html#name-blindsign
Verifier is a type that implements the client side of the blind RSA protocol, described in https://www.rfc-editor.org/rfc/rfc9474.html#name-rsabssa-variants
type Verifier interface { // Blind initializes the blind RSA protocol using an input message and source of randomness. The // signature is deterministic. This function fails if randomness was not provided. Blind(random io.Reader, message []byte) ([]byte, VerifierState, error) // FixedBlind runs the Blind function with fixed blind and salt inputs. FixedBlind(message, blind, salt []byte) ([]byte, VerifierState, error) // Verify verifies the input (message, signature) pair and produces an error upon failure. Verify(message, signature []byte) error // Hash returns the hash function associated with the Verifier. Hash() hash.Hash }
func NewDeterministicVerifier(pk *rsa.PublicKey, hash crypto.Hash) Verifier
NewDeterministicVerifier creates a new DeterministicBRSAVerifier using the corresponding Signer parameters. This corresponds to the RSABSSA-SHA384-PSSZERO-Deterministic variant. See the specification for more details: https://www.rfc-editor.org/rfc/rfc9474.html#name-rsabssa-variants
func NewVerifier(pk *rsa.PublicKey, hash crypto.Hash) Verifier
NewVerifier creates a new BRSAVerifier using the corresponding Signer parameters. This corresponds to the RSABSSA-SHA384-PSS-Deterministic variant. See the specification for more details: https://www.rfc-editor.org/rfc/rfc9474.html#name-rsabssa-variants
An VerifierState carries state needed to complete the blind signature protocol as a verifier.
type VerifierState struct {
// contains filtered or unexported fields
}
func (state VerifierState) CopyBlind() []byte
CopyBlind returns an encoding of the blind value used in the protocol.
func (state VerifierState) CopySalt() []byte
CopySalt returns an encoding of the per-message salt used in the protocol.
func (state VerifierState) Finalize(data []byte) ([]byte, error)
Finalize computes and outputs the final signature, if it's valid. Otherwise, it returns an error.
See the specification for more details: https://www.rfc-editor.org/rfc/rfc9474.html#name-finalize
Name | Synopsis |
---|---|
.. | |
partiallyblindrsa | Package partiallyblindrsa implements a partially blind RSA protocol. |