crypto

package
v0.1.3-beta1 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ISO9796d1Encoding

type ISO9796d1Encoding struct {
	// contains filtered or unexported fields
}

* * ISO 9796-1 padding. Note in the light of recent results you should * only use this with RSA (rather than the "simpler" Rabin keys) and you * should never use it with anything other than a hash (ie. even if the * message is small don't sign the message, sign it's hash) or some "random" * value. See your favorite search engine for details.

implements AsymmetricBlockCipher

func NewISO9796d1Encoding

func NewISO9796d1Encoding(cipher cipherEngine) *ISO9796d1Encoding

func (*ISO9796d1Encoding) BlockSize

func (i *ISO9796d1Encoding) BlockSize() int

func (*ISO9796d1Encoding) GetUnderlyingCipher

func (i *ISO9796d1Encoding) GetUnderlyingCipher() cipherEngine

func (*ISO9796d1Encoding) Init

func (i *ISO9796d1Encoding) Init(forEncryption bool, key RSAKeyParameters)

func (*ISO9796d1Encoding) InputBlockSize

func (i *ISO9796d1Encoding) InputBlockSize() int

* * return the input block size. The largest message we can process * is (key_size_in_bits + 3)/16, which in our world comes to * key_size_in_bytes / 2.

func (*ISO9796d1Encoding) OutputBlockSize

func (i *ISO9796d1Encoding) OutputBlockSize() int

* * return the maximum possible size for the output.

func (*ISO9796d1Encoding) PadBits

func (i *ISO9796d1Encoding) PadBits() int

* * retrieve the number of pad bits in the last decoded message.

func (*ISO9796d1Encoding) ProcessBlock

func (i *ISO9796d1Encoding) ProcessBlock(in []byte, inOff, inLen int) ([]byte, error)

func (*ISO9796d1Encoding) SetPadBits

func (i *ISO9796d1Encoding) SetPadBits(padBits int)

* * set the number of bits in the next message to be treated as * pad bits.

type RSACoreEngine

type RSACoreEngine struct {
	// contains filtered or unexported fields
}

func (*RSACoreEngine) ConvertInput

func (r *RSACoreEngine) ConvertInput(in []byte, inOff, inLen int) *big.Int

func (*RSACoreEngine) ConvertOutput

func (r *RSACoreEngine) ConvertOutput(result *big.Int) []byte

func (*RSACoreEngine) Init

func (r *RSACoreEngine) Init(forEncryption bool, key RSAKeyParameters)

func (*RSACoreEngine) InputBlockSize

func (r *RSACoreEngine) InputBlockSize() int

func (*RSACoreEngine) OutputBlockSize

func (r *RSACoreEngine) OutputBlockSize() int

func (*RSACoreEngine) ProcessBlock

func (r *RSACoreEngine) ProcessBlock(input *big.Int) *big.Int

type RSAEngine

type RSAEngine struct {
	*RSACoreEngine
}

func (*RSAEngine) Init

func (r *RSAEngine) Init(forEncryption bool, key RSAKeyParameters)

func (*RSAEngine) ProcessBlock

func (r *RSAEngine) ProcessBlock(in []byte, inOff, inLen int) []byte

type RSAKeyParameters

type RSAKeyParameters interface {
	Modulus() *big.Int
	Exponent() *big.Int
	Private() bool
}

func NewRSAKeyParameters

func NewRSAKeyParameters(isPrivate bool, modulus, exponent *big.Int) RSAKeyParameters

type RSAPrivateCrtKeyParameters

type RSAPrivateCrtKeyParameters struct {
	RSAKeyParameters
	// contains filtered or unexported fields
}

func NewRSAPrivateCrtKeyParameters

func NewRSAPrivateCrtKeyParameters(
	modulus,
	publicExponent,
	privateExponent,
	p,
	q,
	dP,
	dQ,
	qInv *big.Int) *RSAPrivateCrtKeyParameters

func (*RSAPrivateCrtKeyParameters) DP

func (*RSAPrivateCrtKeyParameters) DQ

func (*RSAPrivateCrtKeyParameters) P

func (*RSAPrivateCrtKeyParameters) PublicExponent

func (r *RSAPrivateCrtKeyParameters) PublicExponent() *big.Int

func (*RSAPrivateCrtKeyParameters) Q

func (*RSAPrivateCrtKeyParameters) QInv

func (r *RSAPrivateCrtKeyParameters) QInv() *big.Int

Jump to

Keyboard shortcuts

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