Creates an DES key object from the given key value(s) that can later be used for encryption and/or decryption.
#include "hudes.h"
int hu_DESKeySet(sb_Params desParams, size_t key1Len, const unsigned char *key1, size_t key2Len, const unsigned char *key2, size_t key3Len, const unsigned char *key3, sb_Key *desKey, sb_GlobalCtx sbCtx)
BlackBerry 10.0.0
A DES parameters object.
The length (in bytes) of key1. The only acceptable value is SB_DES_KEY_SIZE.
Key 1 value.
The length (in bytes) of key1. The only acceptable value is SB_DES_KEY_SIZE. Ignored if the mode is SB_DES_DES.
Key 2 value. Ignored if the mode is SB_DES_DES.
The length (in bytes) of key1. The only acceptable value is SB_DES_KEY_SIZE. Ignored if the mode is SB_DES_DES.
Key 3 value. Ignored if the mode is SB_DES_DES.
The DES key object pointer.
The global context.
If the algorithm is SB_DES_DES, a key value must be given in key1. The key2 and key3 arguments will be ignored.
If the algorithm is SB_DES_TDES or SB_DES_DESX, all three key buffers must be given.
For SB_DES_DESX, key 1 is the encryption key, key 2 is the prewhitening key and key 3 is the postwhitening key.
If the parity mode is SB_DES_PARITY_ON, an error will be returned if any of the encryption keys have incorrect parity.
If the weak key mode is SB_DES_WEAK_KEY_ON, an error will be returned if any of the encryption keys match a known weak key.
The desParams parameters object is NULL.
The tag for the params object is not of the expected type.
Key length is invalid.
Key value has incorrect parity.
Key value is known to be weak.
Key object pointer is NULL.
Memory allocation failure.
Success.