Changeset View
Changeset View
Standalone View
Standalone View
sys/opencrypto/xform_enc.h
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | struct enc_xform { | ||||
const char *name; | const char *name; | ||||
size_t ctxsize; | size_t ctxsize; | ||||
uint16_t blocksize; /* Required input block size -- 1 for stream ciphers. */ | uint16_t blocksize; /* Required input block size -- 1 for stream ciphers. */ | ||||
uint16_t native_blocksize; /* Used for stream ciphers. */ | uint16_t native_blocksize; /* Used for stream ciphers. */ | ||||
uint16_t ivsize; | uint16_t ivsize; | ||||
uint16_t minkey, maxkey; | uint16_t minkey, maxkey; | ||||
uint16_t macsize; /* For AEAD ciphers. */ | uint16_t macsize; /* For AEAD ciphers. */ | ||||
/* Initialize context and set key. */ | |||||
int (*setkey) (void *, const uint8_t *, int len); | |||||
/* Supply context with nonce/IV. */ | |||||
void (*reinit) (void *, const uint8_t *, size_t); | |||||
/* | /* | ||||
* Encrypt/decrypt a single block. For stream ciphers this | * Encrypt/decrypt a single block. For stream ciphers this | ||||
* encrypts/decrypts a single "native" block. | * encrypts/decrypts a single "native" block. | ||||
*/ | */ | ||||
void (*encrypt) (void *, const uint8_t *, uint8_t *); | void (*encrypt) (void *, const uint8_t *, uint8_t *); | ||||
void (*decrypt) (void *, const uint8_t *, uint8_t *); | void (*decrypt) (void *, const uint8_t *, uint8_t *); | ||||
int (*setkey) (void *, const uint8_t *, int len); | |||||
void (*reinit) (void *, const uint8_t *, size_t); | /* | ||||
* Encrypt/decrypt multiple blocks. For stream ciphers this | |||||
* encrypts/decrypts multiple "native" blocks. The fourth | |||||
* argument is a count of bytes. | |||||
*/ | |||||
void (*encrypt_multi) (void *, const uint8_t *, uint8_t *, size_t); | |||||
void (*decrypt_multi) (void *, const uint8_t *, uint8_t *, size_t); | |||||
/* | /* | ||||
* For stream ciphers, encrypt/decrypt the final partial block | * For stream ciphers, encrypt/decrypt the final partial block | ||||
* of 'len' bytes. | * of 'len' bytes. | ||||
*/ | */ | ||||
void (*encrypt_last) (void *, const uint8_t *, uint8_t *, size_t len); | void (*encrypt_last) (void *, const uint8_t *, uint8_t *, size_t len); | ||||
void (*decrypt_last) (void *, const uint8_t *, uint8_t *, size_t len); | void (*decrypt_last) (void *, const uint8_t *, uint8_t *, size_t len); | ||||
Show All 34 Lines |