49 #ifdef SNMP_PP_NAMESPACE
55 typedef unsigned short word16;
56 typedef unsigned int word32;
60 word16 key_schedule[52];
64 void idea_set_key(IDEAContext *c,
const unsigned char key[16]);
67 void idea_destroy_context(IDEAContext *c);
70 void idea_transform(IDEAContext *c, word32 l, word32 r, word32 *output);
76 void idea_cfb_encrypt(IDEAContext *c,
unsigned char *iv,
unsigned char *dest,
77 const unsigned char *src,
unsigned int len);
84 void idea_cfb_decrypt(IDEAContext *c,
unsigned char *iv,
unsigned char *dest,
85 const unsigned char *src,
unsigned int len);
90 #ifdef SNMP_PP_NAMESPACE
109 #ifdef SNMP_PP_NAMESPACE
120 #define GET_32BIT(cp) (((unsigned long)(unsigned char)(cp)[0] << 24) | \
121 ((unsigned long)(unsigned char)(cp)[1] << 16) | \
122 ((unsigned long)(unsigned char)(cp)[2] << 8) | \
123 ((unsigned long)(unsigned char)(cp)[3]))
125 #define GET_16BIT(cp) (((unsigned long)(unsigned char)(cp)[0] << 8) | \
126 ((unsigned long)(unsigned char)(cp)[1]))
128 #define PUT_32BIT(cp, value) do { \
129 (cp)[0] = (value) >> 24; \
130 (cp)[1] = (value) >> 16; \
131 (cp)[2] = (value) >> 8; \
132 (cp)[3] = (value); } while (0)
134 #define PUT_16BIT(cp, value) do { \
135 (cp)[0] = (value) >> 8; \
136 (cp)[1] = (value); } while (0)
140 #define GET_32BIT_LSB_FIRST(cp) \
141 (((unsigned long)(unsigned char)(cp)[0]) | \
142 ((unsigned long)(unsigned char)(cp)[1] << 8) | \
143 ((unsigned long)(unsigned char)(cp)[2] << 16) | \
144 ((unsigned long)(unsigned char)(cp)[3] << 24))
146 #define GET_16BIT_LSB_FIRST(cp) \
147 (((unsigned long)(unsigned char)(cp)[0]) | \
148 ((unsigned long)(unsigned char)(cp)[1] << 8))
150 #define PUT_32BIT_LSB_FIRST(cp, value) do { \
152 (cp)[1] = (value) >> 8; \
153 (cp)[2] = (value) >> 16; \
154 (cp)[3] = (value) >> 24; } while (0)
156 #define PUT_16BIT_LSB_FIRST(cp, value) do { \
158 (cp)[1] = (value) >> 8; } while (0)
162 #ifdef SNMP_PP_NAMESPACE