1 | <?php |
||
14 | class GHASH |
||
15 | { |
||
16 | /** |
||
17 | * Fixed R-block. |
||
18 | * |
||
19 | * @var string |
||
20 | */ |
||
21 | const R = "\xE1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; |
||
22 | |||
23 | /** |
||
24 | * Hash subkey. |
||
25 | * |
||
26 | * @var string $_subkey |
||
27 | */ |
||
28 | protected $_subkey; |
||
29 | |||
30 | /** |
||
31 | * Constructor. |
||
32 | * |
||
33 | * @param string $subkey Hash subkey |
||
34 | */ |
||
35 | 51 | public function __construct(string $subkey) |
|
42 | |||
43 | /** |
||
44 | * Compute hash. |
||
45 | * |
||
46 | * @param string $X Input string |
||
47 | * @return string Hash |
||
48 | */ |
||
49 | 53 | public function compute(string $X): string |
|
65 | |||
66 | /** |
||
67 | * Functor method for <code>compute</code>. |
||
68 | * |
||
69 | * @param string $arg |
||
70 | * @return string |
||
71 | */ |
||
72 | 50 | public function __invoke(string $arg): string |
|
76 | |||
77 | /** |
||
78 | * Apply block multiplication operation. |
||
79 | * |
||
80 | * See NIST SP-800-38D, chapter 6.3 for the details. |
||
81 | * |
||
82 | * @param string $X |
||
83 | * @param string $Y |
||
84 | * @return string |
||
85 | */ |
||
86 | 52 | private function _mult(string $X, string $Y): string |
|
106 | } |
||
107 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.