diff options
| author | Michael Brown | 2007-07-29 04:09:00 +0200 |
|---|---|---|
| committer | Michael Brown | 2007-07-29 04:09:00 +0200 |
| commit | 218314e712fdb44683fcb9f974b6cd071dcc4a32 (patch) | |
| tree | 0cd9eb795d3709401dd7ee7f0d9613d9cacf2809 /src/include | |
| parent | Quick hack to get AoE back in to the tree, on a par with the current (diff) | |
| download | ipxe-218314e712fdb44683fcb9f974b6cd071dcc4a32.tar.gz ipxe-218314e712fdb44683fcb9f974b6cd071dcc4a32.tar.xz ipxe-218314e712fdb44683fcb9f974b6cd071dcc4a32.zip | |
Added HMAC code from TLS project
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/gpxe/hmac.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/include/gpxe/hmac.h b/src/include/gpxe/hmac.h new file mode 100644 index 000000000..fd34db04a --- /dev/null +++ b/src/include/gpxe/hmac.h @@ -0,0 +1,30 @@ +#ifndef _GPXE_HMAC_H +#define _GPXE_HMAC_H + +/** @file + * + * Keyed-Hashing for Message Authentication + */ + +#include <gpxe/crypto.h> + +/** + * Update HMAC + * + * @v digest Digest algorithm to use + * @v digest_ctx Digest context + * @v data Data + * @v len Length of data + */ +static inline void hmac_update ( struct crypto_algorithm *digest, + void *digest_ctx, const void *data, + size_t len ) { + digest_update ( digest, digest_ctx, data, len ); +} + +extern void hmac_init ( struct crypto_algorithm *digest, void *digest_ctx, + void *key, size_t *key_len ); +extern void hmac_final ( struct crypto_algorithm *digest, void *digest_ctx, + void *key, size_t *key_len, void *hmac ); + +#endif /* _GPXE_HMAC_H */ |
