You are here

public static function ParagonIE_Sodium_Core_Curve25519::fe_add in Automatic Updates 7

Same name and namespace in other branches
  1. 8 vendor/paragonie/sodium_compat/src/Core/Curve25519.php \ParagonIE_Sodium_Core_Curve25519::fe_add()

Add two field elements.

@internal You should not use this directly from another application

@psalm-suppress MixedAssignment @psalm-suppress MixedOperand

Parameters

ParagonIE_Sodium_Core_Curve25519_Fe $f:

ParagonIE_Sodium_Core_Curve25519_Fe $g:

Return value

ParagonIE_Sodium_Core_Curve25519_Fe

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

... See full list

File

vendor/paragonie/sodium_compat/src/Core/Curve25519.php, line 57

Class

ParagonIE_Sodium_Core_Curve25519
Class ParagonIE_Sodium_Core_Curve25519

Code

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);
}