I'm playing around with the openSSL library and it requires me to brush up on pointers, and I'm having difficulty.
I have a objective-c method:
-(unsigned char *)encryptTake1:(unsigned char *)input inputLength:(int)inLen outputLength:(int*)outLen;
It takes some data, encrypts it and returns a pointer to the data and the length of the data as an output parameter.
I want to change this so that the encrypted data is also handled as an output parameter and the return value is used to indicate success or failure. This is what I have:
-(int)encryptTake2:(unsigned char *)input inputLength:(int)inLen output:(unsigned char *)output outputLength:(int*)outLen;
This doesn't work. What am I doing wrong? I think the problem is that (unsigned char *)
is the wrong. If (unsigned char *)
is wrong then I presume I will also need to change how output
is referenced within the method. How?