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

ParagonIE_Sodium_Core32_Curve25519::ge_scalarmult_base() public WP 1.0

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

Хуков нет.

Возвращает

ParagonIE_Sodium_Core32_Curve25519_Ge_P3.

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

$result = ParagonIE_Sodium_Core32_Curve25519::ge_scalarmult_base( $a );
$a(строка) (обязательный)

Код ParagonIE_Sodium_Core32_Curve25519::ge_scalarmult_base() WP 5.5.1

<?php
public static function ge_scalarmult_base($a)
{
    /** @var array<int, int> $e */
    $e = array();
    $r = new ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1();

    for ($i = 0; $i < 32; ++$i) {
        /** @var int $dbl */
        $dbl = (int) $i << 1;
        $e[$dbl] = (int) self::chrToInt($a[$i]) & 15;
        $e[$dbl + 1] = (int) (self::chrToInt($a[$i]) >> 4) & 15;
    }

    /** @var int $carry */
    $carry = 0;
    for ($i = 0; $i < 63; ++$i) {
        $e[$i] += $carry;
        /** @var int $carry */
        $carry = $e[$i] + 8;
        /** @var int $carry */
        $carry >>= 4;
        $e[$i] -= $carry << 4;
    }

    /** @var array<int, int> $e */
    $e[63] += (int) $carry;

    $h = self::ge_p3_0();

    for ($i = 1; $i < 64; $i += 2) {
        $t = self::ge_select((int) floor($i / 2), (int) $e[$i]);
        $r = self::ge_madd($r, $h, $t);
        $h = self::ge_p1p1_to_p3($r);
    }

    $r = self::ge_p3_dbl($h);

    $s = self::ge_p1p1_to_p2($r);
    $r = self::ge_p2_dbl($s);
    $s = self::ge_p1p1_to_p2($r);
    $r = self::ge_p2_dbl($s);
    $s = self::ge_p1p1_to_p2($r);
    $r = self::ge_p2_dbl($s);

    $h = self::ge_p1p1_to_p3($r);

    for ($i = 0; $i < 64; $i += 2) {
        $t = self::ge_select($i >> 1, (int) $e[$i]);
        $r = self::ge_madd($r, $h, $t);
        $h = self::ge_p1p1_to_p3($r);
    }
    return $h;
}