summaryrefslogtreecommitdiff
path: root/libs/libaxolotl/src/curve25519/ed25519/additions/fe_isreduced.c
blob: 6fbb3beccd43c64fb0e2a3053b7e5faafa7353ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include "fe.h"
#include "crypto_verify_32.h"

int fe_isreduced(const unsigned char* s)
{
  fe f;
  unsigned char strict[32];

  fe_frombytes(f, s);
  fe_tobytes(strict, f);
  if (crypto_verify_32(strict, s) != 0)
    return 0;
  return 1;
}