Documentation ¶
Index ¶
- type ISO9796d1Encoding
- func (i *ISO9796d1Encoding) BlockSize() int
- func (i *ISO9796d1Encoding) GetUnderlyingCipher() cipherEngine
- func (i *ISO9796d1Encoding) Init(forEncryption bool, key RSAKeyParameters)
- func (i *ISO9796d1Encoding) InputBlockSize() int
- func (i *ISO9796d1Encoding) OutputBlockSize() int
- func (i *ISO9796d1Encoding) PadBits() int
- func (i *ISO9796d1Encoding) ProcessBlock(in []byte, inOff, inLen int) ([]byte, error)
- func (i *ISO9796d1Encoding) SetPadBits(padBits int)
- type RSACoreEngine
- func (r *RSACoreEngine) ConvertInput(in []byte, inOff, inLen int) *big.Int
- func (r *RSACoreEngine) ConvertOutput(result *big.Int) []byte
- func (r *RSACoreEngine) Init(forEncryption bool, key RSAKeyParameters)
- func (r *RSACoreEngine) InputBlockSize() int
- func (r *RSACoreEngine) OutputBlockSize() int
- func (r *RSACoreEngine) ProcessBlock(input *big.Int) *big.Int
- type RSAEngine
- type RSAKeyParameters
- type RSAPrivateCrtKeyParameters
- func (r *RSAPrivateCrtKeyParameters) DP() *big.Int
- func (r *RSAPrivateCrtKeyParameters) DQ() *big.Int
- func (r *RSAPrivateCrtKeyParameters) P() *big.Int
- func (r *RSAPrivateCrtKeyParameters) PublicExponent() *big.Int
- func (r *RSAPrivateCrtKeyParameters) Q() *big.Int
- func (r *RSAPrivateCrtKeyParameters) QInv() *big.Int
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)
type RSAKeyParameters ¶
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 (r *RSAPrivateCrtKeyParameters) DP() *big.Int
func (*RSAPrivateCrtKeyParameters) DQ ¶
func (r *RSAPrivateCrtKeyParameters) DQ() *big.Int
func (*RSAPrivateCrtKeyParameters) P ¶
func (r *RSAPrivateCrtKeyParameters) P() *big.Int
func (*RSAPrivateCrtKeyParameters) PublicExponent ¶
func (r *RSAPrivateCrtKeyParameters) PublicExponent() *big.Int
func (*RSAPrivateCrtKeyParameters) Q ¶
func (r *RSAPrivateCrtKeyParameters) Q() *big.Int
func (*RSAPrivateCrtKeyParameters) QInv ¶
func (r *RSAPrivateCrtKeyParameters) QInv() *big.Int