Commit 8ee11d44 authored by Michael Hamburg's avatar Michael Hamburg

make SQRT_MINUS_ONE not static

parent 7e52b5b4
......@@ -80,9 +80,7 @@ mask_t gf_deserialize (gf x, const uint8_t serial[SER_BYTES],int with_highbit);
#define P_MOD_8 $(modulus % 8)
#if P_MOD_8 == 5
static const gf SQRT_MINUS_ONE = {FIELD_LITERAL( /* TODO make not static */
$(ser(msqrt(-1,modulus),gf_lit_limb_bits) if modulus % 4 == 1 else "/* NOPE */")
)};
extern const gf SQRT_MINUS_ONE;
#endif
#ifndef LIMBPERM
......
/**
* @cond internal
* @file per_field.c
* @copyright
* Copyright (c) 2015-2016 Cryptography Research, Inc. \n
* Released under the MIT License. See LICENSE.txt for license information.
* @author Mike Hamburg
* @brief Generic arithmetic which has to be compiled per field.
*/
/** @brief Generic arithmetic which has to be compiled per field. */
#include "field.h"
static const gf MODULUS = {FIELD_LITERAL(
$(ser(modulus,gf_lit_limb_bits))
)};
#if P_MOD_8 == 5
const gf SQRT_MINUS_ONE = {FIELD_LITERAL(
$(ser(msqrt(-1,modulus),gf_lit_limb_bits) if modulus % 4 == 1 else "/* NOPE */")
)};
#endif
/** Serialize to wire format. */
void gf_serialize (uint8_t serial[SER_BYTES], const gf x, int with_hibit) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment