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

Method Encrypt

extra/yassl/taocrypt/include/rsa.hpp:177–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175// Public Encrypt
176template<class Pad>
177void RSA_Encryptor<Pad>::Encrypt(const byte* plain, word32 sz, byte* cipher,
178 RandomNumberGenerator& rng)
179{
180 PK_Lengths lengths(key_.GetModulus());
181 if (sz > lengths.FixedMaxPlaintextLength())
182 return;
183
184 ByteBlock paddedBlock(lengths.PaddedBlockByteLength());
185 padding_.Pad(plain, sz, paddedBlock.get_buffer(),
186 lengths.PaddedBlockBitLength(), rng);
187
188 key_.ApplyFunction(Integer(paddedBlock.get_buffer(), paddedBlock.size())).
189 Encode(cipher, lengths.FixedCiphertextLength());
190}
191
192
193// Private Decrypt

Callers 4

bench_rsaFunction · 0.80
rsa_testFunction · 0.80
SSL_SignMethod · 0.80
encryptMethod · 0.80

Calls 10

PaddedBlockByteLengthMethod · 0.80
PadMethod · 0.80
PaddedBlockBitLengthMethod · 0.80
EncodeMethod · 0.80
ApplyFunctionMethod · 0.80
IntegerClass · 0.70
get_bufferMethod · 0.45
sizeMethod · 0.45
FixedCiphertextLengthMethod · 0.45

Tested by 1

rsa_testFunction · 0.64