mirror of https://github.com/ipxe/ipxe.git
Added setiv method
parent
c1aa1d0764
commit
0d07657296
|
@ -34,6 +34,12 @@ struct crypto_algorithm {
|
||||||
* @ret rc Return status code
|
* @ret rc Return status code
|
||||||
*/
|
*/
|
||||||
int ( * setkey ) ( void *ctx, void *key, size_t keylen );
|
int ( * setkey ) ( void *ctx, void *key, size_t keylen );
|
||||||
|
/** Set initialisation vector
|
||||||
|
*
|
||||||
|
* @v ctx Context
|
||||||
|
* @v iv Initialisation vector
|
||||||
|
*/
|
||||||
|
void ( *setiv ) ( void *ctx, void *iv );
|
||||||
/** Encode data
|
/** Encode data
|
||||||
*
|
*
|
||||||
* @v ctx Context
|
* @v ctx Context
|
||||||
|
@ -85,6 +91,16 @@ static inline void digest_final ( struct crypto_algorithm *crypto,
|
||||||
crypto->final ( ctx, out );
|
crypto->final ( ctx, out );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void cipher_setiv ( struct crypto_algorithm *crypto,
|
||||||
|
void *ctx, void *iv ) {
|
||||||
|
crypto->setiv ( ctx, iv );
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline int cipher_setkey ( struct crypto_algorithm *crypto,
|
||||||
|
void *ctx, void *key, size_t keylen ) {
|
||||||
|
return crypto->setkey ( ctx, key, keylen );
|
||||||
|
}
|
||||||
|
|
||||||
static inline int cipher_encrypt ( struct crypto_algorithm *crypto,
|
static inline int cipher_encrypt ( struct crypto_algorithm *crypto,
|
||||||
void *ctx, const void *src, void *dst,
|
void *ctx, const void *src, void *dst,
|
||||||
size_t len ) {
|
size_t len ) {
|
||||||
|
|
Loading…
Reference in New Issue