summaryrefslogtreecommitdiff
path: root/beecrypt/rsa.c
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2001-09-19 16:16:15 +0000
committerjbj <devnull@localhost>2001-09-19 16:16:15 +0000
commit02c1189d5951c70f632482fc0a674af35e9ea15d (patch)
tree5d8020b8d3fdca7f57d27097cbb6c44aa91e2c70 /beecrypt/rsa.c
parent7aea4d1e958c385d5ecd01638a3f295426ccf15c (diff)
downloadlibrpm-tizen-02c1189d5951c70f632482fc0a674af35e9ea15d.tar.gz
librpm-tizen-02c1189d5951c70f632482fc0a674af35e9ea15d.tar.bz2
librpm-tizen-02c1189d5951c70f632482fc0a674af35e9ea15d.zip
Add autogen.sh et al to build from CVS.
First pass at lclint annotations. CVS patchset: 5062 CVS date: 2001/09/19 16:16:15
Diffstat (limited to 'beecrypt/rsa.c')
-rw-r--r--beecrypt/rsa.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/beecrypt/rsa.c b/beecrypt/rsa.c
index 79320c7a3..5795bc73c 100644
--- a/beecrypt/rsa.c
+++ b/beecrypt/rsa.c
@@ -29,8 +29,12 @@
#include "mp32.h"
#if HAVE_STDLIB_H
-# include "stdlib.h"
+# include <stdlib.h>
#endif
+#if HAVE_MALLOC_H
+# include <malloc.h>
+#endif
+
int rsapri(const rsakp* kp, const mp32number* m, mp32number* c)
{
register uint32 size = kp->n.size;
@@ -48,6 +52,7 @@ int rsapri(const rsakp* kp, const mp32number* m, mp32number* c)
return -1;
}
+/*@-nullpass@*/
/* this routine doesn't work yet: needs debugging! */
int rsapricrt(const rsakp* kp, const mp32number* m, mp32number* c)
{
@@ -80,7 +85,7 @@ int rsapricrt(const rsakp* kp, const mp32number* m, mp32number* c)
mp32bpowmod_w(&kp->q, qsize, temp+psize, kp->d2.size, kp->d2.data, temp+psize, wksp);
/* compute j1-j2 */
- mp32subx(psize, temp, qsize, temp+psize);
+ (void) mp32subx(psize, temp, qsize, temp+psize);
/* compute h = c*(j1-j2) mod p */
mp32bmulmod_w(&kp->p, psize, temp, psize, kp->c.data, temp, wksp);
@@ -90,16 +95,17 @@ int rsapricrt(const rsakp* kp, const mp32number* m, mp32number* c)
/* compute s = h*q + j2 */
mp32mul(c->data, psize, temp, qsize, kp->q.modl);
- mp32addx(nsize, c->data, qsize, temp+psize);
+ (void) mp32addx(nsize, c->data, qsize, temp+psize);
free(temp);
return -1;
}
+/*@=nullpass@*/
/**
- * returns: 0 if signature verifies
- * -1 otherwise, can also indicate errors
+ * returns: 1 if signature verifies
+ * 0 otherwise, can also indicate errors
*/
int rsavrfy(const rsapk* pk, const mp32number* m, const mp32number* c)
{