make internal XS/C function static
Karel Miko
2 years ago
161 | 161 | int initialized; |
162 | 162 | } *Crypt__PK__X25519; |
163 | 163 | |
164 | int cryptx_internal_mp2hex_with_leading_zero(mp_int * a, char *str, int maxlen, int minlen) { | |
164 | STATIC int cryptx_internal_mp2hex_with_leading_zero(mp_int * a, char *str, int maxlen, int minlen) { | |
165 | 165 | int len, rv; |
166 | 166 | |
167 | 167 | if (mp_isneg(a) == MP_YES) { |
190 | 190 | return MP_OKAY; |
191 | 191 | } |
192 | 192 | |
193 | size_t cryptx_internal_find_start(const char *name, char *ltcname, size_t ltclen) | |
193 | STATIC size_t cryptx_internal_find_start(const char *name, char *ltcname, size_t ltclen) | |
194 | 194 | { |
195 | 195 | size_t i, start = 0; |
196 | 196 | if (name == NULL || strlen(name) + 1 > ltclen) croak("FATAL: invalid name") ; |
210 | 210 | return start; |
211 | 211 | } |
212 | 212 | |
213 | int cryptx_internal_find_hash(const char *name) | |
213 | STATIC int cryptx_internal_find_hash(const char *name) | |
214 | 214 | { |
215 | 215 | char ltcname[100] = { 0 }; |
216 | 216 | size_t start = cryptx_internal_find_start(name, ltcname, sizeof(ltcname) - 1); |
225 | 225 | return find_hash(ltcname + start); |
226 | 226 | } |
227 | 227 | |
228 | int cryptx_internal_find_cipher(const char *name) | |
228 | STATIC int cryptx_internal_find_cipher(const char *name) | |
229 | 229 | { |
230 | 230 | char ltcname[100] = { 0 }; |
231 | 231 | size_t start = cryptx_internal_find_start(name, ltcname, sizeof(ltcname) - 1); |
235 | 235 | return find_cipher(ltcname + start); |
236 | 236 | } |
237 | 237 | |
238 | int cryptx_internal_find_prng(const char *name) | |
238 | STATIC int cryptx_internal_find_prng(const char *name) | |
239 | 239 | { |
240 | 240 | char ltcname[100] = { 0 }; |
241 | 241 | size_t start = cryptx_internal_find_start(name, ltcname, sizeof(ltcname) - 1); |
251 | 251 | return obj; |
252 | 252 | } |
253 | 253 | |
254 | void cryptx_internal_ecc_oid_lookup(ecc_key *key) | |
254 | STATIC void cryptx_internal_ecc_oid_lookup(ecc_key *key) | |
255 | 255 | { |
256 | 256 | int err; |
257 | 257 | unsigned i, j; |
294 | 294 | } |
295 | 295 | } |
296 | 296 | |
297 | int cryptx_internal_ecc_set_curve_from_SV(ecc_key *key, SV *curve) | |
297 | STATIC int cryptx_internal_ecc_set_curve_from_SV(ecc_key *key, SV *curve) | |
298 | 298 | { |
299 | 299 | dTHX; /* fetch context */ |
300 | 300 | HV *hc, *h; |