Loading...
Searching...
No Matches
CAST5
libavutil » Crypto and Hashing

## Functions

struct AVCAST5 * | av_cast5_alloc (void)
| Allocate an AVCAST5 context To free the struct: av_free(ptr)
int | av_cast5_init (struct AVCAST5 *ctx, const uint8_t *key, int key_bits)
| Initialize an AVCAST5 context.
void | av_cast5_crypt (struct AVCAST5 *ctx, uint8_t *dst, const uint8_t *src, int count, int decrypt)
| Encrypt or decrypt a buffer using a previously initialized context, ECB mode only.
void | av_cast5_crypt2 (struct AVCAST5 *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt)
| Encrypt or decrypt a buffer using a previously initialized context.

## Variables

const int | av_cast5_size

## Detailed Description

## Function Documentation

## av_cast5_alloc()

struct AVCAST5 * av_cast5_alloc | ( | void |  | ) |

Allocate an AVCAST5 context To free the struct: av_free(ptr)

## av_cast5_init()

int av_cast5_init | ( | struct AVCAST5 * | ctx,
|  | const uint8_t * | key,
|  | int | key_bits
| ) |  |

Initialize an AVCAST5 context.

Parameters

  ctx | an AVCAST5 context
  key | a key of 5,6,...16 bytes used for encryption/decryption
  key_bits | number of keybits: possible are 40,48,...,128

Returns
  0 on success, less than 0 on failure

## av_cast5_crypt()

void av_cast5_crypt | ( | struct AVCAST5 * | ctx,
|  | uint8_t * | dst,
|  | const uint8_t * | src,
|  | int | count,
|  | int | decrypt
| ) |  |

Encrypt or decrypt a buffer using a previously initialized context, ECB mode only.

Parameters

  ctx | an AVCAST5 context
  dst | destination array, can be equal to src
  src | source array, can be equal to dst
  count | number of 8 byte blocks
  decrypt | 0 for encryption, 1 for decryption

## av_cast5_crypt2()

void av_cast5_crypt2 | ( | struct AVCAST5 * | ctx,
|  | uint8_t * | dst,
|  | const uint8_t * | src,
|  | int | count,
|  | uint8_t * | iv,
|  | int | decrypt
| ) |  |

Encrypt or decrypt a buffer using a previously initialized context.

Parameters

  ctx | an AVCAST5 context
  dst | destination array, can be equal to src
  src | source array, can be equal to dst
  count | number of 8 byte blocks
  iv | initialization vector for CBC mode, NULL for ECB mode
  decrypt | 0 for encryption, 1 for decryption

## Variable Documentation

## av_cast5_size

const int av_cast5_size

extern