diff options
author | Michael Brown <mcb30@ipxe.org> | 2022-10-25 12:59:06 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2022-10-25 13:20:22 +0100 |
commit | 52f72d298abd81a6102ddddf2fff4918e4b077ce (patch) | |
tree | ccae06dfd5d708991031730871188ee37a138c62 /src/include/ipxe | |
parent | 2c78242732765be200f81a84cc95037ba2924e42 (diff) | |
download | ipxe-52f72d298abd81a6102ddddf2fff4918e4b077ce.tar.gz |
[crypto] Expose null crypto algorithm methods for reuse
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe')
-rw-r--r-- | src/include/ipxe/crypto.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/include/ipxe/crypto.h b/src/include/ipxe/crypto.h index fc0d8b22b..34ab38930 100644 --- a/src/include/ipxe/crypto.h +++ b/src/include/ipxe/crypto.h @@ -263,6 +263,29 @@ static inline int pubkey_match ( struct pubkey_algorithm *pubkey, public_key_len ); } +extern void digest_null_init ( void *ctx ); +extern void digest_null_update ( void *ctx, const void *src, size_t len ); +extern void digest_null_final ( void *ctx, void *out ); + +extern int cipher_null_setkey ( void *ctx, const void *key, size_t keylen ); +extern void cipher_null_setiv ( void *ctx, const void *iv ); +extern void cipher_null_encrypt ( void *ctx, const void *src, void *dst, + size_t len ); +extern void cipher_null_decrypt ( void *ctx, const void *src, void *dst, + size_t len ); + +extern int pubkey_null_init ( void *ctx, const void *key, size_t key_len ); +extern size_t pubkey_null_max_len ( void *ctx ); +extern int pubkey_null_encrypt ( void *ctx, const void *plaintext, + size_t plaintext_len, void *ciphertext ); +extern int pubkey_null_decrypt ( void *ctx, const void *ciphertext, + size_t ciphertext_len, void *plaintext ); +extern int pubkey_null_sign ( void *ctx, struct digest_algorithm *digest, + const void *value, void *signature ); +extern int pubkey_null_verify ( void *ctx, struct digest_algorithm *digest, + const void *value, const void *signature , + size_t signature_len ); + extern struct digest_algorithm digest_null; extern struct cipher_algorithm cipher_null; extern struct pubkey_algorithm pubkey_null; |