RichieCryptor

Objective-C

@protocol RichieCryptor <NSObject>

/**
 Call this method repeatedly to feed data into the decrypt/encrypt process. @p resultHandler will be called with output data, possibly multiple times per call to this method.
 
 Final invocation needs to pass @p YES to @p isFinal. An empty @p NSData instance can be given then.
 
   **NOTE:** If the data provided is to used outside the scope of the callback the data needs to be copied. For performance the same output buffer is reused during processing and thus the contents of the data change.

   **NOTE:** Output data may have different length than input data. Due to padding used by encryption algorithm, when encrypting output can be longer than input, and when decrypting output can be shorter than input.

 @return Boolean indicating success or failure. If failure, the cryptor has failed and cannot continue.
 */
-(BOOL) processData:(nonnull NSData *)input
			isFinal:(BOOL)isFinal
	  resultHandler:(void (^ NS_NOESCAPE _Nonnull)(NSData * _Nonnull ephemeralData))resultHandler;

@end

Swift

protocol RichieCryptor : NSObjectProtocol

Undocumented

  • Call this method repeatedly to feed data into the decrypt/encrypt process. @p resultHandler will be called with output data, possibly multiple times per call to this method.

    Final invocation needs to pass @p YES to @p isFinal. An empty @p NSData instance can be given then.

    NOTE: If the data provided is to used outside the scope of the callback the data needs to be copied. For performance the same output buffer is reused during processing and thus the contents of the data change.

    NOTE: Output data may have different length than input data. Due to padding used by encryption algorithm, when encrypting output can be longer than input, and when decrypting output can be shorter than input.

    Declaration

    Objective-C

    - (BOOL)processData:(nonnull NSData *)input
                isFinal:(BOOL)isFinal
          resultHandler:(void (^_Nonnull)(NSData *_Nonnull))resultHandler;

    Swift

    func processData(_ input: Data, isFinal: Bool, resultHandler: (Data) -> Void) -> Bool

    Return Value

    Boolean indicating success or failure. If failure, the cryptor has failed and cannot continue.