X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=rsa%2Frsa_basic.h;fp=rsa%2Frsa_basic.h;h=a8a2dc8a5f417fa5f826229e1d59c357354433f7;hb=3edc70ba3f2306ec503fb5e99858d28659dcac65;hp=0000000000000000000000000000000000000000;hpb=52867acc0c7f09a79efbbb738cef0c3f5a2abb04;p=arm-crypto-lib.git diff --git a/rsa/rsa_basic.h b/rsa/rsa_basic.h new file mode 100644 index 0000000..a8a2dc8 --- /dev/null +++ b/rsa/rsa_basic.h @@ -0,0 +1,48 @@ +/* rsa_basic.h */ +/* + This file is part of the AVR-Crypto-Lib. + Copyright (C) 2011 Daniel Otte (daniel.otte@rub.de) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef RSA_BASIC_H_ +#define RSA_BASIC_H_ + +#include "bigint.h" + +typedef struct { + bigint_t* exponent; + bigint_t* modulus; +} rsa_publickey_t; + +typedef struct { + bigint_t* exponent; + bigint_t* modulus; +} rsa_privatekey_t; + + +typedef struct { + bigint_t* public_exponent; + bigint_t* private_exponent; + bigint_t* modulus; +} rsa_fullkey_t; + + +void rsa_enc(bigint_t* data, rsa_publickey_t* key); +void rsa_dec(bigint_t* data, rsa_privatekey_t* key); +void rsa_os2ip(bigint_t* dest, const void* data, uint32_t length_B); +void rsa_i2osp(void* dest, bigint_t* src, uint16_t* out_length_B); + +#endif /* RSA_BASIC_H_ */