Sodium   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 2
c 1
b 0
f 0
dl 0
loc 9
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A sign() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
/**
5
 * Signature Provider Class
6
 * @category    Ticaje
7
 * @author      Max Demian <[email protected]>
8
 */
9
10
namespace Ticaje\AeSdk\Infrastructure\Provider\Signature\Algorithm;
11
12
use Ticaje\AeSdk\Infrastructure\Interfaces\Provider\Signature\ComplexAlgorithmInterface;
13
14
/**
15
 * Class Sodium
16
 * @package Ticaje\AeSdk\Infrastructure\Provider\Signature\Algorithm
17
 * This class provides sodium implementation to signing message, could be abstracted into
18
 * an agnostic base class for reusing by other modules
19
 */
20
class Sodium implements ComplexAlgorithmInterface
21
{
22
    /**
23
     * @inheritDoc
24
     * Not necessarily to pass an algorithm since sodium uses other specific constraints to perform a signing
25
     */
26
    public function sign(string $message, string $secret): string
27
    {
28
        return sodium_crypto_sign($message, $secret);
29
    }
30
}
31