SASC-NG
DVBSoftCAM

cRSA Class Reference

#include <crypto.h>

List of all members.

Public Member Functions

int RSA (unsigned char *out, const unsigned char *in, int n, const BIGNUM *exp, const BIGNUM *mod, bool LE=true) const
int RSA (BIGNUM *out, const unsigned char *in, int n, const BIGNUM *exp, const BIGNUM *mod, bool LE=true) const
int RSA (unsigned char *out, int len, BIGNUM *in, const BIGNUM *exp, const BIGNUM *mod, bool LE=true) const

Detailed Description

Definition at line 128 of file crypto.h.


Member Function Documentation

int cRSA::RSA ( unsigned char *  out,
const unsigned char *  in,
int  n,
const BIGNUM *  exp,
const BIGNUM *  mod,
bool  LE = true 
) const
int cRSA::RSA ( unsigned char *  out,
int  len,
BIGNUM *  in,
const BIGNUM *  exp,
const BIGNUM *  mod,
bool  LE = true 
) const

Definition at line 199 of file crypto.c.

References L_GEN_ERROR, and PRINTF.

{
  cBNctx ctx;
  cBN r;
  if(BN_mod_exp(r,in,exp,mod,ctx)) return Output(out,n,&r,LE);
  PRINTF(L_GEN_ERROR,"rsa: mod-exp failed");
  return 0;
}
int cRSA::RSA ( BIGNUM *  out,
const unsigned char *  in,
int  n,
const BIGNUM *  exp,
const BIGNUM *  mod,
bool  LE = true 
) const

Definition at line 188 of file crypto.c.

References L_GEN_ERROR, and PRINTF.

{
  cBNctx ctx;
  cBN d;
  if(Input(&d,in,n,LE)) {
    if(BN_mod_exp(out,d,exp,mod,ctx)) return BN_num_bytes(out);
    PRINTF(L_GEN_ERROR,"rsa: mod-exp failed");
    }
  return 0;
}

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines