According to PKCS#1V2.1, the data to be signed should be padded as follows:
Sign and verify
EM = 0x00 || 0x01 || PS || 0x00 || T
EM: 0x80 length bytes to be signed;
PS: pad with 0xFF, length: Len(EM) –3 – Len(T).
Encrypt and decrypt
EM = 0x00 || 0x02 || PS || 0x00 || M
EM: 0x80 length bytes to be encrypted;
PS: pad with random data, length: Len(EM) –3 – Len(M).