|
|
Register a block cipher with the library.
Applications must register the block cipher implementation with this function. For security reasons, once a block cipher is registered, it cannot be replaced.
- Note
- Only certain DOFCipherStrengths are supported for each DOFCipherAlgorithm: DOFCIPHERALGORITHM_AES - DOFCIPHERSTRENGTH_256, DOFCIPHERALGORITHM_TWOFISH - DOFCIPHERSTRENGTH_256, DOFCIPHERALGORITHM_SMS4 - DOFCIPHERSTRENGTH_128.
- Parameters
-
| algorithm | The recognized algorithm to be registered; refer to DOFCipherAlgorithm. |
| strength | The security strength as defined by the OpenDof Project; refer to DOFCipherStrength. |
| cipher | The block cipher implementation; refer to DOFCipher. |
- Return values
-
| Non-zero | (TRUE) if the cipher was successfully added to the registry. |
- Exceptions
-
| Zero | (FALSE) if the cipher could not be added. This may occur for a number of reasons, including:
- the algorithm is not recognized by the library; or
- the strength is not recognized by the library; or
- a cipher was already added for the given algorithm and strength; or
- the cipher implementation fails to meet the library's requirements for the given algorithm and strength (e.g., incorrect block size, excessive key state size, or missing required functionality).
|
|