28 #if defined(POLARSSL_PK_C)
33 #if defined(POLARSSL_RSA_C)
36 #if defined(POLARSSL_ECP_C)
39 #if defined(POLARSSL_ECDSA_C)
60 if( ctx == NULL || ctx->
pk_info == NULL)
75 #if defined(POLARSSL_RSA_C)
79 #if defined(POLARSSL_ECP_C)
85 #if defined(POLARSSL_ECDSA_C)
100 if( ctx == NULL || info == NULL || ctx->
pk_info != NULL )
122 if( ctx == NULL || ctx->
pk_info != NULL )
146 if( ctx == NULL || ctx->
pk_info == NULL )
155 static inline int pk_hashlen_helper(
md_type_t md_alg,
size_t *hash_len )
165 *hash_len = md_info->
size;
173 const unsigned char *hash,
size_t hash_len,
174 const unsigned char *sig,
size_t sig_len )
176 if( ctx == NULL || ctx->
pk_info == NULL ||
177 pk_hashlen_helper( md_alg, &hash_len ) != 0 )
191 const unsigned char *hash,
size_t hash_len,
192 unsigned char *sig,
size_t *sig_len,
193 int (*f_rng)(
void *,
unsigned char *,
size_t),
void *p_rng )
195 if( ctx == NULL || ctx->
pk_info == NULL ||
196 pk_hashlen_helper( md_alg, &hash_len ) != 0 )
203 sig, sig_len, f_rng, p_rng ) );
210 const unsigned char *input,
size_t ilen,
211 unsigned char *output,
size_t *olen,
size_t osize,
212 int (*f_rng)(
void *,
unsigned char *,
size_t),
void *p_rng )
214 if( ctx == NULL || ctx->
pk_info == NULL )
221 output, olen, osize, f_rng, p_rng ) );
228 const unsigned char *input,
size_t ilen,
229 unsigned char *output,
size_t *olen,
size_t osize,
230 int (*f_rng)(
void *,
unsigned char *,
size_t),
void *p_rng )
232 if( ctx == NULL || ctx->
pk_info == NULL )
239 output, olen, osize, f_rng, p_rng ) );
247 if( ctx == NULL || ctx->
pk_info == NULL )
258 if( ctx == NULL || ctx->
pk_info == NULL )
270 if( ctx == NULL || ctx->
pk_info == NULL )
271 return(
"invalid PK" );
281 if( ctx == NULL || ctx->
pk_info == NULL )