wppaste
WordPress

ParagonIE_Sodium_Core_X25519

Source
wp-includes/sodium_compat/src/Core/X25519.php:10
Class ParagonIE_Sodium_Core_X25519

Compatibility

WordPress
core
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Methods · 5

Source code

abstract class ParagonIE_Sodium_Core_X25519 extends ParagonIE_Sodium_Core_Curve25519{    /**     * Alters the objects passed to this method in place.     *     * @internal You should not use this directly from another application     *     * @param ParagonIE_Sodium_Core_Curve25519_Fe $f     * @param ParagonIE_Sodium_Core_Curve25519_Fe $g     * @param int $b     * @return void     * @psalm-suppress MixedAssignment     */    public static function fe_cswap(        ParagonIE_Sodium_Core_Curve25519_Fe $f,        ParagonIE_Sodium_Core_Curve25519_Fe $g,        $b = 0    ) {        $b = -$b;        $x0 = ($f->e0 ^ $g->e0) & $b;        $x1 = ($f->e1 ^ $g->e1) & $b;        $x2 = ($f->e2 ^ $g->e2) & $b;        $x3 = ($f->e3 ^ $g->e3) & $b;        $x4 = ($f->e4 ^ $g->e4) & $b;        $x5 = ($f->e5 ^ $g->e5) & $b;        $x6 = ($f->e6 ^ $g->e6) & $b;        $x7 = ($f->e7 ^ $g->e7) & $b;        $x8 = ($f->e8 ^ $g->e8) & $b;        $x9 = ($f->e9 ^ $g->e9) & $b;        $f->e0 ^= $x0;        $f->e1 ^= $x1;        $f->e2 ^= $x2;        $f->e3 ^= $x3;        $f->e4 ^= $x4;        $f->e5 ^= $x5;        $f->e6 ^= $x6;        $f->e7 ^= $x7;        $f->e8 ^= $x8;        $f->e9 ^= $x9;        $g->e0 ^= $x0;        $g->e1 ^= $x1;        $g->e2 ^= $x2;        $g->e3 ^= $x3;        $g->e4 ^= $x4;        $g->e5 ^= $x5;        $g->e6 ^= $x6;        $g->e7 ^= $x7;        $g->e8 ^= $x8;        $g->e9 ^= $x9;    }     /**     * @internal You should not use this directly from another application     *     * @param ParagonIE_Sodium_Core_Curve25519_Fe $f     * @return ParagonIE_Sodium_Core_Curve25519_Fe     */    public static function fe_mul121666(ParagonIE_Sodium_Core_Curve25519_Fe $f)    {        $h0 = self::mul($f->e0, 121666, 17);        $h1 = self::mul($f->e1, 121666, 17);        $h2 = self::mul($f->e2, 121666, 17);        $h3 = self::mul($f->e3, 121666, 17);        $h4 = self::mul($f->e4, 121666, 17);        $h5 = self::mul($f->e5, 121666, 17);        $h6 = self::mul($f->e6, 121666, 17);        $h7 = self::mul($f->e7, 121666, 17);        $h8 = self::mul($f->e8, 121666, 17);        $h9 = self::mul($f->e9, 121666, 17);         $carry9 = ($h9 + (1 << 24)) >> 25;        $h0 += self::mul($carry9, 19, 5);        $h9 -= $carry9 << 25;         $carry1 = ($h1 + (1 << 24)) >> 25;        $h2 += $carry1;        $h1 -= $carry1 << 25;         $carry3 = ($h3 + (1 << 24)) >> 25;        $h4 += $carry3;

Changelog

Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

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

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/sodium_compat/src/Core/X25519.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.