ParagonIE_Sodium_Core_Curve25519::fe_sub

Advertisement

Summery Summery

Subtract two field elements.

Syntax Syntax

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

Description Description

h = f – g

Preconditions: |f| bounded by 1.1_2^25,1.1_2^24,1.1_2^25,1.1_2^24,etc. |g| bounded by 1.1_2^25,1.1_2^24,1.1_2^25,1.1_2^24,etc.

Postconditions: |h| bounded by 1.1_2^26,1.1_2^25,1.1_2^26,1.1_2^25,etc.

Parameters Parameters

$f

(ParagonIE_Sodium_Core_Curve25519_Fe) (Required)

$g

(ParagonIE_Sodium_Core_Curve25519_Fe) (Required)

Return Return

(ParagonIE_Sodium_Core_Curve25519_Fe)

Source Source

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

    public static function fe_sub(ParagonIE_Sodium_Core_Curve25519_Fe $f, ParagonIE_Sodium_Core_Curve25519_Fe $g)
    {
        return ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(
            array(
                (int) ($f[0] - $g[0]),
                (int) ($f[1] - $g[1]),
                (int) ($f[2] - $g[2]),
                (int) ($f[3] - $g[3]),
                (int) ($f[4] - $g[4]),
                (int) ($f[5] - $g[5]),
                (int) ($f[6] - $g[6]),
                (int) ($f[7] - $g[7]),
                (int) ($f[8] - $g[8]),
                (int) ($f[9] - $g[9])
            )
        );
    }

Advertisement

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.