Pike v8.0 release 1738

Method Crypto.RSA()->rsa_pad()


Method rsa_pad

Gmp.mpz rsa_pad(string message, int(1..2) type, function(int:string)|void random)

Description

Pads the message to the current block size with method type and returns the result as an integer. This is equivalent to OS2IP(EME-PKCS1-V1_5-ENCODE(message)) in PKCS-1.

Parameter type
1

The message is padded with 0xff bytes.

2

The message is padded with random data, using the random function if provided. Otherwise Crypto.Random.random_string will be used.