diff options
| author | Michael Brown | 2007-01-31 18:58:36 +0100 |
|---|---|---|
| committer | Michael Brown | 2007-01-31 18:58:36 +0100 |
| commit | 0d07657296ca9a5dc323d4fc3b2856dd9fdd9e4e (patch) | |
| tree | 7b5990bdfd027d452774815df7ac2ffc5897b1d0 /src/include/gpxe/crypto.h | |
| parent | Add wrapper around axtls' sha1 code (diff) | |
| download | ipxe-0d07657296ca9a5dc323d4fc3b2856dd9fdd9e4e.tar.gz ipxe-0d07657296ca9a5dc323d4fc3b2856dd9fdd9e4e.tar.xz ipxe-0d07657296ca9a5dc323d4fc3b2856dd9fdd9e4e.zip | |
Added setiv method
Diffstat (limited to 'src/include/gpxe/crypto.h')
| -rw-r--r-- | src/include/gpxe/crypto.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/include/gpxe/crypto.h b/src/include/gpxe/crypto.h index d285f65a6..831c0363d 100644 --- a/src/include/gpxe/crypto.h +++ b/src/include/gpxe/crypto.h @@ -34,6 +34,12 @@ struct crypto_algorithm { * @ret rc Return status code */ 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 * * @v ctx Context @@ -85,6 +91,16 @@ static inline void digest_final ( struct crypto_algorithm *crypto, 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, void *ctx, const void *src, void *dst, size_t len ) { |
