Main Page Modules Data Structures File List Data Fields Globals Related Pages

# beecrypt/rsa.c File Reference

RSA Encryption & signature scheme, code. More...

`#include "system.h"`
`#include "rsa.h"`
`#include "mp32.h"`
`#include "debug.h"`

Go to the source code of this file.

## Functions

int | rsapri (const rsakp *kp, const mp32number *m, mp32number *c)
int | rsapricrt (const rsakp *kp, const mp32number *m, mp32number *c)
int | rsavrfy (const rsapk *pk, const mp32number *m, const mp32number *c)

## Detailed Description

RSA Encryption & signature scheme, code.

Definition in file rsa.c.

## Function Documentation

int rsapri | ( | const rsakp * | kp,
|  | const mp32number * | m,
|  | mp32number * | c
| ) |

| Definition at line 33 of file rsa.c. References rsakp::d, mp32number::data, mp32bpowmod_w, mp32nsize, rsakp::n, mp32number::size, mp32barrett::size, and uint32.

int rsapricrt | ( | const rsakp * | kp,
|  | const mp32number * | m,
|  | mp32number * | c
| ) |

| Definition at line 51 of file rsa.c. References rsakp::c, rsakp::d1, rsakp::d2, mp32number::data, mp32barrett::modl, mp32addx, mp32bmulmod_w, mp32bpowmod_w, mp32bsubmod_w, mp32mul, mp32nsize, mp32setx, rsakp::n, rsakp::p, rsakp::q, mp32number::size, mp32barrett::size, and uint32.

int rsavrfy | ( | const rsapk * | pk,
|  | const mp32number * | m,
|  | const mp32number * | c
| ) |

Returns:
  1 if signature verifies, 0 otherwise (can also indicate errors)

Definition at line 111 of file rsa.c.

References mp32number::data, rsapk::e, mp32bpowmod_w, mp32eqx, rsapk::n, mp32number::size, mp32barrett::size, and uint32.