⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mint.h

📁 网络中交换节点的上数据的交换和下行数据分发的硬件实现
💻 H
字号:
// MInt.h: interface for the MInt class.
#ifndef _MINT_H_
#define _MINT_H_ 1


#include"stdio.h"
#include"stdlib.h"
//#include"memory.h"
//#include"time.h"
//#include <process.h>


#define MINTLENGTH    256
typedef unsigned int DWord;
typedef unsigned int dword;
#define MAX_CMP_WORD         (DWord)0xffffffff

typedef struct {
	int length ;
	DWord value[MINTLENGTH];
} MInt;

#define POSITIVE 0x00000000
#define NEGATIVE 0x1

#define MI_BITS_PER_BYTE    8
#define MI_BYTES_PER_WORD   (sizeof (DWord))
#define MI_WORD_SIZE        (sizeof (DWord) * MI_BITS_PER_BYTE)
#define MI_NEGATIVE     2



#define MI_WordToMInt(srcWord,destInt){	if(srcWord==0)	(destInt)->length=0;	else	(destInt)->length=1;(destInt)->value[0]=srcWord;}

////////////////////////////////////////////////////
/*
int MI_Move (MInt *, MInt *);
int MI_Compare (MInt *, MInt *);
int MI_AddDWord (DWord, MInt *);
int MI_SubtractDWord (DWord, MInt *);
int MI_Add (MInt *, MInt *, MInt *);
int MI_Subtract (MInt *, MInt *, MInt *);
int MI_Multiply (MInt *, MInt *, MInt *);

int MI_Divide (MInt *, MInt *, MInt *, MInt *);
int MI_ModularReduce (MInt *, MInt *, MInt *);

int MI_RecomputeLength (int, MInt *);
*/
//==========================================
#define FP_IsZero(ptr) (((((ptr)->length == 1) && ((ptr)->value[0] == 0)))|| ((ptr)->length==0))
#define FP_Equal(operand1, operand2) (! MI_Compare (operand1, operand2))
/*
int FP_Add(MInt *a,MInt *b,MInt *p,MInt *sum);
int FP_AddDWord (DWord k, MInt *prime,MInt *theInt);
int FP_Substract(MInt *a,MInt *b,MInt *p,MInt *dif);
int FP_SubtractDWord (DWord k,MInt *prime,MInt *theInt);

int FP_Mul(MInt *a,MInt *b,MInt *p,MInt *product);  //for length<=6;

int FP_Invert(MInt *a,MInt *p,MInt *Inverse);
int FP_Div(MInt *op1,MInt *op2,MInt *prime,MInt *result);
*/


//==========================================

//int Generate_N0_A(MInt *N,MInt *A,dword *N0);

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -