FK20 CUDA
g1p_neg.cu
Go to the documentation of this file.
1 // bls12_381: Arithmetic for BLS12-381
2 // Copyright 2022-2023 Dag Arne Osvik
3 // Copyright 2022-2023 Luan Cardoso dos Santos
4 
5 #include "fp.cuh"
6 #include "g1.cuh"
7 
16 __device__ void g1p_neg(g1p_t &p) {
17  if (fp_nonzero(p.z))
18  fp_neg(p.y, p.y);
19 }
20 
21 // vim: ts=4 et sw=4 si
__device__ void fp_neg(fp_t &z, const fp_t &x)
Compute an additive inverse of a residue x modulo p. Stores in z. Subtracts x from the highest multip...
Definition: fp_neg.cu:16
__device__ bool fp_nonzero(const fp_t &x)
Check if the reduced input x is different from zero.
Definition: fp_nonzero.cu:12
__device__ void g1p_neg(g1p_t &p)
Computes the negative of the point p. Due to negation map automorphism on Elliptic Curves in Weierstr...
Definition: g1p_neg.cu:16
G1 point in projective coordinates.
Definition: g1.cuh:27
fp_t z
Definition: g1.cuh:28
fp_t y
Definition: g1.cuh:28