hmac-md5.slt 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. # Copyright 1994, Regents of the University of California.
  2. # Copyright 1996-2020 PostgreSQL Global Development Group.
  3. # Copyright Materialize, Inc. and contributors. All rights reserved.
  4. #
  5. # Use of this software is governed by the Business Source License
  6. # included in the LICENSE file at the root of this repository.
  7. #
  8. # As of the Change Date specified in that file, in accordance with
  9. # the Business Source License, use of this software will be governed
  10. # by the Apache License, Version 2.0.
  11. #
  12. # This file is derived from the regression test suite in PostgreSQL.
  13. # The original file was retrieved on December 14, 2020 from:
  14. #
  15. # https://github.com/postgres/postgres/blob/9b584953e7bf91e342af87ef44606acd6206cd1c/contrib/pgcrypto/expected/hmac-md5.out
  16. #
  17. # The original source code is subject to the terms of the PostgreSQL
  18. # license, a copy of which can be found in the LICENSE file at the
  19. # root of this repository
  20. query T
  21. SELECT hmac('Hi There', '\x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b'::bytea, 'md5')::text
  22. ----
  23. \x9294727a3638bb1c13f48ef8158bfc9d
  24. query T
  25. SELECT hmac('Jefe', 'what do ya want for nothing?', 'md5')::text
  26. ----
  27. \x813aead7c4a34bff01a16d61368e7c13
  28. query T
  29. SELECT hmac(
  30. '\xdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd'::bytea,
  31. '\xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'::bytea,
  32. 'md5'
  33. )::text
  34. ----
  35. \x56be34521d144c88dbb8c733f0e8b3f6
  36. query T
  37. SELECT hmac(
  38. '\xcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd'::bytea,
  39. '\x0102030405060708090a0b0c0d0e0f10111213141516171819',
  40. 'md5'
  41. )::text
  42. ----
  43. \x697eaf0aca3a3aea3a75164746ffaa79
  44. query T
  45. SELECT hmac(
  46. 'Test With Truncation',
  47. '\x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c'::bytea,
  48. 'md5'
  49. )::text
  50. ----
  51. \x56461ef2342edc00f9bab995690efd4c
  52. query T
  53. SELECT hmac(
  54. 'Test Using Larger Than Block-Size Key - Hash Key First',
  55. '\xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'::bytea,
  56. 'md5'
  57. )::text
  58. ----
  59. \x6b1ab7fe4bd7bf8f0b62e6ce61b9d0cd
  60. query T
  61. SELECT hmac(
  62. 'Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data',
  63. '\xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'::bytea,
  64. 'md5'
  65. )::text
  66. ----
  67. \x6f630fad67cda0ee1fb1f562db3aa53e