.Dd August 11, 1996 .Dt LIBIDEA 3 .Os NetBSD 1.2BETA .Sh NAME .Nm idea_setkey_e , .Nm idea_setkey_d , .Nm idea_keycvt_e_to_d , .Nm idea_keycvt_d_to_e , .Nm idea_crypt .Nd IDEA encryption/decryption routines .Sh SYNOPSIS .Fd #include .br .Nm cc .Op Ar arguments .Fl lidea .br .Ft void .Fn idea_setkey_e "const void *key" "IDEA_KEY *ks" .Ft void .Fn idea_setkey_d "const void *key" "IDEA_KEY *ks" .Ft void .Fn idea_keycvt_e_to_d "const IDEA_KEY *kin" "IDEA_KEY *kout" .Ft void .Fn idea_keycvt_d_to_e "const IDEA_KEY *kin" "IDEA_KEY *kout" .Ft void .Fn idea_crypt "const void *bufin" "IDEA_KEY *key" "void *bufout" .Sh DESCRIPTION These functions perform IDEA encryption and decryption. .Pp .Fn idea_setkey_e and .Fn idea_setkey_d take a buffer containing a key, which for IDEA is 128 arbitrary bits (stored as 16 bytes), and converts it to an .Dv IDEA_KEY , which is an opaque structure used to hold a key in the pre-massaged form used by .Fn idea_crypt . .Pp .Fn idea_setkey_d_to_e and .Fn idea_setkey_e_to_d take an .Dv IDEA_KEY set up for decryption and convert it to one set up for encryption with the same key, or the other way around, as indicated by their names. It is permissible for the two arguments to point to the same .Dv IDEA_KEY . .Pp .Fn idea_crypt performs the actual encryption or decryption operation, according as whether the .Dv IDEA_KEY passed in is set up for encryption or decryption. .Fa bufin is the 64-bit input block, stored as 8 bytes, .Fa key is of course the .Dv IDEA_KEY , and .Fa bufout is an 8-byte buffer to hold the output block. It is permissible for .Fa bufin and .Fa bufout to point to the same buffer. .Sh ERRORS These routines .Dq cannot fail ; the only failure modes possible for them are due to passing invalid pointers as arguments. Such incorrect calls will not be detected by the library; their effects can range from silent corruption of memory to core dumps. .Sh BUGS Code blindly assumes 8-bit .Do char .Dc Ns s. .Sh AUTHOR der Mouse, .Aq mouse@rodents.montreal.qc.ca .