package crypto

import (
	
	// #nosec
	//
	// Allowing sha1 because it is used in MTProto itself.
	
	
)

// RSAKeyBits is RSA key size.
//
// Can be used as rsa.GenerateKey(src, RSAKeyBits).
const RSAKeyBits = 2048

const (
	rsaLen         = 256
	rsaWithHashLen = 255
	rsaDataLen     = rsaWithHashLen - sha1.Size
)

// RSAPublicDecrypt recovers the message digest from the raw signature
// using the signer’s RSA public key.
//
// See also OpenSSL’s RSA_public_decrypt with RSA_NO_PADDING.
func ( *rsa.PublicKey,  []byte) ([]byte, error) {
	 := .Size()
	if  < 11 ||  != len() {
		return nil, rsa.ErrVerification
	}

	 := new(big.Int).SetBytes()
	 := big.NewInt(int64(.E))
	 := new(big.Int).Exp(, , .N)

	return .Bytes(), nil
}

func ( []byte,  *rsa.PublicKey) []byte {
	 := new(big.Int).SetBytes()
	 := big.NewInt(int64(.E))
	 := new(big.Int).Exp(, , .N)
	 := make([]byte, rsaLen)
	.FillBytes()
	return 
}

func ( []byte,  *rsa.PrivateKey,  []byte) bool {
	 := new(big.Int).SetBytes()
	 := new(big.Int).Exp(, .D, .N)
	return FillBytes(, )
}