Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
cmac.h
00001 /************************************************************************** 00002 Copyright (C) 2009 Lander Casado, Philippas Tsigas 00003 All rights reserved. 00004 Permission is hereby granted, free of charge, to any person obtaining 00005 a copy of this software and associated documentation files 00006 (the "Software"), to deal with the Software without restriction, including 00007 without limitation the rights to use, copy, modify, merge, publish, 00008 distribute, sublicense, and/or sell copies of the Software, and to 00009 permit persons to whom the Software is furnished to do so, subject to 00010 the following conditions: 00011 Redistributions of source code must retain the above copyright notice, 00012 this list of conditions and the following disclaimers. Redistributions in 00013 binary form must reproduce the above copyright notice, this list of 00014 conditions and the following disclaimers in the documentation and/or 00015 other materials provided with the distribution. 00016 In no event shall the authors or copyright holders be liable for any special, 00017 incidental, indirect or consequential damages of any kind, or any damages 00018 whatsoever resulting from loss of use, data or profits, whether or not 00019 advised of the possibility of damage, and on any theory of liability, 00020 arising out of or in connection with the use or performance of this software. 00021 00022 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00023 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00024 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 00025 CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 00026 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 00027 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 00028 DEALINGS WITH THE SOFTWARE 00029 *****************************************************************************/ 00030 00031 #ifndef _CMAC_H_ 00032 #define _CMAC_H_ 00033 00034 #include "aes.h" 00035 00036 #define AES_CMAC_KEY_LENGTH 16 00037 #define AES_CMAC_DIGEST_LENGTH 16 00038 00039 typedef struct _AES_CMAC_CTX { 00040 aes_context rijndael; 00041 uint8_t X[16]; 00042 uint8_t M_last[16]; 00043 uint32_t M_n; 00044 } AES_CMAC_CTX; 00045 00046 //#include <sys/cdefs.h> 00047 00048 //__BEGIN_DECLS 00049 void AES_CMAC_Init(AES_CMAC_CTX * ctx); 00050 void AES_CMAC_SetKey(AES_CMAC_CTX * ctx, const uint8_t key[AES_CMAC_KEY_LENGTH]); 00051 void AES_CMAC_Update(AES_CMAC_CTX * ctx, const uint8_t * data, uint32_t len); 00052 // __attribute__((__bounded__(__string__,2,3))); 00053 void AES_CMAC_Final(uint8_t digest[AES_CMAC_DIGEST_LENGTH], AES_CMAC_CTX * ctx); 00054 // __attribute__((__bounded__(__minbytes__,1,AES_CMAC_DIGEST_LENGTH))); 00055 //__END_DECLS 00056 00057 #endif /* _CMAC_H_ */
Generated on Tue Jul 12 2022 15:51:16 by
1.7.2