Completed
Push — master ( 275c5d...098f29 )
by Florent
01:56
created

A128KW   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 5
Bugs 2 Features 2
Metric Value
wmc 2
c 5
b 2
f 2
lcom 0
cbo 1
dl 0
loc 16
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A checkKEKSize() 0 6 2
1
<?php
2
3
/*
4
 * The MIT License (MIT)
5
 *
6
 * Copyright (c) 2014-2015 Spomky-Labs
7
 *
8
 * This software may be modified and distributed under the terms
9
 * of the MIT license.  See the LICENSE file for details.
10
 */
11
12
namespace AESKW;
13
14
class A128KW
15
{
16
    use AESKW;
17
18
    /**
19
     * @param string $kek The Key Encryption Key
20
     *
21
     * @throws \InvalidArgumentException If the size of the KEK is invalid
22
     */
23 10
    protected static function checkKEKSize($kek)
24
    {
25 10
        if (strlen($kek) !== 16) {
26 2
            throw new \InvalidArgumentException('Bad KEK size');
27
        }
28 8
    }
29
}
30