A simple CyaSSL-based HMAC-MD5 implementation. Licensed under GPL v2.
Dependents: RFrec_full RFtrans_full
The output will be base64-encoded, with trailing "==", like this:
j62o/jZsAZD9i9m+32lIuQ==
Example
#include "mbed.h" #include "hmac_md5.h" Serial pc(USBTX, USBRX); // tx, rx void main(void) { const char * key = "MySecretKey"; const char * text = "message to be signed"; char output[26]; HMAC_MD5(key, text, output); printf("result = %s\n", output); while(true){} }
hmac_md5.h@0:83f3dcfa5c8f, 2013-02-06 (annotated)
- Committer:
- igrokhotkov
- Date:
- Wed Feb 06 20:35:03 2013 +0000
- Revision:
- 0:83f3dcfa5c8f
initial revision
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
igrokhotkov | 0:83f3dcfa5c8f | 1 | #ifndef HMAC_MD5_H |
igrokhotkov | 0:83f3dcfa5c8f | 2 | #define HMAC_MD5_H |
igrokhotkov | 0:83f3dcfa5c8f | 3 | // wrapper for HMAC-MD5 from CyaSSL library |
igrokhotkov | 0:83f3dcfa5c8f | 4 | |
igrokhotkov | 0:83f3dcfa5c8f | 5 | // szOutput must hold at least 26 bytes |
igrokhotkov | 0:83f3dcfa5c8f | 6 | void HMAC_MD5(const char * szKey, const char * szText, char * szOutput); |
igrokhotkov | 0:83f3dcfa5c8f | 7 | |
igrokhotkov | 0:83f3dcfa5c8f | 8 | |
igrokhotkov | 0:83f3dcfa5c8f | 9 | #endif//HMAC_MD5_H |