X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Falgo%2Fmd2.c;h=589d98993402875d4fe824bf157127dd0962f281;hb=15810459b8f5fb09b12cef6f8e4d4e64d167087b;hp=f24fcd1f7d80633fdffbc7e9b0c5a3b124168150;hpb=590822ee40d8f2554f739c5c34ed8ba0cbb2ef76;p=bertos.git diff --git a/bertos/algo/md2.c b/bertos/algo/md2.c index f24fcd1f..589d9899 100644 --- a/bertos/algo/md2.c +++ b/bertos/algo/md2.c @@ -39,60 +39,19 @@ * to md2_perm function you must chanche CONFIG_MD2_STD_PERM defined in * appconfig.h. * If you need to store array in program memory you must define - * a macro _PROGMEM (for more info see mware/pgm.h). + * a macro _PROGMEM (for more info see cpu/pgm.h). * * - * \version $Id$ * \author Daniele Basile */ -/*#* - *#* $Log$ - *#* Revision 1.17 2007/06/07 16:06:39 batt - *#* Fix some doxygen errors. - *#* - *#* Revision 1.16 2007/02/15 13:29:49 asterix - *#* Add MD2_DIGEST_LEN macro. - *#* - *#* Revision 1.15 2007/02/06 15:53:34 asterix - *#* Add ROTR macro in m2d_perm, add comments, typos. - *#* - *#* Revision 1.13 2007/02/05 18:44:42 asterix - *#* Add md2_perm function. - *#* - *#* Revision 1.12 2007/02/05 16:52:44 asterix - *#* Add define for harvard architecture. - *#* - *#* Revision 1.11 2007/02/02 18:15:31 asterix - *#* Add function MD2_test. Fix bug in md2_update function. - *#* - *#* Revision 1.9 2007/02/02 13:10:01 asterix - *#* Fix some bugs in md2_pad and md2_update fuction. - *#* - *#* Revision 1.8 2007/02/01 14:45:56 asterix - *#* Rewrite md2_update function and fix some bug. - *#* - *#* Revision 1.7 2007/01/31 18:04:15 asterix - *#* Write md2_end function - *#* - *#* Revision 1.4 2007/01/31 13:51:57 asterix - *#* Write md2_compute function. - *#* - *#* Revision 1.2 2007/01/30 17:31:44 asterix - *#* Add function prototypes. - *#* - *#* Revision 1.1 2007/01/30 15:53:26 batt - *#* Add first md2 skel. - *#* - *#*/ - #include "md2.h" #include //memset(), memcpy(); #include #include //ASSERT() #include //MIN(), countof(), ROTR(); -#include +#include #if CONFIG_MD2_STD_PERM @@ -100,7 +59,7 @@ * Official array of 256 byte pemutation contructed from digits of pi, defined * in the RFC 1319. */ - static const uint8_t PGM_ATTR md2_perm[256] = + static const uint8_t PROGMEM md2_perm[256] = { 41, 46, 67, 201, 162, 216, 124, 1, 61, 54, 84, 161, 236, 240, 6, 19, 98, 167, 5, 243, 192, 199, 115, 140, 152, 147, 43, 217, 188, @@ -122,7 +81,7 @@ 31, 26, 219, 153, 141, 51, 159, 17, 131, 20 }; - #define MD2_PERM(x) PGM_READ_CHAR(&md2_perm[x]) + #define MD2_PERM(x) pgm_read8(&md2_perm[x]) #else /** * Md2_perm() function generate an array of 256 "casual" permutation.