File: ge_isneutral.c

package info (click to toggle)
python-axolotl-curve25519 0.4.1.post2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 664 kB
  • sloc: ansic: 5,207; python: 34; makefile: 4
file content (16 lines) | stat: -rw-r--r-- 279 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "crypto_additions.h"
#include "ge.h"

/*
return 1 if p is the neutral point
return 0 otherwise
*/

int ge_isneutral(const ge_p3 *p)
{
  fe zero;
  fe_0(zero);

  /* Check if p == neutral element == (0, 1) */
  return (fe_isequal(p->X, zero) & fe_isequal(p->Y, p->Z));
}