WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Самая быстрая Тема-конструктор для WordPress
функция не описана

ParagonIE_Sodium_Core32_Poly1305_State::__construct() public WP 1.0

ParagonIE_Sodium_Core32_Poly1305_State constructor.

Это метод класса: ParagonIE_Sodium_Core32_Poly1305_State{}

Хуков нет.

Возвращает

Null. Ничего.

Использование

$ParagonIE_Sodium_Core32_Poly1305_State = new ParagonIE_Sodium_Core32_Poly1305_State();
$ParagonIE_Sodium_Core32_Poly1305_State->__construct( $key );
$key(строка)

По умолчанию: ''

Код ParagonIE_Sodium_Core32_Poly1305_State::__construct() WP 5.5.1

<?php
public function __construct($key = '')
{
    if (self::strlen($key) < 32) {
        throw new InvalidArgumentException(
            'Poly1305 requires a 32-byte key'
        );
    }
    /* r &= 0xffffffc0ffffffc0ffffffc0fffffff */
    $this->r = array(
        // st->r[0] = ...
        ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 0, 4))
            ->setUnsignedInt(true)
            ->mask(0x3ffffff),
        // st->r[1] = ...
        ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 3, 4))
            ->setUnsignedInt(true)
            ->shiftRight(2)
            ->mask(0x3ffff03),
        // st->r[2] = ...
        ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 6, 4))
            ->setUnsignedInt(true)
            ->shiftRight(4)
            ->mask(0x3ffc0ff),
        // st->r[3] = ...
        ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 9, 4))
            ->setUnsignedInt(true)
            ->shiftRight(6)
            ->mask(0x3f03fff),
        // st->r[4] = ...
        ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 12, 4))
            ->setUnsignedInt(true)
            ->shiftRight(8)
            ->mask(0x00fffff)
    );

    /* h = 0 */
    $this->h = array(
        new ParagonIE_Sodium_Core32_Int32(array(0, 0), true),
        new ParagonIE_Sodium_Core32_Int32(array(0, 0), true),
        new ParagonIE_Sodium_Core32_Int32(array(0, 0), true),
        new ParagonIE_Sodium_Core32_Int32(array(0, 0), true),
        new ParagonIE_Sodium_Core32_Int32(array(0, 0), true)
    );

    /* save pad for later */
    $this->pad = array(
        ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 16, 4))
            ->setUnsignedInt(true)->toInt64(),
        ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 20, 4))
            ->setUnsignedInt(true)->toInt64(),
        ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 24, 4))
            ->setUnsignedInt(true)->toInt64(),
        ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 28, 4))
            ->setUnsignedInt(true)->toInt64(),
    );

    $this->leftover = 0;
    $this->final = false;
}