summaryrefslogtreecommitdiff
path: root/crypto/tcrypt.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-09-04 09:04:45 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-09-04 09:04:45 -0700
commitb7a047f3bc596ac41a53b27b38eb7a7a5eb2d2b3 (patch)
tree5bc6c99bf53d43a7d2148e38c81ee00dc8fce6b4 /crypto/tcrypt.c
parenteb7e27d6e498a98be39897ff84f254bcabae4a74 (diff)
parent22e6191ca891ad8f54e18f74a0ec19c617f7b433 (diff)
downloadlinux-crypto-b7a047f3bc596ac41a53b27b38eb7a7a5eb2d2b3.tar.gz
linux-crypto-b7a047f3bc596ac41a53b27b38eb7a7a5eb2d2b3.zip
Merge branch 'x86/cpu' into x86/xsave
Conflicts: arch/x86/kernel/cpu/feature_names.c include/asm-x86/cpufeature.h
Diffstat (limited to 'crypto/tcrypt.c')
-rw-r--r--crypto/tcrypt.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index 59821a22..66368022 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -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];