In general, Crypto++ buffers can be the same or they can be distinct. I can't think of a situation where they are not allowed to be the same for in-place or in-situ processing of plain text or cipher text data. The only caveat is the buffer has to be larger enough for cipher text expansion.
You also have to be careful about overlap, but how you can get into trouble depends on the cipher. For example, AES
in CBC_Mode
operates on 16 byte blocks (the functions of interest are ProcessBlock
, ProcessXorBlock
, and friends). You can use an overlapped buffer as long as the difference between pointers is 17 bytes (or more). In the RSA case, you would likely need a difference of MaxPreImage
size, which is based on the size of the modulus.
Finally, the old Crypto++ FAQ discusses it briefly as "in-line processing". See How do I use a block cipher in Crypto++ 4.x?