/* * Copyright (c) 2012-2020 MIRACL UK Ltd. * * This file is part of MIRACL Core * (see https://github.com/miracl/core). * * Licensed 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 ecdh.h * @author Mike Scott and Kealan McCusker * @date 2nd June 2015 * @brief ECDH Header file for implementation of standard EC protocols * * declares functions * */ #ifndef ECDH_ANSSI_H #define ECDH_ANSSI_H #include "ecp_ANSSI.h" //#include "ecdh_support.h" using namespace core; /*** START OF USER CONFIGURABLE SECTION - ***/ /*** START OF USER CONFIGURABLE SECTION - ***/ /*** END OF USER CONFIGURABLE SECTION ***/ #define EGS_ANSSI MODBYTES_B256_28 /**< ECC Group Size in bytes */ #define EFS_ANSSI MODBYTES_B256_28 /**< ECC Field Size in bytes */ #define ECDH_OK 0 /**< Function completed without error */ /*#define ECDH_DOMAIN_ERROR -1*/ #define ECDH_INVALID_PUBLIC_KEY -2 /**< Public Key is Invalid */ #define ECDH_ERROR -3 /**< ECDH Internal Error */ //#define ECDH_INVALID -4 /**< ECDH Internal Error */ /*#define ECDH_DOMAIN_NOT_FOUND -5 #define ECDH_OUT_OF_MEMORY -6 #define ECDH_DIV_BY_ZERO -7 #define ECDH_BAD_ASSUMPTION -8*/ namespace ANSSI { /** @brief Test if group element in correct range * @param s is a random number @return 1 if 0