Extracted from Pike v7.8 release 866 at 2016-11-06.
pike.ida.liu.se
[Top]
Crypto
Crypto.RSA

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 equvivalent 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.