diff options
Diffstat (limited to 'Middlewares/ST/STM32_WPAN/ble/cryptographic/Inc/Common_ecc_rsa/MATH/BN/bn.h')
-rw-r--r-- | Middlewares/ST/STM32_WPAN/ble/cryptographic/Inc/Common_ecc_rsa/MATH/BN/bn.h | 110 |
1 files changed, 0 insertions, 110 deletions
diff --git a/Middlewares/ST/STM32_WPAN/ble/cryptographic/Inc/Common_ecc_rsa/MATH/BN/bn.h b/Middlewares/ST/STM32_WPAN/ble/cryptographic/Inc/Common_ecc_rsa/MATH/BN/bn.h deleted file mode 100644 index 45cd53d29..000000000 --- a/Middlewares/ST/STM32_WPAN/ble/cryptographic/Inc/Common_ecc_rsa/MATH/BN/bn.h +++ /dev/null @@ -1,110 +0,0 @@ -/** - ****************************************************************************** - * @file bn.h - * @author MCD Application Team - * @brief Basic Functions for Big Numbers (Multi Precision Integers) - ****************************************************************************** - * @attention - * - * <h2><center>© Copyright (c) 2015 STMicroelectronics. - * All rights reserved.</center></h2> - * - * This software component is licensed by ST under Image license SLA0044, - * 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.st.com/SLA0044 - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __CRL_BN_H__ -#define __CRL_BN_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - /** @ingroup BN - * @{ - */ - - /* Exported types ------------------------------------------------------------*/ - /** - * @brief Structure used to store a BigNum_stt * integer. - */ - typedef struct - { - uint32_t *pmDigit; /*!< Used to represent the BigNum_stt * integer value; pmDigit[0] = least significant word. */ - uint16_t mNumDigits; /*!< Number of significant words of the vector pmDigit used to represent the actual value. */ - uint8_t mSize; /*!< Number of words allocated for the integer */ - int8_t mSignFlag; /*!< Is the integer mSignFlag: SIGN_POSITIVE positive, SIGN_NEGATIVE negative. */ - } - BigNum_stt; - - /* Exported constants --------------------------------------------------------*/ - -#define NBIT_DIGIT 32u /*!< Bit Size of a BigNum digit (should equal to CPU word size, works for 32). */ -#define MSBIT_MASK 0x80000000u /*!< Mask for the most significant bit in a digit */ -#define MSBYTE_MASK 0xFF000000u /*!< Mask for the most significant byte in a digit */ -#define LSBIT_MASK 0x00000001u /*!< Mask for the least significant bit in a digit */ -#define MAX_DIGIT_VALUE 0xFFFFFFFFu /*!< Mask for all bit to 1 in a word */ -#define SIGN_POSITIVE 0 /*!< Used to denote a positive Big Number. */ -#define SIGN_NEGATIVE 1 /*!< Used to denote a negative Big Number. */ - - /* Exported functions ------------------------------------------------------- */ - /* Big Number Operations ******************************************************/ - - /* Alloc big *****************************************************************/ - int32_t StAllocBig(BigNum_stt **P_ppBignum, \ - int32_t P_wordSize, \ - membuf_stt *P_pMembuf); - - /* StFree big ****************************************************************/ - void StFreeBig (BigNum_stt **P_pBignum, \ - membuf_stt *P_pMembuf); - - /* x = initial_value. Sets the words x->pmDigit[1]_ _ _x->pmDigit[MAX_LEN_BIG-1] to 0. */ - void InitBig (BigNum_stt * P_pBN, \ - int32_t P_initialValue); - - /* y=x. ***********************************************************************/ - int32_t CopyBig (const BigNum_stt *P_pInputBN, \ - BigNum_stt *P_pOutputBN); - - /* Returns 1 if x==0, 0 otherwise. ********************************************/ - int32_t IsZeroBig (const BigNum_stt *P_pInputBN); - - /* x=0. ***********************************************************************/ - void SetZeroBig (BigNum_stt * P_pInputBN); - - /* Returns 1 if x>=0, returns 0 if x<0. ***************************************/ - int32_t SignBig (const BigNum_stt *P_pInputBN); - - int32_t EvenBig (const BigNum_stt *P_pBN); - - /* Compares two BigNum_stt * integer. *****************************************/ - int32_t CompareBig(const BigNum_stt *P_pInput1BN, \ - const BigNum_stt *P_pInput2BN); - - /* If x==0 returns 1. ********************************************************/ - int32_t CountBits (const BigNum_stt *P_pInputBN); - - int32_t CountBytes(const BigNum_stt * P_pInputBN); - - /* Returns the value of the pos-th bit of x. **********************************/ - uint16_t GiveBit (const BigNum_stt *P_pBN, \ - uint32_t P_pos); - - /** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif /*__CRL_BN_H__*/ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |