MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / SSL_Decrypt

Function SSL_Decrypt

extra/yassl/taocrypt/src/rsa.cpp:196–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194
195
196word32 SSL_Decrypt(const RSA_PublicKey& key, const byte* sig, byte* plain)
197{
198 PK_Lengths lengths(key.GetModulus());
199
200 ByteBlock paddedBlock(BitsToBytes(lengths.PaddedBlockBitLength()));
201 Integer x = key.ApplyFunction(Integer(sig,
202 lengths.FixedCiphertextLength()));
203 if (x.ByteCount() > paddedBlock.size())
204 x = Integer::Zero();
205 x.Encode(paddedBlock.get_buffer(), paddedBlock.size());
206 return RSA_BlockType1().UnPad(paddedBlock.get_buffer(),
207 lengths.PaddedBlockBitLength(), plain);
208}
209
210
211} // namespace

Callers 1

SSL_VerifyMethod · 0.85

Calls 10

BitsToBytesFunction · 0.85
RSA_BlockType1Class · 0.85
PaddedBlockBitLengthMethod · 0.80
ApplyFunctionMethod · 0.80
EncodeMethod · 0.80
UnPadMethod · 0.80
IntegerClass · 0.50
FixedCiphertextLengthMethod · 0.45
sizeMethod · 0.45
get_bufferMethod · 0.45

Tested by

no test coverage detected