Revert commit 66c0185a3 and follow-on patches.
[pgsql.git] / contrib / pgcrypto / sql / hmac-sha1.sql
blobf9a7b71d45c27921f761f6ba712ab70506e830c4
1 --
2 -- HMAC-SHA1
3 --
5 SELECT hmac(
6 'Hi There',
7 '\x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b'::bytea,
8 'sha1');
10 -- 2
11 SELECT hmac(
12 'Jefe',
13 'what do ya want for nothing?',
14 'sha1');
16 -- 3
17 SELECT hmac(
18 '\xdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd'::bytea,
19 '\xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'::bytea,
20 'sha1');
22 -- 4
23 SELECT hmac(
24 '\xcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd'::bytea,
25 '\x0102030405060708090a0b0c0d0e0f10111213141516171819'::bytea,
26 'sha1');
28 -- 5
29 SELECT hmac(
30 'Test With Truncation',
31 '\x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c'::bytea,
32 'sha1');
34 -- 6
35 SELECT hmac(
36 'Test Using Larger Than Block-Size Key - Hash Key First',
37 '\xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'::bytea,
38 'sha1');
40 -- 7
41 SELECT hmac(
42 'Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data',
43 '\xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'::bytea,
44 'sha1');