You are here

public static function ParagonIE_Sodium_Core32_Curve25519::fe_sub in Automatic Updates 8

Same name and namespace in other branches
  1. 7 vendor/paragonie/sodium_compat/src/Core32/Curve25519.php \ParagonIE_Sodium_Core32_Curve25519::fe_sub()

Subtract two field elements.

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.

@internal You should not use this directly from another application

@psalm-suppress MixedMethodCall @psalm-suppress MixedTypeCoercion

Parameters

ParagonIE_Sodium_Core32_Curve25519_Fe $f:

ParagonIE_Sodium_Core32_Curve25519_Fe $g:

Return value

ParagonIE_Sodium_Core32_Curve25519_Fe

Throws

SodiumException

TypeError

10 calls to ParagonIE_Sodium_Core32_Curve25519::fe_sub()
ParagonIE_Sodium_Core32_Curve25519::ge_add in vendor/paragonie/sodium_compat/src/Core32/Curve25519.php
Add two group elements.
ParagonIE_Sodium_Core32_Curve25519::ge_frombytes_negate_vartime in vendor/paragonie/sodium_compat/src/Core32/Curve25519.php
@internal You should not use this directly from another application
ParagonIE_Sodium_Core32_Curve25519::ge_madd in vendor/paragonie/sodium_compat/src/Core32/Curve25519.php
@internal You should not use this directly from another application
ParagonIE_Sodium_Core32_Curve25519::ge_msub in vendor/paragonie/sodium_compat/src/Core32/Curve25519.php
@internal You should not use this directly from another application
ParagonIE_Sodium_Core32_Curve25519::ge_p2_dbl in vendor/paragonie/sodium_compat/src/Core32/Curve25519.php
@internal You should not use this directly from another application

... See full list

File

vendor/paragonie/sodium_compat/src/Core32/Curve25519.php, line 1365

Class

ParagonIE_Sodium_Core32_Curve25519
Class ParagonIE_Sodium_Core32_Curve25519

Code

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