Lines Matching defs:ctx
19 static int evp_encodeblock_int(EVP_ENCODE_CTX *ctx, unsigned char *t,
21 static int evp_decodeblock_int(EVP_ENCODE_CTX *ctx, unsigned char *t,
132 void EVP_ENCODE_CTX_free(EVP_ENCODE_CTX *ctx)
134 OPENSSL_free(ctx);
144 int EVP_ENCODE_CTX_num(EVP_ENCODE_CTX *ctx)
146 return ctx->num;
149 void evp_encode_ctx_set_flags(EVP_ENCODE_CTX *ctx, unsigned int flags)
151 ctx->flags = flags;
154 void EVP_EncodeInit(EVP_ENCODE_CTX *ctx)
156 ctx->length = 48;
157 ctx->num = 0;
158 ctx->line_num = 0;
159 ctx->flags = 0;
162 int EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
171 OPENSSL_assert(ctx->length <= (int)sizeof(ctx->enc_data));
172 if (ctx->length - ctx->num > inl) {
173 memcpy(&(ctx->enc_data[ctx->num]), in, inl);
174 ctx->num += inl;
177 if (ctx->num != 0) {
178 i = ctx->length - ctx->num;
179 memcpy(&(ctx->enc_data[ctx->num]), in, i);
182 j = evp_encodeblock_int(ctx, out, ctx->enc_data, ctx->length);
183 ctx->num = 0;
186 if ((ctx->flags & EVP_ENCODE_CTX_NO_NEWLINES) == 0) {
192 while (inl >= ctx->length && total <= INT_MAX) {
193 j = evp_encodeblock_int(ctx, out, in, ctx->length);
194 in += ctx->length;
195 inl -= ctx->length;
198 if ((ctx->flags & EVP_ENCODE_CTX_NO_NEWLINES) == 0) {
210 memcpy(&(ctx->enc_data[0]), in, inl);
211 ctx->num = inl;
217 void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl)
221 if (ctx->num != 0) {
222 ret = evp_encodeblock_int(ctx, out, ctx->enc_data, ctx->num);
223 if ((ctx->flags & EVP_ENCODE_CTX_NO_NEWLINES) == 0)
226 ctx->num = 0;
231 static int evp_encodeblock_int(EVP_ENCODE_CTX *ctx, unsigned char *t,
238 if (ctx != NULL && (ctx->flags & EVP_ENCODE_CTX_USE_SRP_ALPHABET) != 0)
274 void EVP_DecodeInit(EVP_ENCODE_CTX *ctx)
276 /* Only ctx->num and ctx->flags are used during decoding. */
277 ctx->num = 0;
278 ctx->length = 0;
279 ctx->line_num = 0;
280 ctx->flags = 0;
303 int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
310 n = ctx->num;
311 d = ctx->enc_data;
325 if ((ctx->flags & EVP_ENCODE_CTX_USE_SRP_ALPHABET) != 0)
362 * manually messed with the ctx. Refuse to write any more data.
367 OPENSSL_assert(n < (int)sizeof(ctx->enc_data));
372 decoded_len = evp_decodeblock_int(ctx, out, d, n);
391 decoded_len = evp_decodeblock_int(ctx, out, d, n);
409 ctx->num = n;
413 static int evp_decodeblock_int(EVP_ENCODE_CTX *ctx, unsigned char *t,
420 if (ctx != NULL && (ctx->flags & EVP_ENCODE_CTX_USE_SRP_ALPHABET) != 0)
464 int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl)
469 if (ctx->num != 0) {
470 i = evp_decodeblock_int(ctx, out, ctx->enc_data, ctx->num);
473 ctx->num = 0;