ALSA: hda: HDMI channel allocations for audio infoframe
[sfrench/cifs-2.6.git] / crypto / tcrypt.c
index 59821a22d75238e568fc07dff1b1d6e73f804640..66368022e0bf32466fa4a4e0569e9e03303b6b12 100644 (file)
@@ -481,21 +481,31 @@ next_one:
 
                        for (k = 0, temp = 0; k < template[i].np; k++) {
                                printk(KERN_INFO "page %u\n", k);
-                               q = &axbuf[IDX[k]];
-                               hexdump(q, template[i].tap[k]);
+                               q = &xbuf[IDX[k]];
+
+                               n = template[i].tap[k];
+                               if (k == template[i].np - 1)
+                                       n += enc ? authsize : -authsize;
+                               hexdump(q, n);
                                printk(KERN_INFO "%s\n",
-                                      memcmp(q, template[i].result + temp,
-                                             template[i].tap[k] -
-                                             (k < template[i].np - 1 || enc ?
-                                              0 : authsize)) ?
+                                      memcmp(q, template[i].result + temp, n) ?
                                       "fail" : "pass");
 
-                               for (n = 0; q[template[i].tap[k] + n]; n++)
-                                       ;
+                               q += n;
+                               if (k == template[i].np - 1 && !enc) {
+                                       if (memcmp(q, template[i].input +
+                                                     temp + n, authsize))
+                                               n = authsize;
+                                       else
+                                               n = 0;
+                               } else {
+                                       for (n = 0; q[n]; n++)
+                                               ;
+                               }
                                if (n) {
                                        printk("Result buffer corruption %u "
                                               "bytes:\n", n);
-                                       hexdump(&q[template[i].tap[k]], n);
+                                       hexdump(q, n);
                                }
 
                                temp += template[i].tap[k];