- else if(!EVP_EncryptInit_ex(&ctx,c,NULL,key,iv))
+ else if (mode == EVP_CIPH_WRAP_MODE)
+ {
+ if(!EVP_EncryptInit_ex(ctx,c,NULL,key,in ? iv : NULL))
+ {
+ fprintf(stderr,"EncryptInit failed\n");
+ ERR_print_errors_fp(stderr);
+ test1_exit(10);
+ }
+ }
+ else if(!EVP_EncryptInit_ex(ctx,c,NULL,key,iv))