Messages in this thread | | | Date | Sun, 15 Feb 2004 21:17:41 -0500 | From | Jeff Garzik <> | Subject | Re: dm-crypt using kthread |
| |
Andrew Morton wrote: >>+static void crypt_encode_key(char *hex, u8 *key, int size) >>+{ >>+ static char hex_digits[] = "0123456789abcdef"; >>+ int i; >>+ >>+ for(i = 0; i < size; i++) { >>+ *hex++ = hex_digits[*key >> 4]; >>+ *hex++ = hex_digits[*key & 0x0f]; >>+ key++; >>+ } >>+ >>+ *hex++ = '\0'; >>+} > > > sprintf("%02x")?
I was thinking that too. How often do we encode the key? If not often (and I would guess not), sprintf would be more than sufficient.
Jeff
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |