Total Complexity | 4 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | trait HMACOutputLengthTrait |
||
17 | { |
||
18 | /** |
||
19 | * The HMAC algorithm (RFC2104 [HMAC]) takes the output (truncation) length in bits as a parameter; |
||
20 | * this specification REQUIRES that the truncation length be a multiple of 8 (i.e. fall on a byte boundary) |
||
21 | * because Base64 encoding operates on full bytes |
||
22 | * |
||
23 | * @var string |
||
24 | */ |
||
25 | private static string $HMACOutputLength_regex = '/^([1-9]\d*)$/D'; |
||
26 | |||
27 | |||
28 | /** |
||
29 | * @param string $value |
||
30 | * @param string $message |
||
31 | */ |
||
32 | protected static function validHMACOutputLength(string $value, string $message = ''): void |
||
54 |