You are here

public static function ParagonIE_Sodium_Core32_Curve25519::ge_madd 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::ge_madd()

@internal You should not use this directly from another application

Parameters

ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 $R:

ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p:

ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp $q:

Return value

ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1

Throws

SodiumException

TypeError

2 calls to ParagonIE_Sodium_Core32_Curve25519::ge_madd()
ParagonIE_Sodium_Core32_Curve25519::ge_double_scalarmult_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_scalarmult_base in vendor/paragonie/sodium_compat/src/Core32/Curve25519.php
@internal You should not use this directly from another application

File

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

Class

ParagonIE_Sodium_Core32_Curve25519
Class ParagonIE_Sodium_Core32_Curve25519

Code

public static function ge_madd(ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 $R, ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p, ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp $q) {
  $r = clone $R;
  $r->X = self::fe_add($p->Y, $p->X);
  $r->Y = self::fe_sub($p->Y, $p->X);
  $r->Z = self::fe_mul($r->X, $q->yplusx);
  $r->Y = self::fe_mul($r->Y, $q->yminusx);
  $r->T = self::fe_mul($q->xy2d, $p->T);
  $t0 = self::fe_add(clone $p->Z, clone $p->Z);
  $r->X = self::fe_sub($r->Z, $r->Y);
  $r->Y = self::fe_add($r->Z, $r->Y);
  $r->Z = self::fe_add($t0, $r->T);
  $r->T = self::fe_sub($t0, $r->T);
  return $r;
}