summaryrefslogtreecommitdiffhomepage
path: root/gendss.c
diff options
context:
space:
mode:
authorFrancois Perrad <francois.perrad@gadz.org>2017-08-19 17:16:13 +0200
committerFrancois Perrad <francois.perrad@gadz.org>2017-08-19 17:16:13 +0200
commit89e64c631ec8dee41ec4de888548d36887b6ec98 (patch)
tree91fc3aee54e9b9cac7ec893ddf91cb944e3fc220 /gendss.c
parent468656b4aab5bc0040e3ecbfd7f66f52a15da76d (diff)
Pointer parameter could be declared as pointing to const
Diffstat (limited to 'gendss.c')
-rw-r--r--gendss.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/gendss.c b/gendss.c
index 2b342a6..9fb500b 100644
--- a/gendss.c
+++ b/gendss.c
@@ -37,11 +37,11 @@
#if DROPBEAR_DSS
-static void getq(dropbear_dss_key *key);
-static void getp(dropbear_dss_key *key, unsigned int size);
-static void getg(dropbear_dss_key *key);
-static void getx(dropbear_dss_key *key);
-static void gety(dropbear_dss_key *key);
+static void getq(const dropbear_dss_key *key);
+static void getp(const dropbear_dss_key *key, unsigned int size);
+static void getg(const dropbear_dss_key *key);
+static void getx(const dropbear_dss_key *key);
+static void gety(const dropbear_dss_key *key);
dropbear_dss_key * gen_dss_priv_key(unsigned int size) {
@@ -65,7 +65,7 @@ dropbear_dss_key * gen_dss_priv_key(unsigned int size) {
}
-static void getq(dropbear_dss_key *key) {
+static void getq(const dropbear_dss_key *key) {
unsigned char buf[QSIZE];
@@ -83,7 +83,7 @@ static void getq(dropbear_dss_key *key) {
}
}
-static void getp(dropbear_dss_key *key, unsigned int size) {
+static void getp(const dropbear_dss_key *key, unsigned int size) {
DEF_MP_INT(tempX);
DEF_MP_INT(tempC);
@@ -142,7 +142,7 @@ static void getp(dropbear_dss_key *key, unsigned int size) {
m_free(buf);
}
-static void getg(dropbear_dss_key * key) {
+static void getg(const dropbear_dss_key * key) {
DEF_MP_INT(div);
DEF_MP_INT(h);
@@ -179,12 +179,12 @@ static void getg(dropbear_dss_key * key) {
mp_clear_multi(&div, &h, &val, NULL);
}
-static void getx(dropbear_dss_key *key) {
+static void getx(const dropbear_dss_key *key) {
gen_random_mpint(key->q, key->x);
}
-static void gety(dropbear_dss_key *key) {
+static void gety(const dropbear_dss_key *key) {
if (mp_exptmod(key->g, key->x, key->p, key->y) != MP_OKAY) {
fprintf(stderr, "DSS key generation failed\n");