aboutsummaryrefslogtreecommitdiff
path: root/rsa.c
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2015-09-06 13:46:41 -0400
committerRob Austein <sra@hactrn.net>2015-09-06 13:46:41 -0400
commit12fd92723d71325b74a6c94eee4ca504773ad9da (patch)
tree9babd4f2fe503493be80ca1ec477cbe208bad952 /rsa.c
parent89cf9108af7ec93471f76510663ca1218133c6a2 (diff)
Add ECPoint I/O functions. ASN.1 cleanup.
Diffstat (limited to 'rsa.c')
-rw-r--r--rsa.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/rsa.c b/rsa.c
index 8ac2d50..b863fdd 100644
--- a/rsa.c
+++ b/rsa.c
@@ -9,7 +9,7 @@
* (but no simpler).
*
* Much of the code in this module is based, at least loosely, on Tom
- * St Denis's libtomcrypt code.
+ * St Denis's libtomcrypt code.
*
* Authors: Rob Austein
* Copyright (c) 2015, SUNET
@@ -394,7 +394,7 @@ hal_error_t hal_rsa_decrypt(const hal_rsa_key_t * const key,
err = modexp(&i, &key->d, &key->n, &o);
else
err = rsa_crt(key, &i, &o);
-
+
if (err != HAL_OK || (err = unpack_fp(&o, output, output_len)) != HAL_OK)
goto fail;
@@ -549,7 +549,7 @@ hal_error_t hal_rsa_key_get_public_exponent(const hal_rsa_key_t * const key,
/*
* Generate a prime factor for an RSA keypair.
- *
+ *
* Get random bytes, munge a few bits, and stuff into a bignum. Keep
* doing this until we find a result that's (probably) prime and for
* which result - 1 is relatively prime with respect to e.
@@ -695,7 +695,7 @@ hal_error_t hal_rsa_key_to_der(const hal_rsa_key_t * const key,
*/
der += hlen;
-
+
#define _(x) { size_t i; if ((err = hal_asn1_encode_integer(x, der, &i, vlen)) != HAL_OK) return err; der += i; vlen -= i; }
RSAPrivateKey_fields;
#undef _