comparison ecc.c @ 1459:06d52bcb8094

Pointer parameter could be declared as pointing to const
author Francois Perrad <francois.perrad@gadz.org>
date Sat, 19 Aug 2017 17:16:13 +0200
parents 750ec4ec4cbe
children b0c3b46372dc
comparison
equal deleted inserted replaced
1458:bdd3802c8ac6 1459:06d52bcb8094
80 return key; 80 return key;
81 } 81 }
82 82
83 /* Copied from libtomcrypt ecc_import.c (version there is static), modified 83 /* Copied from libtomcrypt ecc_import.c (version there is static), modified
84 for different mp_int pointer without LTC_SOURCE */ 84 for different mp_int pointer without LTC_SOURCE */
85 static int ecc_is_point(ecc_key *key) 85 static int ecc_is_point(const ecc_key *key)
86 { 86 {
87 mp_int *prime, *b, *t1, *t2; 87 mp_int *prime, *b, *t1, *t2;
88 int err; 88 int err;
89 89
90 m_mp_alloc_init_multi(&prime, &b, &t1, &t2, NULL); 90 m_mp_alloc_init_multi(&prime, &b, &t1, &t2, NULL);
211 211
212 } 212 }
213 213
214 /* a modified version of libtomcrypt's "ecc_shared_secret" to output 214 /* a modified version of libtomcrypt's "ecc_shared_secret" to output
215 a mp_int instead. */ 215 a mp_int instead. */
216 mp_int * dropbear_ecc_shared_secret(ecc_key *public_key, ecc_key *private_key) 216 mp_int * dropbear_ecc_shared_secret(ecc_key *public_key, const ecc_key *private_key)
217 { 217 {
218 ecc_point *result = NULL; 218 ecc_point *result = NULL;
219 mp_int *prime = NULL, *shared_secret = NULL; 219 mp_int *prime = NULL, *shared_secret = NULL;
220 int err = DROPBEAR_FAILURE; 220 int err = DROPBEAR_FAILURE;
221 221