Embedded systems coursework 2.
Fork of Crypto_light by
hash/HMAC.h@10:bc9c23aa3870, 2013-09-24 (annotated)
- Committer:
- feb11
- Date:
- Tue Sep 24 07:19:04 2013 +0000
- Revision:
- 10:bc9c23aa3870
implemented HMAC
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
feb11 | 10:bc9c23aa3870 | 1 | #ifndef HMAC_H |
feb11 | 10:bc9c23aa3870 | 2 | #define HMAC_H |
feb11 | 10:bc9c23aa3870 | 3 | |
feb11 | 10:bc9c23aa3870 | 4 | #include "HashAlgorithm.h" |
feb11 | 10:bc9c23aa3870 | 5 | |
feb11 | 10:bc9c23aa3870 | 6 | class HMAC |
feb11 | 10:bc9c23aa3870 | 7 | { |
feb11 | 10:bc9c23aa3870 | 8 | public : |
feb11 | 10:bc9c23aa3870 | 9 | |
feb11 | 10:bc9c23aa3870 | 10 | HMAC(HashAlgorithm *hashAlgo, uint8_t *k, uint32_t kl); |
feb11 | 10:bc9c23aa3870 | 11 | virtual ~HMAC(); |
feb11 | 10:bc9c23aa3870 | 12 | |
feb11 | 10:bc9c23aa3870 | 13 | void update(uint8_t *data, uint32_t length); |
feb11 | 10:bc9c23aa3870 | 14 | void finalize(uint8_t *hash); |
feb11 | 10:bc9c23aa3870 | 15 | |
feb11 | 10:bc9c23aa3870 | 16 | private : |
feb11 | 10:bc9c23aa3870 | 17 | |
feb11 | 10:bc9c23aa3870 | 18 | HashAlgorithm *algo; |
feb11 | 10:bc9c23aa3870 | 19 | uint8_t key[64]; |
feb11 | 10:bc9c23aa3870 | 20 | uint32_t keyLength; |
feb11 | 10:bc9c23aa3870 | 21 | }; |
feb11 | 10:bc9c23aa3870 | 22 | |
feb11 | 10:bc9c23aa3870 | 23 | #endif |