aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/wusbcore/crypto.c
diff options
context:
space:
mode:
authorDavid Vrabel <david.vrabel@csr.com>2008-12-22 13:22:50 -0500
committerDavid Vrabel <david.vrabel@csr.com>2008-12-22 13:22:50 -0500
commitbce83697c5fe84a7a5d38c96fbbe43b4bc028c3e (patch)
treeb8e920af66f5b4de509e95a7295cedbe42878dd6 /drivers/usb/wusbcore/crypto.c
parent02f11ee181baa562df23e105ba930902f0d0b1bf (diff)
uwb: use dev_dbg() for debug messages
Instead of the home-grown d_fnstart(), d_fnend() and d_printf() macros, use dev_dbg() or remove the message entirely. Signed-off-by: David Vrabel <david.vrabel@csr.com>
Diffstat (limited to 'drivers/usb/wusbcore/crypto.c')
-rw-r--r--drivers/usb/wusbcore/crypto.c30
1 files changed, 0 insertions, 30 deletions
diff --git a/drivers/usb/wusbcore/crypto.c b/drivers/usb/wusbcore/crypto.c
index 0ca860305feb..9d9128ac8c8e 100644
--- a/drivers/usb/wusbcore/crypto.c
+++ b/drivers/usb/wusbcore/crypto.c
@@ -51,7 +51,6 @@
51#include <linux/uwb.h> 51#include <linux/uwb.h>
52#include <linux/usb/wusb.h> 52#include <linux/usb/wusb.h>
53#include <linux/scatterlist.h> 53#include <linux/scatterlist.h>
54#define D_LOCAL 0
55#include <linux/uwb/debug.h> 54#include <linux/uwb/debug.h>
56 55
57static int debug_crypto_verify = 0; 56static int debug_crypto_verify = 0;
@@ -207,9 +206,6 @@ static int wusb_ccm_mac(struct crypto_blkcipher *tfm_cbc,
207 const u8 bzero[16] = { 0 }; 206 const u8 bzero[16] = { 0 };
208 size_t zero_padding; 207 size_t zero_padding;
209 208
210 d_fnstart(3, NULL, "(tfm_cbc %p, tfm_aes %p, mic %p, "
211 "n %p, a %p, b %p, blen %zu)\n",
212 tfm_cbc, tfm_aes, mic, n, a, b, blen);
213 /* 209 /*
214 * These checks should be compile time optimized out 210 * These checks should be compile time optimized out
215 * ensure @a fills b1's mac_header and following fields 211 * ensure @a fills b1's mac_header and following fields
@@ -251,16 +247,6 @@ static int wusb_ccm_mac(struct crypto_blkcipher *tfm_cbc,
251 b1.la = cpu_to_be16(blen + 14); 247 b1.la = cpu_to_be16(blen + 14);
252 memcpy(&b1.mac_header, a, sizeof(*a)); 248 memcpy(&b1.mac_header, a, sizeof(*a));
253 249
254 d_printf(4, NULL, "I: B0 (%zu bytes)\n", sizeof(b0));
255 d_dump(4, NULL, &b0, sizeof(b0));
256 d_printf(4, NULL, "I: B1 (%zu bytes)\n", sizeof(b1));
257 d_dump(4, NULL, &b1, sizeof(b1));
258 d_printf(4, NULL, "I: B (%zu bytes)\n", blen);
259 d_dump(4, NULL, b, blen);
260 d_printf(4, NULL, "I: B 0-padding (%zu bytes)\n", zero_padding);
261 d_printf(4, NULL, "D: IV before crypto (%zu)\n", ivsize);
262 d_dump(4, NULL, iv, ivsize);
263
264 sg_init_table(sg, ARRAY_SIZE(sg)); 250 sg_init_table(sg, ARRAY_SIZE(sg));
265 sg_set_buf(&sg[0], &b0, sizeof(b0)); 251 sg_set_buf(&sg[0], &b0, sizeof(b0));
266 sg_set_buf(&sg[1], &b1, sizeof(b1)); 252 sg_set_buf(&sg[1], &b1, sizeof(b1));
@@ -277,8 +263,6 @@ static int wusb_ccm_mac(struct crypto_blkcipher *tfm_cbc,
277 result); 263 result);
278 goto error_cbc_crypt; 264 goto error_cbc_crypt;
279 } 265 }
280 d_printf(4, NULL, "D: MIC tag\n");
281 d_dump(4, NULL, iv, ivsize);
282 266
283 /* Now we crypt the MIC Tag (*iv) with Ax -- values per WUSB1.0[6.5] 267 /* Now we crypt the MIC Tag (*iv) with Ax -- values per WUSB1.0[6.5]
284 * The procedure is to AES crypt the A0 block and XOR the MIC 268 * The procedure is to AES crypt the A0 block and XOR the MIC
@@ -293,17 +277,10 @@ static int wusb_ccm_mac(struct crypto_blkcipher *tfm_cbc,
293 ax.counter = 0; 277 ax.counter = 0;
294 crypto_cipher_encrypt_one(tfm_aes, (void *)&ax, (void *)&ax); 278 crypto_cipher_encrypt_one(tfm_aes, (void *)&ax, (void *)&ax);
295 bytewise_xor(mic, &ax, iv, 8); 279 bytewise_xor(mic, &ax, iv, 8);
296 d_printf(4, NULL, "D: CTR[MIC]\n");
297 d_dump(4, NULL, &ax, 8);
298 d_printf(4, NULL, "D: CCM-MIC tag\n");
299 d_dump(4, NULL, mic, 8);
300 result = 8; 280 result = 8;
301error_cbc_crypt: 281error_cbc_crypt:
302 kfree(dst_buf); 282 kfree(dst_buf);
303error_dst_buf: 283error_dst_buf:
304 d_fnend(3, NULL, "(tfm_cbc %p, tfm_aes %p, mic %p, "
305 "n %p, a %p, b %p, blen %zu)\n",
306 tfm_cbc, tfm_aes, mic, n, a, b, blen);
307 return result; 284 return result;
308} 285}
309 286
@@ -325,10 +302,6 @@ ssize_t wusb_prf(void *out, size_t out_size,
325 u64 sfn = 0; 302 u64 sfn = 0;
326 __le64 sfn_le; 303 __le64 sfn_le;
327 304
328 d_fnstart(3, NULL, "(out %p, out_size %zu, key %p, _n %p, "
329 "a %p, b %p, blen %zu, len %zu)\n", out, out_size,
330 key, _n, a, b, blen, len);
331
332 tfm_cbc = crypto_alloc_blkcipher("cbc(aes)", 0, CRYPTO_ALG_ASYNC); 305 tfm_cbc = crypto_alloc_blkcipher("cbc(aes)", 0, CRYPTO_ALG_ASYNC);
333 if (IS_ERR(tfm_cbc)) { 306 if (IS_ERR(tfm_cbc)) {
334 result = PTR_ERR(tfm_cbc); 307 result = PTR_ERR(tfm_cbc);
@@ -370,9 +343,6 @@ error_alloc_aes:
370error_setkey_cbc: 343error_setkey_cbc:
371 crypto_free_blkcipher(tfm_cbc); 344 crypto_free_blkcipher(tfm_cbc);
372error_alloc_cbc: 345error_alloc_cbc:
373 d_fnend(3, NULL, "(out %p, out_size %zu, key %p, _n %p, "
374 "a %p, b %p, blen %zu, len %zu) = %d\n", out, out_size,
375 key, _n, a, b, blen, len, (int)bytes);
376 return result; 346 return result;
377} 347}
378 348