rsa.h

来自「椭圆曲线密码C实现的」· C头文件 代码 · 共 32 行

H
32
字号
// RSA public key encryption

#include "vlong.h"

class prime_factory
{
  unsigned np;
  unsigned *pl;
public:
  prime_factory();
  ~prime_factory();
  vlong find_prime( vlong & start );
};

class public_key
{
  public:
  vlong m,e;
  vlong encrypt( const vlong& plain ); // Requires 0 <= plain < m
};

class private_key : public public_key
{
  public:
  vlong p,q;
  vlong decrypt( const vlong& cipher );

  void create( const char * r1, const char * r2 );
  // r1 and r2 should be null terminated random strings
  // each of length around 35 characters (for a 500 bit modulus)
};

⌨️ 快捷键说明

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