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