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
@@ -211,7 +215,7 @@ int dh_shared_secret(dh_key *private_key, dh_key *public_key,
211215 unsigned char * out , unsigned long * outlen );
212216
213217#ifdef LTC_SOURCE
214- /* INTERNAL ONLY - it should be later moved to src/headers/tomcrypt_internal.h */
218+ /* internal helper functions */
215219int dh_check_pubkey (dh_key * key );
216220#endif
217221
@@ -524,6 +528,9 @@ int der_decode_sequence_ex(const unsigned char *in, unsigned long inlen,
524528int der_length_sequence (ltc_asn1_list * list , unsigned long inlen ,
525529 unsigned long * outlen );
526530
531+
532+ #ifdef LTC_SOURCE
533+ /* internal helper functions */
527534/* SUBJECT PUBLIC KEY INFO */
528535int der_encode_subject_public_key_info (unsigned char * out , unsigned long * outlen ,
529536 unsigned int algorithm , void * public_key , unsigned long public_key_len ,
@@ -532,6 +539,7 @@ int der_encode_subject_public_key_info(unsigned char *out, unsigned long *outlen
532539int der_decode_subject_public_key_info (const unsigned char * in , unsigned long inlen ,
533540 unsigned int algorithm , void * public_key , unsigned long * public_key_len ,
534541 unsigned long parameters_type , ltc_asn1_list * parameters , unsigned long parameters_len );
542+ #endif /* LTC_SOURCE */
535543
536544/* SET */
537545#define der_decode_set (in , inlen , list , outlen ) der_decode_sequence_ex(in, inlen, list, outlen, 0)
@@ -609,8 +617,12 @@ int der_decode_teletex_string(const unsigned char *in, unsigned long inlen,
609617 unsigned char * out , unsigned long * outlen );
610618int der_length_teletex_string (const unsigned char * octets , unsigned long noctets , unsigned long * outlen );
611619
620+ #ifdef LTC_SOURCE
621+ /* internal helper functions */
612622int der_teletex_char_encode (int c );
613623int der_teletex_value_decode (int v );
624+ #endif /* LTC_SOURCE */
625+
614626
615627/* PRINTABLE STRING */
616628int der_encode_printable_string (const unsigned char * in , unsigned long inlen ,
@@ -642,7 +654,10 @@ int der_encode_utf8_string(const wchar_t *in, unsigned long inlen,
642654int der_decode_utf8_string (const unsigned char * in , unsigned long inlen ,
643655 wchar_t * out , unsigned long * outlen );
644656unsigned long der_utf8_charsize (const wchar_t c );
657+ #ifdef LTC_SOURCE
658+ /* internal helper functions */
645659int der_utf8_valid_char (const wchar_t c );
660+ #endif /* LTC_SOURCE */
646661int der_length_utf8_string (const wchar_t * in , unsigned long noctets , unsigned long * outlen );
647662
648663
0 commit comments