ParagonIE_Sodium_Core_Curve25519::fe_add

Advertisement

Summery Summery

Add two field elements.

Syntax Syntax

ParagonIE_Sodium_Core_Curve25519::fe_add( ParagonIE_Sodium_Core_Curve25519_Fe $f, ParagonIE_Sodium_Core_Curve25519_Fe $g )

Parameters Parameters

$f

(Required)

$g

(Required)

Return Return

(ParagonIE_Sodium_Core_Curve25519_Fe)

Source Source

File: wp-includes/sodium_compat/src/Core/Curve25519.php

    public static function fe_add(
        ParagonIE_Sodium_Core_Curve25519_Fe $f,
        ParagonIE_Sodium_Core_Curve25519_Fe $g
    ) {
        /** @var array<int, int> $arr */
        $arr = array();
        for ($i = 0; $i < 10; ++$i) {
            $arr[$i] = (int) ($f[$i] + $g[$i]);
        }
        return ParagonIE_Sodium_Core_Curve25519_Fe::fromArray($arr);
    }

Advertisement

Advertisement

Leave a Reply