📄 rsa.h
字号:
/*------------------------------------------------------------------------------------------------ Software implementation of RSA using Montgomery Multiplication------------------------------------------------------------------------------------------------*//*------------------------------------------------------------------------------------------------ Authors: Guido Bertoni,Luigi Sportiello STMicroelectronics AST - Crypto Group Date: 13/7/2005 Date: 14/7/2005 Guido Bertoni, improvement in Montgomery main part of multiplication is now done using 64 bit integer Date: 01/8/2005 Luigi Sportiello, updated all the code according to the new key structures added functions to initialize key structures added functions to free memory allocated for the keys added some useful constants, renamed the functions, code cleaning Date: 02/8/2005 Luigi Sportiello, fixed up a possible bug added modular exponentiation with windows of 2 bits and 4 bits Date: 04/8/2005 Luigi Sportiello, added decryption with CRT, decryption with CRT and windows of 2 bits and 4 bits Date: 30/8/2005 Luigi Sportiello, fixed a bug in exponentiation with windows Date: 04/4/2006 Luigi Sportiello, added a check on input in RSAEP,RSASV1,RSADP,RSASP1 (Change1) Date: 23/6/2006 Luigi Sportiello, rearranged the code to avoid duplications------------------------------------------------------------------------------------------------*/#ifndef __CRL_RSA_H__#define __CRL_RSA_H__//---------**- Types definition -**---------------------------------------------------------------#define CRL_W8 unsigned char //CRL_W8 will be a variable of 8 bits#define CRL_W32 unsigned long //CRL_W32 will be a variable of 32 bits//Used to store RSA private keytypedef struct{ int modulus_size; //Number of bytes of the module CRL_W8 *modulus; //Module 'n' int publicExponent_size; //Number of bytes of the public exponent CRL_W8 *publicExponent; //Public exponent 'e' int privateExponent_size; //Number of bytes of the private exponent CRL_W8 *privateExponent; //Private exp 慸
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -