summaryrefslogtreecommitdiffstats
path: root/libtommath/bn_mp_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'libtommath/bn_mp_init.c')
-rw-r--r--libtommath/bn_mp_init.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/libtommath/bn_mp_init.c b/libtommath/bn_mp_init.c
index 8be27f5..9f2d866 100644
--- a/libtommath/bn_mp_init.c
+++ b/libtommath/bn_mp_init.c
@@ -16,28 +16,28 @@
*/
/* init a new mp_int */
-int mp_init (mp_int * a)
+int mp_init(mp_int * a)
{
- int i;
+ int i;
- /* allocate memory required and clear it */
- a->dp = OPT_CAST(mp_digit) XMALLOC (sizeof (mp_digit) * MP_PREC);
- if (a->dp == NULL) {
- return MP_MEM;
- }
+ /* allocate memory required and clear it */
+ a->dp = OPT_CAST(mp_digit) XMALLOC(sizeof(mp_digit) * MP_PREC);
+ if (a->dp == NULL) {
+ return MP_MEM;
+ }
- /* set the digits to zero */
- for (i = 0; i < MP_PREC; i++) {
- a->dp[i] = 0;
- }
+ /* set the digits to zero */
+ for (i = 0; i < MP_PREC; i++) {
+ a->dp[i] = 0;
+ }
- /* set the used to zero, allocated digits to the default precision
- * and sign to positive */
- a->used = 0;
- a->alloc = MP_PREC;
- a->sign = MP_ZPOS;
+ /* set the used to zero, allocated digits to the default precision
+ * and sign to positive */
+ a->used = 0;
+ a->alloc = MP_PREC;
+ a->sign = MP_ZPOS;
- return MP_OKAY;
+ return MP_OKAY;
}
#endif