-
-
Notifications
You must be signed in to change notification settings - Fork 113
/
Copy pathA256KWBench.php
113 lines (105 loc) · 3.21 KB
/
A256KWBench.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?php
declare(strict_types=1);
namespace Jose\Performance\JWE;
use Override;
use PhpBench\Benchmark\Metadata\Annotations\Groups;
use PhpBench\Benchmark\Metadata\Annotations\Revs;
/**
* @Revs(4096)
* @Groups({"JWE", "KW", "A256KW"})
*/
final class A256KWBench extends EncryptionBench
{
#[Override]
public function dataHeadersAndAlgorithms(): array
{
return [
[
'shared_protected_header' => [
'alg' => 'A256KW',
'enc' => 'A128CBC-HS256',
],
'shared_header' => [],
'recipient_header' => [],
],
[
'shared_protected_header' => [
'alg' => 'A256KW',
'enc' => 'A192CBC-HS384',
],
'shared_header' => [],
'recipient_header' => [],
],
[
'shared_protected_header' => [
'alg' => 'A256KW',
'enc' => 'A256CBC-HS512',
],
'shared_header' => [],
'recipient_header' => [],
],
[
'shared_protected_header' => [
'alg' => 'A256KW',
'enc' => 'A128GCM',
],
'shared_header' => [],
'recipient_header' => [],
],
[
'shared_protected_header' => [
'alg' => 'A256KW',
'enc' => 'A192GCM',
],
'shared_header' => [],
'recipient_header' => [],
],
[
'shared_protected_header' => [
'alg' => 'A256KW',
'enc' => 'A256GCM',
],
'shared_header' => [],
'recipient_header' => [],
],
];
}
public function dataInputs(): array
{
return [
[
'input' => '{"ciphertext":"Js4OCNZs2s0En9-JTEzHntCLjUYHwd9mgEuMgTlQQCACrTcwctobqEyEXIEnHhFqQb6FDi7z6gXrY4pJdMnZAbY-DF2KlzPewPJdPCtncGMJ6Q-tJ7_aNoBQbR9yFpcdPqzZKG5l_g3JjI5n2z1pP2T3-tvwFN6UJvUBy-gQJgkosXlEXEcDcpGcGl41wLUwv-uVg-T6_i52_MDHg4CqST_5qugu6_Y","iv":"nqT3ZOuxL5i-6zFa","tag":"6XRD6atZ3kX1AXMFw9Np5g","aad":"QSxCLEMsRA","protected":"eyJhbGciOiJBMjU2S1ciLCJlbmMiOiJBMjU2R0NNIn0","encrypted_key":"L7ZhHtUPPSyrxyE36QFyt7dlb6GSmPZSoP-1HUkAe0d8PDKIXLwjAw"}',
],
];
}
public function dataPrivateKeys(): array
{
return [
[
'recipient_keys' => [
'keys' => [[
'kty' => 'oct',
'k' => 'OgUyABAPIkI-zFg3doqsv_GH-4GTGOu3HGnuG9wdxCo',
]],
],
],
];
}
#[Override]
public function dataRecipientPublicKeys(): array
{
return [
[
'recipient_key' => [
'kty' => 'oct',
'k' => 'OgUyABAPIkI-zFg3doqsv_GH-4GTGOu3HGnuG9wdxCo',
],
],
];
}
#[Override]
protected function getAAD(): ?string
{
return 'A,B,C,D';
}
}