wppaste
WordPress

ParagonIE_Sodium_Core32_Curve25519

Source
wp-includes/sodium_compat/src/Core32/Curve25519.php:16
Class ParagonIE_Sodium_Core32_Curve25519

Description

Implements Curve25519 core functions

Based on the ref10 curve25519 code provided by libsodium

Compatibility

WordPress
core
  • 6.7.10
  • 6.8.11
  • 6.9.10
  • 7.0.7
  • 7.1.3

Present in every tracked release (6.7.10 to 7.1.3).

Methods · 42

Source code

abstract class ParagonIE_Sodium_Core32_Curve25519 extends ParagonIE_Sodium_Core32_Curve25519_H{    /**     * Get a field element of size 10 with a value of 0     *     * @internal You should not use this directly from another application     *     * @return ParagonIE_Sodium_Core32_Curve25519_Fe     * @throws SodiumException     * @throws TypeError     */    public static function fe_0()    {        return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray(            array(                new ParagonIE_Sodium_Core32_Int32(),                new ParagonIE_Sodium_Core32_Int32(),                new ParagonIE_Sodium_Core32_Int32(),                new ParagonIE_Sodium_Core32_Int32(),                new ParagonIE_Sodium_Core32_Int32(),                new ParagonIE_Sodium_Core32_Int32(),                new ParagonIE_Sodium_Core32_Int32(),                new ParagonIE_Sodium_Core32_Int32(),                new ParagonIE_Sodium_Core32_Int32(),                new ParagonIE_Sodium_Core32_Int32()            )        );    }     /**     * Get a field element of size 10 with a value of 1     *     * @internal You should not use this directly from another application     *     * @return ParagonIE_Sodium_Core32_Curve25519_Fe     * @throws SodiumException     * @throws TypeError     */    public static function fe_1()    {        return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray(            array(                ParagonIE_Sodium_Core32_Int32::fromInt(1),                new ParagonIE_Sodium_Core32_Int32(),                new ParagonIE_Sodium_Core32_Int32(),                new ParagonIE_Sodium_Core32_Int32(),                new ParagonIE_Sodium_Core32_Int32(),                new ParagonIE_Sodium_Core32_Int32(),                new ParagonIE_Sodium_Core32_Int32(),                new ParagonIE_Sodium_Core32_Int32(),                new ParagonIE_Sodium_Core32_Int32(),                new ParagonIE_Sodium_Core32_Int32()            )        );    }     /**     * Add two field elements.     *     * @internal You should not use this directly from another application     *     * @param ParagonIE_Sodium_Core32_Curve25519_Fe $f     * @param ParagonIE_Sodium_Core32_Curve25519_Fe $g     * @return ParagonIE_Sodium_Core32_Curve25519_Fe     * @throws SodiumException     * @throws TypeError     * @psalm-suppress MixedAssignment     * @psalm-suppress MixedMethodCall     */    public static function fe_add(        ParagonIE_Sodium_Core32_Curve25519_Fe $f,        ParagonIE_Sodium_Core32_Curve25519_Fe $g    ) {        $arr = array();        for ($i = 0; $i < 10; ++$i) {            $arr[$i] = $f[$i]->addInt32($g[$i]);        }        /** @var array<int, ParagonIE_Sodium_Core32_Int32> $arr */        return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray($arr);    }

Changelog

Unchanged from 6.7.10 through 7.1.3.

  1. 6.7.10
  2. 6.8.11
  3. 6.9.10
  4. 7.0.7
  5. 7.1.3

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 6.8.11 tag, from src/wp-includes/sodium_compat/src/Core32/Curve25519.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.