]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: test-hash-method - Add tests for sha2
authorAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 2 Dec 2020 12:53:55 +0000 (14:53 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Mon, 7 Dec 2020 10:09:56 +0000 (10:09 +0000)
src/lib/test-hash-method.c

index ac0a15bb21fddbb55cd17bd9623ce56ee2b5e718..0fd41e0bb47744e2172a5a3ee5e540c5df2a7349 100644 (file)
@@ -140,6 +140,114 @@ static void test_hash_methods_fips() {
                        "\xe5\x46\x70\xf1",
                        160 / 8
                },
+               { "sha256",
+                       "",
+                       0,
+                       1,
+                       "\xe3\xb0\xc4\x42\x98\xfc\x1c\x14"
+                       "\x9a\xfb\xf4\xc8\x99\x6f\xb9\x24"
+                       "\x27\xae\x41\xe4\x64\x9b\x93\x4c"
+                       "\xa4\x95\x99\x1b\x78\x52\xb8\x55",
+                       256 / 8
+               },
+               { "sha256",
+                       "abc",
+                       3,
+                       1,
+                       "\xba\x78\x16\xbf\x8f\x01\xcf\xea"
+                       "\x41\x41\x40\xde\x5d\xae\x22\x23"
+                       "\xb0\x03\x61\xa3\x96\x17\x7a\x9c"
+                       "\xb4\x10\xff\x61\xf2\x00\x15\xad",
+                       256 / 8
+               },
+               { "sha256",
+                       "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
+                       56,
+                       1,
+                       "\x24\x8d\x6a\x61\xd2\x06\x38\xb8"
+                       "\xe5\xc0\x26\x93\x0c\x3e\x60\x39"
+                       "\xa3\x3c\xe4\x59\x64\xff\x21\x67"
+                       "\xf6\xec\xed\xd4\x19\xdb\x06\xc1",
+                       256 / 8
+               },
+               { "sha384",
+                       "",
+                       0,
+                       1,
+                       "\x38\xb0\x60\xa7\x51\xac\x96\x38"
+                       "\x4c\xd9\x32\x7e\xb1\xb1\xe3\x6a"
+                       "\x21\xfd\xb7\x11\x14\xbe\x07\x43"
+                       "\x4c\x0c\xc7\xbf\x63\xf6\xe1\xda"
+                       "\x27\x4e\xde\xbf\xe7\x6f\x65\xfb"
+                       "\xd5\x1a\xd2\xf1\x48\x98\xb9\x5b",
+                       384 / 8
+               },
+               { "sha384",
+                       "abc",
+                       3,
+                       1,
+                       "\xcb\x00\x75\x3f\x45\xa3\x5e\x8b"
+                       "\xb5\xa0\x3d\x69\x9a\xc6\x50\x07"
+                       "\x27\x2c\x32\xab\x0e\xde\xd1\x63"
+                       "\x1a\x8b\x60\x5a\x43\xff\x5b\xed"
+                       "\x80\x86\x07\x2b\xa1\xe7\xcc\x23"
+                       "\x58\xba\xec\xa1\x34\xc8\x25\xa7",
+                       384 / 8
+               },
+               { "sha384",
+                       "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
+                       56,
+                       1,
+                       "\x33\x91\xfd\xdd\xfc\x8d\xc7\x39"
+                       "\x37\x07\xa6\x5b\x1b\x47\x09\x39"
+                       "\x7c\xf8\xb1\xd1\x62\xaf\x05\xab"
+                       "\xfe\x8f\x45\x0d\xe5\xf3\x6b\xc6"
+                       "\xb0\x45\x5a\x85\x20\xbc\x4e\x6f"
+                       "\x5f\xe9\x5b\x1f\xe3\xc8\x45\x2b",
+                       384 / 8
+               },
+               { "sha512",
+                       "",
+                       0,
+                       1,
+                       "\xcf\x83\xe1\x35\x7e\xef\xb8\xbd"
+                       "\xf1\x54\x28\x50\xd6\x6d\x80\x07"
+                       "\xd6\x20\xe4\x05\x0b\x57\x15\xdc"
+                       "\x83\xf4\xa9\x21\xd3\x6c\xe9\xce"
+                       "\x47\xd0\xd1\x3c\x5d\x85\xf2\xb0"
+                       "\xff\x83\x18\xd2\x87\x7e\xec\x2f"
+                       "\x63\xb9\x31\xbd\x47\x41\x7a\x81"
+                       "\xa5\x38\x32\x7a\xf9\x27\xda\x3e",
+                       512 / 8
+               },
+               { "sha512",
+                       "abc",
+                       3,
+                       1,
+                       "\xdd\xaf\x35\xa1\x93\x61\x7a\xba"
+                       "\xcc\x41\x73\x49\xae\x20\x41\x31"
+                       "\x12\xe6\xfa\x4e\x89\xa9\x7e\xa2"
+                       "\x0a\x9e\xee\xe6\x4b\x55\xd3\x9a"
+                       "\x21\x92\x99\x2a\x27\x4f\xc1\xa8"
+                       "\x36\xba\x3c\x23\xa3\xfe\xeb\xbd"
+                       "\x45\x4d\x44\x23\x64\x3c\xe8\x0e"
+                       "\x2a\x9a\xc9\x4f\xa5\x4c\xa4\x9f",
+                       512 / 8
+               },
+               { "sha512",
+                       "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
+                       56,
+                       1,
+                       "\x20\x4a\x8f\xc6\xdd\xa8\x2f\x0a"
+                       "\x0c\xed\x7b\xeb\x8e\x08\xa4\x16"
+                       "\x57\xc1\x6e\xf4\x68\xb2\x28\xa8"
+                       "\x27\x9b\xe3\x31\xa7\x03\xc3\x35"
+                       "\x96\xfd\x15\xc1\x3b\x1b\x07\xf9"
+                       "\xaa\x1d\x3b\xea\x57\x78\x9c\xa0"
+                       "\x31\xad\x85\xc7\xa7\x1d\xd7\x03"
+                       "\x54\xec\x63\x12\x38\xca\x34\x45",
+                       512 / 8
+               },
                { "sha3-256",
                        "",
                        0,