• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2
3module.exports = function () {
4  const plaintext = Buffer.from(
5    '5f4dba4f320c0ce876725afce5fbd25bf83e5a7125a08cafe73c3ebac421779df9d55d' +
6    '180c3ae9942645e1d82fee8c9d294b3cb1a08a9931201b3c0e81fc47cacf8315a2af66' +
7    '324113c3b66230c34608c4f4593634ce02b267362277f0a840ca74bc3d1a6236952c5e' +
8    'd7aaf8a8fecbddfa7584e6978cea5d2a5b9fb7f1b48c8b0be58a305202754d83761073' +
9    '74793cf026aaee5300727d836cd71e71b345ddb2e44446ffc5b901635413890d910ea3' +
10    '80984a90191031323f16dbcc9d6be168b84885384ca03e12600ac1c248028af3726cc9' +
11    '3463882ea8c02aab', 'hex');
12
13  const raw = {
14    'SHA-1': Buffer.from('47a20746d17179db65e0a79dedffc7fdf181081b', 'hex'),
15    'SHA-256': Buffer.from(
16      'e588ec0811463d767241df1074b47ae4071b51f2ce36537ba69ccdc3fdc2b7a8',
17      'hex'),
18    'SHA-384': Buffer.from(
19      '6b1da28eab1f582ad9718effe05e23d5fd2c9877a2d9443f90bec093bece2ea7' +
20      'd2354cd0bdc5e147d2e9009373494488', 'hex'),
21    'SHA-512': Buffer.from(
22      '5dcc359443aaf652fa1375d6b3e61fdcf29bb4a28bd5d3dcfa40f82f906bb280' +
23      '0455db03b5d31fb972a15a6d0103a24e56d156a119c0e5a1e92a44c3c5657cf9',
24      'hex')
25  }
26
27  const signatures = {
28    'SHA-1': Buffer.from('0533902a99f8524ee50af01d38dedce133d98ca0', 'hex'),
29    'SHA-256': Buffer.from(
30      '85a40cea2e078c2827a3953ffb66c27b291a472b0d70a0000b45d823803eeb54',
31      'hex'),
32    'SHA-384': Buffer.from(
33      '217c3d50f0ba9a6d6eae1efdd7a518fe2e3880b582a40d061e9099c1e026ef58' +
34      '82548b5d5cecdd5598d99b6b6f3057ff', 'hex'),
35    'SHA-512': Buffer.from(
36      '61fb278c3ffb0cce2bf1cf723ddfd8ef1f931c0c618c25907324605939e3f9a2' +
37      'c6f4af690bda3407dc2f5770f6a0a44b954d64a332e3ee0821abf82b7f3e99c1',
38      'hex')
39  }
40
41  const vectors = [];
42  Object.keys(raw).forEach((hash) => {
43    vectors.push({
44      hash,
45      keyBuffer: raw[hash],
46      plaintext,
47      signature: signatures[hash]
48    });
49  });
50
51  return vectors;
52};
53