rsa.c File Reference

RSA. More...

#include "includes.h"
#include "common.h"
#include "crypto.h"
#include "asn1.h"
#include "bignum.h"
#include "rsa.h"

Include dependency graph for rsa.c:

Go to the source code of this file.

Functions

crypto_rsa_key * crypto_rsa_import_public_key (const u8 *buf, size_t len)
 Import an RSA public key.
crypto_rsa_key * crypto_rsa_import_private_key (const u8 *buf, size_t len)
 Import an RSA private key.
size_t crypto_rsa_get_modulus_len (struct crypto_rsa_key *key)
 Get the modulus length of the RSA key.
int crypto_rsa_exptmod (const u8 *in, size_t inlen, u8 *out, size_t *outlen, struct crypto_rsa_key *key, int use_private)
 RSA modular exponentiation.
void crypto_rsa_free (struct crypto_rsa_key *key)
 Free RSA key.


Detailed Description

RSA.

Copyright
Copyright (c) 2006, Jouni Malinen <[email protected]>
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.

Alternatively, this software may be distributed under the terms of BSD license.

See README and COPYING for more details.

Definition in file rsa.c.


Function Documentation

int crypto_rsa_exptmod const u8 *  in,
size_t  inlen,
u8 *  out,
size_t *  outlen,
struct crypto_rsa_key *  key,
int  use_private
 

RSA modular exponentiation.

Parameters:
in Input data
inlen Input data length
out Buffer for output data
outlen Maximum size of the output buffer and used size on success
key RSA key
use_private 1 = Use RSA private key, 0 = Use RSA public key
Returns:
0 on success, -1 on failure

Definition at line 254 of file rsa.c.

Here is the call graph for this function:

void crypto_rsa_free struct crypto_rsa_key *  key  ) 
 

Free RSA key.

Parameters:
key RSA key to be freed
This function frees an RSA key imported with either crypto_rsa_import_public_key() or crypto_rsa_import_private_key().

Definition at line 352 of file rsa.c.

Here is the call graph for this function:

size_t crypto_rsa_get_modulus_len struct crypto_rsa_key *  key  ) 
 

Get the modulus length of the RSA key.

Parameters:
key RSA key
Returns:
Modulus length of the key

Definition at line 237 of file rsa.c.

Here is the call graph for this function:

struct crypto_rsa_key* crypto_rsa_import_private_key const u8 *  buf,
size_t  len
 

Import an RSA private key.

Parameters:
buf Key buffer (DER encoded RSA private key)
len Key buffer length in bytes
Returns:
Pointer to the private key or NULL on failure

Definition at line 136 of file rsa.c.

Here is the call graph for this function:

struct crypto_rsa_key* crypto_rsa_import_public_key const u8 *  buf,
size_t  len
 

Import an RSA public key.

Parameters:
buf Key buffer (DER encoded RSA public key)
len Key buffer length in bytes
Returns:
Pointer to the public key or NULL on failure

Definition at line 71 of file rsa.c.

Here is the call graph for this function:


Generated on Sun Dec 31 13:53:36 2006 for wpa_supplicant by  doxygen 1.4.2