Program Listing for File RSA.h
↰ Return to documentation for file (ADS/numeric/RSA.h)
/*--------------------------------------------------------------------------*/
/*------------------------------- File RSA.h -------------------------------*/
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
/*----------------------------- DEFINITIONS --------------------------------*/
/*--------------------------------------------------------------------------*/
#ifndef __ADS_RSA
#define __ADS_RSA
/* self-identification: #endif constant */
/*--------------------------------------------------------------------------*/
/*------------------------------ INCLUDES ----------------------------------*/
/*--------------------------------------------------------------------------*/
#include "ADS/Contract.h"
#include "ADS/numeric/NumberTheory.h"
#include <cstdint>
#include <random>
#include <utility>
/*--------------------------------------------------------------------------*/
/*--------------------------- NAMESPACE ------------------------------------*/
/*--------------------------------------------------------------------------*/
namespace ADS {
struct RsaKey {
U64 N , e;
};
template< class R >
U64 randomPrime( int bits , R & rng );
template< class R >
std::pair< RsaKey , RsaKey > rsaKeys( R & rng );
inline U64 rsa( U64 M , const RsaKey & k );
/*--------------------------------------------------------------------------*/
} // end( namespace ADS )
/*--------------------------------------------------------------------------*/
/*-------------------------- IMPLEMENTATION --------------------------------*/
/*--------------------------------------------------------------------------*/
#include "ADS/numeric/impl/RSA.tpp"
/*--------------------------------------------------------------------------*/
#endif /* RSA.h included */
/*--------------------------------------------------------------------------*/
/*----------------------------- End File RSA.h -----------------------------*/
/*--------------------------------------------------------------------------*/