#ifndef _IDEA_H_2a050870_ #define _IDEA_H_2a050870_ /* porting defines: IDEA__U16 should be unsigned integer type with at least 16 bits; IDEA__U32, ditto with 32 bits. They can be wider, but the extra space will be wasted. The code assumes 8-bit chars; if chars are wider, only the low 8 bits of each will be used. */ typedef unsigned short int IDEA__U16; typedef unsigned long int IDEA__U32; /* Opaque structures */ /* IDEA_KEY is a key schedule, filled in by idea_setkey_* or idea_keycvt_*. */ typedef struct { IDEA__U16 Z[52]; } IDEA_KEY; /* Routine interfaces */ /* idea_setkey_e fills in a key schedule for encryption, given a pointer to 16 bytes (128 bits) of IDEA key. */ extern void idea_setkey_e(const void *, IDEA_KEY *); /* idea_setkey_d fills in a key schedule for decryption, given a pointer to 16 bytes (128 bits) of IDEA key. */ extern void idea_setkey_d(const void *, IDEA_KEY *); /* idea_keycvt_e_to_d converts an IDEA_KEY set up for encryption to another set up for decryption. The arguments may be the same. */ extern void idea_keycvt_e_to_d(const IDEA_KEY *, IDEA_KEY *); /* idea_keycvt_d_to_e converts an IDEA_KEY set up for decryption to another set up for encryption. The arguments may be the same. */ extern void idea_keycvt_d_to_e(const IDEA_KEY *, IDEA_KEY *); /* idea_crypt does encryption or decryption, depending on whether the key schedule argument is set up for encryption or decryption. The 8-byte (64-bit) input and output data buffers may be the same. */ extern void idea_crypt(const void *, const IDEA_KEY *, void *); #endif