There is EVP_PKEY_get_size() function which will give you the maximum length the encrypted data can have. Unfortunately it cannot give you the exact length which might be smaller in some cases. Tomas Mraz On Thu, 2022-09-29 at 21:49 +0000, ANUJ SHARMA wrote: > Hi, > I am working on this function. > result = EVP_PKEY_decrypt(ctx, DecryptedData, &outlen, > EncryptedData,256); > > I am getting the encrypted data from a different location and code is > in such a way that we just have a pointer pointing to the starting of > Encrypted data. Meaning -We don't know the encrypted data length. > I passed a pointer of encrypted data to this function and decryption > is also happening properly. > My doubt is whether is there any openssl/EVP_PKEY function or any way > by which we can find the exact encrypted data length before doing the > decryption. > > Thanks in advance for helping me out! -- Tomáš Mráz, OpenSSL