hmac-sha1.slt 2.5 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-sha1.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, 'sha1')::text
  22. ----
  23. \x675b0b3a1b4ddf4e124872da6c2f632bfed957e9
  24. query T
  25. SELECT hmac('Jefe', 'what do ya want for nothing?', 'sha1')::text
  26. ----
  27. \x156d4c35468a0339f3fa57a067bf47f814eb7a57
  28. query T
  29. SELECT hmac(
  30. '\xdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd'::bytea,
  31. '\xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'::bytea,
  32. 'sha1'
  33. )::text
  34. ----
  35. \xd730594d167e35d5956fd8003d0db3d3f46dc7bb
  36. query T
  37. SELECT hmac(
  38. '\xcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd'::bytea,
  39. '\x0102030405060708090a0b0c0d0e0f10111213141516171819',
  40. 'sha1'
  41. )::text
  42. ----
  43. \x4c9007f4026250c6bc8414f9bf50c86c2d7235da
  44. query T
  45. SELECT hmac(
  46. 'Test With Truncation',
  47. '\x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c'::bytea,
  48. 'sha1'
  49. )::text
  50. ----
  51. \x37268b7e21e84da5720c53c4ba03ad1104039fa7
  52. query T
  53. SELECT hmac(
  54. 'Test Using Larger Than Block-Size Key - Hash Key First',
  55. '\xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'::bytea,
  56. 'sha1'
  57. )::text
  58. ----
  59. \xaa4ae5e15272d00e95705637ce8a3b55ed402112
  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. 'sha1'
  65. )::text
  66. ----
  67. \xe8e99d0f45237d786d6bbaa7965c7808bbff1a91