crypto/weakcryptospi/inc/spi/cryptosymmetriccipherapi.h
changeset 33 cf642210ecb7
parent 8 35751d3474b7
equal deleted inserted replaced
29:ece3df019add 33:cf642210ecb7
    46 		virtual ~CSymmetricCipherBase();
    46 		virtual ~CSymmetricCipherBase();
    47 		
    47 		
    48 		/**
    48 		/**
    49 		Set the key of this cipher. Reset() is called to reinitialise the cipher.
    49 		Set the key of this cipher. Reset() is called to reinitialise the cipher.
    50 		@param aKey	The symmetric key.
    50 		@param aKey	The symmetric key.
       
    51 		@leave KErrArgument if aKey is not of the expected type.
       
    52 		@leave KErrNotSupported if the key is not of valid length.
       
    53 		@leave ...	Any of the crypto error codes defined in 
       
    54   					cryptospi_errs.h or any of the system-wide error codes.
    51 		*/
    55 		*/
    52 		IMPORT_C void SetKeyL(const CKey& aKey);
    56 		IMPORT_C void SetKeyL(const CKey& aKey);
    53 
    57 
    54 		/**
    58 		/**
    55 		Set the operation mode of this cipher. Reset() is called to reinitialise the cipher.
    59 		Set the operation mode of this cipher. Reset() is called to reinitialise the cipher.
    56 		@param aOperationMode	The operation mode e.g. CBC, ECB etc
    60 		@param aOperationMode	The operation mode e.g. CBC, ECB etc
       
    61 		@leave KErrNotSupported if the operation mode is not supported.
       
    62 		@leave ...	Any of the crypto error codes defined in 
       
    63   					cryptospi_errs.h or any of the system-wide error codes.
    57 		*/
    64 		*/
    58 		IMPORT_C void SetOperationModeL(TUid aOperationMode);
    65 		IMPORT_C void SetOperationModeL(TUid aOperationMode);
    59 
    66 
    60 		/**
    67 		/**
    61 		Set the crypto mode of this cipher. Reset() is called to reinitialise the cipher.
    68 		Set the crypto mode of this cipher. Reset() is called to reinitialise the cipher.
    62 		@param aCryptoMode	The crypto mode e.g encryption, decryption
    69 		@param aCryptoMode	The crypto mode e.g encryption, decryption
       
    70 		@leave KErrNotSupported if the crypto mode is not supported.
       
    71 		@leave ...	Any of the crypto error codes defined in 
       
    72   					cryptospi_errs.h or any of the system-wide error codes.
    63 		*/
    73 		*/
    64 		IMPORT_C void SetCryptoModeL(TUid aCryptoMode);
    74 		IMPORT_C void SetCryptoModeL(TUid aCryptoMode);
    65 
    75 
    66 		/**
    76 		/**
    67 		Set padding mode of this cipher. Reset() is called to reinitialise the cipher.
    77 		Set padding mode of this cipher. Reset() is called to reinitialise the cipher.
    68 		@param aPaddingMode	The padding mode e.g. SSLv3, PKCS7
    78 		@param aPaddingMode	The padding mode e.g. SSLv3, PKCS7
       
    79 		@leave KErrNotSupported if the padding mode is not supported.
       
    80 		@leave ...	Any of the crypto error codes defined in 
       
    81   					cryptospi_errs.h or any of the system-wide error codes.
    69 		*/
    82 		*/
    70 		IMPORT_C void SetPaddingModeL(TUid aPaddingMode);
    83 		IMPORT_C void SetPaddingModeL(TUid aPaddingMode);
    71 
    84 
    72 		/**
    85 		/**
    73 		Set the initialization vector of this cipher. Reset() is called to reinitialise the cipher.
    86 		Set the initialization vector of this cipher. Reset() is called to reinitialise the cipher.
    74 		@param aIV The initialization vector.
    87 		@param aIV The initialization vector.
       
    88 		@leave KErrNotSupported if the current mode of operation does not support this.
       
    89 		@leave KErrArgument If the length of the Iv is not equal to the block size.
       
    90 		@leave ...	Any of the crypto error codes defined in 
       
    91   					cryptospi_errs.h or any of the system-wide error codes.
    75 		*/
    92 		*/
    76 		IMPORT_C void SetIvL(const TDesC8& aIv);
    93 		IMPORT_C void SetIvL(const TDesC8& aIv);
    77 
    94 
    78 		/**
    95 		/**
    79 		Returns the maximum length that an output buffer would need to be in order to hold the result 
    96 		Returns the maximum length that an output buffer would need to be in order to hold the result 
   139 
   156 
   140 		/**
   157 		/**
   141 		Encrypts or decrypts aInput and appends the result to aOutput.
   158 		Encrypts or decrypts aInput and appends the result to aOutput.
   142 		@param aInput	The input data to be processed.
   159 		@param aInput	The input data to be processed.
   143 		@param aOutput	The resulting processed data appended to aOutput.		
   160 		@param aOutput	The resulting processed data appended to aOutput.		
       
   161 		@leave ...	Any of the crypto error codes defined in 
       
   162   					cryptospi_errs.h or any of the system-wide error codes.
   144 		*/
   163 		*/
   145 		IMPORT_C void ProcessL(const TDesC8& aInput, TDes8& aOutput);
   164 		IMPORT_C void ProcessL(const TDesC8& aInput, TDes8& aOutput);
   146 
   165 
   147 		/**
   166 		/**
   148 		Pads aInput to be block aligned using the underlying padding system, then
   167 		Pads aInput to be block aligned using the underlying padding system, then
   149 		encrypts or decrypts the input data, and appends the result to aOutput
   168 		encrypts or decrypts the input data, and appends the result to aOutput
   150 		@param aInput  The input buffer to be encrypted or decrypted.
   169 		@param aInput  The input buffer to be encrypted or decrypted.
   151 		@param aOutput The resulting, padded, processed data is appended to aOutput.
   170 		@param aOutput The resulting, padded, processed data is appended to aOutput.
       
   171 		@leave ...	Any of the crypto error codes defined in 
       
   172   					cryptospi_errs.h or any of the system-wide error codes.
   152 		*/
   173 		*/
   153 		IMPORT_C void ProcessFinalL(const TDesC8& aInput, TDes8& aOutput);
   174 		IMPORT_C void ProcessFinalL(const TDesC8& aInput, TDes8& aOutput);
   154 		
   175 		
   155 	private:
   176 	private:
   156 		/**
   177 		/**
   183 		/**
   204 		/**
   184 		Encrypts or decrypts aInput and appends the result to aOutput asynchronously
   205 		Encrypts or decrypts aInput and appends the result to aOutput asynchronously
   185 		@param aInput	The input data to be processed.
   206 		@param aInput	The input data to be processed.
   186 		@param aOutput	The resulting processed data appended to aOutput.		
   207 		@param aOutput	The resulting processed data appended to aOutput.		
   187 		@param aRequestStatus
   208 		@param aRequestStatus
       
   209 		@leave ...	Any of the crypto error codes defined in 
       
   210   					cryptospi_errs.h or any of the system-wide error codes.
   188 		*/
   211 		*/
   189 		IMPORT_C void ProcessL(const TDesC8& aInput, TDes8& aOutput, TRequestStatus& aRequestStatus);
   212 		IMPORT_C void ProcessL(const TDesC8& aInput, TDes8& aOutput, TRequestStatus& aRequestStatus);
   190 
   213 
   191 		/**
   214 		/**
   192 		Asynchronously pads aInput to be block aligned using the underlying padding system,
   215 		Asynchronously pads aInput to be block aligned using the underlying padding system,
   193 		encrypts or decrypts the input data, and appends the result to aOutput
   216 		encrypts or decrypts the input data, and appends the result to aOutput
   194 		@param aInput  The input buffer to be encrypted or decrypted.
   217 		@param aInput  The input buffer to be encrypted or decrypted.
   195 		@param aOutput The resulting, padded, processed data is appended to aOutput.
   218 		@param aOutput The resulting, padded, processed data is appended to aOutput.
   196 		@param aRequestStatus
   219 		@param aRequestStatus
       
   220 		@leave ...	Any of the crypto error codes defined in 
       
   221   					cryptospi_errs.h or any of the system-wide error codes.
   197 		*/
   222 		*/
   198 		IMPORT_C void ProcessFinalL(const TDesC8& aInput, TDes8& aOutput, TRequestStatus& aRequestStatus);
   223 		IMPORT_C void ProcessFinalL(const TDesC8& aInput, TDes8& aOutput, TRequestStatus& aRequestStatus);
   199 
   224 
   200 		/**
   225 		/**
   201 		Cancel the outstanding request
   226 		Cancel the outstanding request