protected function validateSupportedAlgorithm($algorithm)
    {
        if (!in_array($algorithm, $this->supported_algorithms, true)) {
            throw new InvalidArgumentException(
                sprintf(
                    'Algorithm "%s" not supported',
                    $algorithm
                )
            );
        }

        return $algorithm;
    }