aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2014-06-12 11:01:50 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2014-06-20 13:59:29 -0400
commit6c9e3dcd36691c8690861a5f6902226ed2d8a75e (patch)
tree236b9938018104958f0b109aafd6509645a0cacc /crypto
parent22cddcc7df8fd35d52646ee220658d26ef09da17 (diff)
crypto: testmgr - add 4 more test vectors for GHASH
This adds 4 test vectors for GHASH (of which one for chunked mode), making a total of 5. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/testmgr.h49
1 files changed, 45 insertions, 4 deletions
diff --git a/crypto/testmgr.h b/crypto/testmgr.h
index b13aa6927484..4bb607189b8d 100644
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
@@ -1822,18 +1822,59 @@ static struct hash_testvec tgr128_tv_template[] = {
1822 }, 1822 },
1823}; 1823};
1824 1824
1825#define GHASH_TEST_VECTORS 1 1825#define GHASH_TEST_VECTORS 5
1826 1826
1827static struct hash_testvec ghash_tv_template[] = 1827static struct hash_testvec ghash_tv_template[] =
1828{ 1828{
1829 { 1829 {
1830 1830 .key = "\xdf\xa6\xbf\x4d\xed\x81\xdb\x03"
1831 .key = "\xdf\xa6\xbf\x4d\xed\x81\xdb\x03\xff\xca\xff\x95\xf8\x30\xf0\x61", 1831 "\xff\xca\xff\x95\xf8\x30\xf0\x61",
1832 .ksize = 16, 1832 .ksize = 16,
1833 .plaintext = "\x95\x2b\x2a\x56\xa5\x60\x04a\xc0\xb3\x2b\x66\x56\xa0\x5b\x40\xb6", 1833 .plaintext = "\x95\x2b\x2a\x56\xa5\x60\x04a\xc0"
1834 "\xb3\x2b\x66\x56\xa0\x5b\x40\xb6",
1834 .psize = 16, 1835 .psize = 16,
1835 .digest = "\xda\x53\xeb\x0a\xd2\xc5\x5b\xb6" 1836 .digest = "\xda\x53\xeb\x0a\xd2\xc5\x5b\xb6"
1836 "\x4f\xc4\x80\x2c\xc3\xfe\xda\x60", 1837 "\x4f\xc4\x80\x2c\xc3\xfe\xda\x60",
1838 }, {
1839 .key = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
1840 "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
1841 .ksize = 16,
1842 .plaintext = "what do ya want for nothing?",
1843 .psize = 28,
1844 .digest = "\x3e\x1f\x5c\x4d\x65\xf0\xef\xce"
1845 "\x0d\x61\x06\x27\x66\x51\xd5\xe2",
1846 .np = 2,
1847 .tap = {14, 14}
1848 }, {
1849 .key = "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
1850 "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
1851 .ksize = 16,
1852 .plaintext = "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
1853 "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
1854 "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd"
1855 "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd",
1856 .psize = 50,
1857 .digest = "\xfb\x49\x8a\x36\xe1\x96\xe1\x96"
1858 "\xe1\x96\xe1\x96\xe1\x96\xe1\x96",
1859 }, {
1860 .key = "\xda\x53\xeb\x0a\xd2\xc5\x5b\xb6"
1861 "\x4f\xc4\x80\x2c\xc3\xfe\xda\x60",
1862 .ksize = 16,
1863 .plaintext = "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
1864 "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
1865 "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd"
1866 "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd",
1867 .psize = 50,
1868 .digest = "\x2b\x5c\x0c\x7f\x52\xd1\x60\xc2"
1869 "\x49\xed\x6e\x32\x7a\xa9\xbe\x08",
1870 }, {
1871 .key = "\x95\x2b\x2a\x56\xa5\x60\x04a\xc0"
1872 "\xb3\x2b\x66\x56\xa0\x5b\x40\xb6",
1873 .ksize = 16,
1874 .plaintext = "Test With Truncation",
1875 .psize = 20,
1876 .digest = "\xf8\x94\x87\x2a\x4b\x63\x99\x28"
1877 "\x23\xf7\x93\xf7\x19\xf5\x96\xd9",
1837 }, 1878 },
1838}; 1879};
1839 1880