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

## Functions

struct AVTWOFISH * | av_twofish_alloc (void)
| Allocate an AVTWOFISH context To free the struct: av_free(ptr)
int | av_twofish_init (struct AVTWOFISH *ctx, const uint8_t *key, int key_bits)
| Initialize an AVTWOFISH context.
void | av_twofish_crypt (struct AVTWOFISH *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_twofish_size

## Detailed Description

## Function Documentation

## av_twofish_alloc()

struct AVTWOFISH * av_twofish_alloc | ( | void |  | ) |

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

## av_twofish_init()

int av_twofish_init | ( | struct AVTWOFISH * | ctx,
|  | const uint8_t * | key,
|  | int | key_bits
| ) |  |

Initialize an AVTWOFISH context.

Parameters

  ctx | an AVTWOFISH context
  key | a key of size ranging from 1 to 32 bytes used for encryption/decryption
  key_bits | number of keybits: 128, 192, 256 If less than the required, padded with zeroes to nearest valid value; return value is 0 if key_bits is 128/192/256, -1 if less than 0, 1 otherwise

## av_twofish_crypt()

void av_twofish_crypt | ( | struct AVTWOFISH * | 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 AVTWOFISH context
  dst | destination array, can be equal to src
  src | source array, can be equal to dst
  count | number of 16 byte blocks
  iv | initialization vector for CBC mode, NULL for ECB mode
  decrypt | 0 for encryption, 1 for decryption

## Variable Documentation

## av_twofish_size

const int av_twofish_size

extern