2121#define PK_MAX_RETRIES 20
2222
2323int rand_prime (void * N , long len , prng_state * prng , int wprng );
24+
25+ #ifdef LTC_SOURCE
26+ /* internal helper functions */
2427int rand_bn_bits (void * N , int bits , prng_state * prng , int wprng );
2528int rand_bn_range (void * N , void * limit , prng_state * prng , int wprng );
2629
@@ -36,6 +39,7 @@ typedef struct Oid {
3639} oid_st ;
3740
3841int pk_get_oid (int pk , oid_st * st );
42+ #endif /* LTC_SOURCE */
3943
4044/* ---- RSA ---- */
4145#ifdef LTC_MRSA
@@ -183,10 +187,6 @@ int katja_import(const unsigned char *in, unsigned long inlen, katja_key *key);
183187/* ---- DH Routines ---- */
184188#ifdef LTC_MDH
185189
186- #ifndef DH_BUF_SIZE
187- #define DH_BUF_SIZE 2100
188- #endif
189-
190190typedef struct {
191191 int size ;
192192 char * name , * base , * prime ;
@@ -215,7 +215,7 @@ int dh_shared_secret(dh_key *private_key, dh_key *public_key,
215215 unsigned char * out , unsigned long * outlen );
216216
217217#ifdef LTC_SOURCE
218- /* INTERNAL ONLY - it should be later moved to src/headers/tomcrypt_internal.h */
218+ /* internal helper functions */
219219int dh_check_pubkey (dh_key * key );
220220#endif
221221
@@ -528,6 +528,9 @@ int der_decode_sequence_ex(const unsigned char *in, unsigned long inlen,
528528int der_length_sequence (ltc_asn1_list * list , unsigned long inlen ,
529529 unsigned long * outlen );
530530
531+
532+ #ifdef LTC_SOURCE
533+ /* internal helper functions */
531534/* SUBJECT PUBLIC KEY INFO */
532535int der_encode_subject_public_key_info (unsigned char * out , unsigned long * outlen ,
533536 unsigned int algorithm , void * public_key , unsigned long public_key_len ,
@@ -536,6 +539,7 @@ int der_encode_subject_public_key_info(unsigned char *out, unsigned long *outlen
536539int der_decode_subject_public_key_info (const unsigned char * in , unsigned long inlen ,
537540 unsigned int algorithm , void * public_key , unsigned long * public_key_len ,
538541 unsigned long parameters_type , ltc_asn1_list * parameters , unsigned long parameters_len );
542+ #endif /* LTC_SOURCE */
539543
540544/* SET */
541545#define der_decode_set (in , inlen , list , outlen ) der_decode_sequence_ex(in, inlen, list, outlen, 0)
@@ -613,8 +617,12 @@ int der_decode_teletex_string(const unsigned char *in, unsigned long inlen,
613617 unsigned char * out , unsigned long * outlen );
614618int der_length_teletex_string (const unsigned char * octets , unsigned long noctets , unsigned long * outlen );
615619
620+ #ifdef LTC_SOURCE
621+ /* internal helper functions */
616622int der_teletex_char_encode (int c );
617623int der_teletex_value_decode (int v );
624+ #endif /* LTC_SOURCE */
625+
618626
619627/* PRINTABLE STRING */
620628int der_encode_printable_string (const unsigned char * in , unsigned long inlen ,
@@ -646,7 +654,10 @@ int der_encode_utf8_string(const wchar_t *in, unsigned long inlen,
646654int der_decode_utf8_string (const unsigned char * in , unsigned long inlen ,
647655 wchar_t * out , unsigned long * outlen );
648656unsigned long der_utf8_charsize (const wchar_t c );
657+ #ifdef LTC_SOURCE
658+ /* internal helper functions */
649659int der_utf8_valid_char (const wchar_t c );
660+ #endif /* LTC_SOURCE */
650661int der_length_utf8_string (const wchar_t * in , unsigned long noctets , unsigned long * outlen );
651662
652663
0 commit comments