Conditions | 5 |
Paths | 5 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 30 |
Changes | 0 |
1 | <?php |
||
33 | public function link(array $signatures, array $publicKeys, BufferInterface $messageHash): \SplObjectStorage |
||
34 | { |
||
35 | $sigCount = count($signatures); |
||
36 | $storage = new \SplObjectStorage(); |
||
37 | foreach ($signatures as $signature) { |
||
38 | foreach ($publicKeys as $key) { |
||
39 | if ($key->verify($messageHash, $signature)) { |
||
40 | $storage->attach($key, $signature); |
||
41 | if (count($storage) === $sigCount) { |
||
42 | break 2; |
||
43 | } |
||
44 | |||
45 | break; |
||
46 | } |
||
47 | } |
||
48 | } |
||
49 | |||
50 | return $storage; |
||
51 | } |
||
53 |