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