/* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /** * @file fp_FP256BN.h * @author Mike Scott * @brief FP Header File * */ #ifndef FP_FP256BN_H #define FP_FP256BN_H #include "big_256_56.h" #include "config_field_FP256BN.h" /** @brief FP Structure - quadratic extension field */ typedef struct { BIG_256_56 g; /**< Big representation of field element */ sign32 XES; /**< Excess */ } FP_FP256BN; /* Field Params - see rom.c */ extern const BIG_256_56 Modulus_FP256BN; /**< Actual Modulus set in romf_yyy.c */ extern const BIG_256_56 R2modp_FP256BN; /**< Montgomery constant */ extern const chunk MConst_FP256BN; /**< Constant associated with Modulus - for Montgomery = 1/p mod 2^BASEBITS */ #define MODBITS_FP256BN MBITS_FP256BN /**< Number of bits in Modulus for selected curve */ #define TBITS_FP256BN (MBITS_FP256BN%BASEBITS_256_56) /**< Number of active bits in top word */ #define TMASK_FP256BN (((chunk)1<