Re: dm-crypt using kthread

From: Jeff Garzik
Date: Sun Feb 15 2004 - 21:19:44 EST


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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/