33
* \brief Initializes an AVDES context.
33
* @brief Initializes an AVDES context.
35
* \param key_bits must be 64 or 192
36
* \param decrypt 0 for encryption, 1 for decryption
35
* @param key_bits must be 64 or 192
36
* @param decrypt 0 for encryption/CBC-MAC, 1 for decryption
38
38
int av_des_init(struct AVDES *d, const uint8_t *key, int key_bits, int decrypt);
41
* \brief Encrypts / decrypts using the DES algorithm.
41
* @brief Encrypts / decrypts using the DES algorithm.
43
* \param count number of 8 byte blocks
44
* \param dst destination array, can be equal to src, must be 8-byte aligned
45
* \param src source array, can be equal to dst, must be 8-byte aligned, may be NULL
46
* \param iv initialization vector for CBC mode, if NULL then ECB will be used,
43
* @param count number of 8 byte blocks
44
* @param dst destination array, can be equal to src, must be 8-byte aligned
45
* @param src source array, can be equal to dst, must be 8-byte aligned, may be NULL
46
* @param iv initialization vector for CBC mode, if NULL then ECB will be used,
47
47
* must be 8-byte aligned
48
* \param decrypt 0 for encryption, 1 for decryption
48
* @param decrypt 0 for encryption, 1 for decryption
50
50
void av_des_crypt(struct AVDES *d, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt);
53
* @brief Calculates CBC-MAC using the DES algorithm.
55
* @param count number of 8 byte blocks
56
* @param dst destination array, can be equal to src, must be 8-byte aligned
57
* @param src source array, can be equal to dst, must be 8-byte aligned, may be NULL
59
void av_des_mac(struct AVDES *d, uint8_t *dst, const uint8_t *src, int count);
52
61
#endif /* AVUTIL_DES_H */