1 #ifndef _GPXE_HMAC_H
2 #define _GPXE_HMAC_H
3
4 /** @file
5 *
6 * Keyed-Hashing for Message Authentication
7 */
8
9 FILE_LICENCE ( GPL2_OR_LATER );
10
11 #include <gpxe/crypto.h>
12
13 /**
14 * Update HMAC
15 *
16 * @v digest Digest algorithm to use
17 * @v digest_ctx Digest context
18 * @v data Data
19 * @v len Length of data
20 */
hmac_update(struct digest_algorithm * digest,void * digest_ctx,const void * data,size_t len)21 static inline void hmac_update ( struct digest_algorithm *digest,
22 void *digest_ctx, const void *data,
23 size_t len ) {
24 digest_update ( digest, digest_ctx, data, len );
25 }
26
27 extern void hmac_init ( struct digest_algorithm *digest, void *digest_ctx,
28 void *key, size_t *key_len );
29 extern void hmac_final ( struct digest_algorithm *digest, void *digest_ctx,
30 void *key, size_t *key_len, void *hmac );
31
32 #endif /* _GPXE_HMAC_H */
33