arrowd
arrowd

Reputation: 34411

Can buffers in RSA_private_decrypt/RSA_public_encrypt overlap?

Can buffers in openssl's RSA_private_decrypt/RSA_public_encrypt overlap? By buffers i mean second and third args - unsigned char *from, unsigned char *to.

Upvotes: 2

Views: 907

Answers (1)

Thomas Pornin
Thomas Pornin

Reputation: 74482

This is not documented. However, OpenSSL itself uses RSA_private_decrypt() with the same pointer for from and to, in ssl/s3_srvr.c (seen in OpenSSL 0.9.8o source code), so it must be safe.

Upvotes: 1

Related Questions