Fork of François Berder Crypto, fixed AES CBC and small rework
Dependents: AES_example shaun_larada Smartage
Fork of Crypto by
hash/HMAC.h@16:4399e2e6260b, 2015-01-28 (annotated)
- Committer:
- Geremia
- Date:
- Wed Jan 28 17:55:13 2015 +0000
- Revision:
- 16:4399e2e6260b
- Parent:
- 10:bc9c23aa3870
AES: bugfixed CBC, added PCBC (i could add CFB and OFB if needed), added public setIV(), moved keyExpansion() to public, in and out buffers can be the same
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 |