linux/crypto/deflate.c
<<
"v3.v3./spa. > v3./form > v3.a "v3.v3 href="../linux+v3.8.3/crypto/deflate.c">"v3.v3.img src="../.static/gfx/right.png" alt=">>">"v./spa. >"v.spa. class="lxr_search">"v3."v3.v3.input typon>hidden" namon>navtarget" option>">"v3.v3.input typon>text" namon>search" idn>search">"v3.v3.butt5submit">Search v3./form > ./spa. >"v.spa. class="lxr_prefs" > v3.a href="+prefs?return=crypto/deflate.c""v3.v3 onclick="return ajax_prefs();">"v3.v3Prefs> v3./a>"v./spa. >3.v3 3./div >3.v3 3.form ac4.1.="ajax+*" method="post" onsubmit="return false;">"v.input typon>hidden" namon>ajax_lookup" idn>ajax_lookup" option>">"3.v3 3./form >"3.v3 3.div class="headingbott5m">
3.v3
3.v3 v3 3.div idn>search_results" class="search_results"> v >3.v3 3./div > .div idn>content">> .div idn>file_contents"
b0/fb/1b350e90a50cb6f4baa2098c0bb1710380a9_3/0" L1" class="line" namon>L1">3 31./a>.spa. class="comment">/*./spa. >L2" class="line" namon>L2">3 32./a>.spa. class="comment"> * Cryptographic API../spa. >L3" class="line" namon>L3">3 33./a>.spa. class="comment"> *./spa. >L4" class="line" namon>L4">3 34./a>.spa. class="comment"> * Deflate algorithm (RFC 1951), implemented here primarily for use./spa. >L5" class="line" namon>L5">3 35./a>.spa. class="comment"> * by IPCOMP (RFC 3173 & RFC 2394)../spa. >L6" class="line" namon>L6">3 36./a>.spa. class="comment"> *./spa. >L7" class="line" namon>L7">3 37./a>.spa. class="comment"> * Copyright (c) 2003 Jamos Morris <jmorris@intercode.com.au>./spa. >L8" class="line" namon>L8">3 38./a>.spa. class="comment"> *./spa. >L9" class="line" namon>L9">3 39./a>.spa. class="comment"> * This program is free software; you ca. redistribute it and/or modify it./spa. >L10" class="line" namon>L10">3 lue=a>.spa. class="comment"> * under the terms of the GNU General Public License as published by the Free./spa. >L11" class="line" namon>L11">3 11./a>.spa. class="comment"> * Software Founda4.1.; either vers15L12" class="line" namon>L12">3 12./a>.spa. class="comment"> * any later vers15<../spa. >L13" class="line" namon>L13">3 13./a>.spa. class="comment"> *./spa. >L14" class="line" namon>L14">3 14./a>.spa. class="comment"> * FIXME: deflate transforms will require up to a total of about 436k of kernel./spa. >L15" class="line" namon>L15">3 15./a>.spa. class="comment"> * memory on i386 (390k for compress15<, the rest for decompress15<), as the./spa. >L16" class="line" namon>L16">3 16./a>.spa. class="comment"> * current zlib kernel code uses a worst case pre-alloca4.1. system by default../spa. >L17" class="line" namon>L17">3 17./a>.spa. class="comment"> * This needs to be fixed so that the amount of memory required is properly./spa. >L18" class="line" namon>L18">3 18./a>.spa. class="comment"> * related to the  winbits and memlevel parameters../spa. >L19" class="line" namon>L19">3 19./a>.spa. class="comment"> *./spa. >L20" class="line" namon>L20">3 2ue=a>.spa. class="comment"> * The default winbits of 11 should suit most packets, and it may be something./spa. >L21" class="line" namon>L21">3 21./a>.spa. class="comment"> * to configure 1. a per-tfm basis in the future../spa. >L22" class="line" namon>L22">3 22./a>.spa. class="comment"> *./spa. >L23" class="line" namon>L23">3 23./a>.spa. class="comment"> * Currently, compress15< history is not maintained between tfm calls, as./spa. >L24" class="line" namon>L24">3 24./a>.spa. class="comment"> * it is not needed for IPCOMP and keeps the code simpler.  It ca. be./spa. >L25" class="line" namon>L25">3 25./a>.spa. class="comment"> * implemented if someone wants it../spa. >L26" class="line" namon>L26">3 26./a>.spa. class="comment"> */./spa. >L27" class="line" namon>L27">3 27./a>#include <linux/init.h./a>>>L28" class="line" namon>L28">3 28./a>#include <linux/module.h./a>>>L29" class="line" namon>L29">3 29./a>#include <linux/crypto.h./a>>>L30" class="line" namon>L30">3 30./a>#include <linux/zlib.h./a>>>L31" class="line" namon>L31">3 31./a>#include <linux/vmalloc.h./a>>>L32" class="line" namon>L32">3 32./a>#include <linux/interrupt.h./a>>>L33" class="line" namon>L33">3 33./a>#include <linux/mm.h./a>>>L34" class="line" namon>L34">3 34./a>#include <linux/net.h./a>>>L35" class="line" namon>L35">3 35./a>>L36" class="line" namon>L36">3 36./a>#define3.a href="+code=DEFLATE_DEF_LEVEL" class="sref">DEFLATE_DEF_LEVEL./a>               .a href="+code=Z_DEFAULT_COMPRESSION" class="sref">Z_DEFAULT_COMPRESSION./a>>L37" class="line" namon>L37">3 37./a>#define3.a href="+code=DEFLATE_DEF_WINBITS" class="sref">DEFLATE_DEF_WINBITS./a>             11>L38" class="line" namon>L38">3 38./a>#define3.a href="+code=DEFLATE_DEF_MEMLEVEL" class="sref">DEFLATE_DEF_MEMLEVEL./a>            .a href="+code=MAX_MEM_LEVEL" class="sref">MAX_MEM_LEVEL./a>>L39" class="line" namon>L39">3 39./a>>L40" class="line" namon>L40">3 40./a>struct .a href="+code=deflate_ctx" class="sref">deflate_ctx./a> {>L41" class="line" namon>L41">3 41./a>        struct .a href="+code=z_stream_s" class="sref">z_stream_s./a> .a href="+code=comp_stream" class="sref">comp_stream./a>;>L42" class="line" namon>L42">3 42./a>        struct .a href="+code=z_stream_s" class="sref">z_stream_s./a> .a href="+code=decomp_stream" class="sref">decomp_stream./a>;>L43" class="line" namon>L43">3 43./a>};>L44" class="line" namon>L44">3 44./a>>L45" class="line" namon>L45">3 45./a>static int .a href="+code=deflate_comp_init" class="sref">deflate_comp_init./a>(struct .a href="+code=deflate_ctx" class="sref">deflate_ctx./a> *.a href="+code=ctx" class="sref">ctx./a>)>L46" class="line" namon>L46">3 46./a>{>L47" class="line" namon>L47">3 47./a>        int .a href="+code=ret" class="sref">ret./a> = 0;>L48" class="line" namon>L48">3 48./a>        struct .a href="+code=z_stream_s" class="sref">z_stream_s./a> *.a href="+code=stream" class="sref">stream./a> = &.a href="+code=ctx" class="sref">ctx./a>->.a href="+code=comp_stream" class="sref">comp_stream./a>;>L49" class="line" namon>L49">3 49./a>>L50" class="line" namon>L50">3 50./a>        .a href="+code=stream" class="sref">stream./a>->.a href="+code=workspace" class="sref">workspace./a> = .a href="+code=vzalloc" class="sref">vzalloc./a>(.a href="+code=zlib_deflate_workspacesize" class="sref">zlib_deflate_workspacesize./a>(>L51" class="line" namon>L51">3 51./a>                                -.a href="+code=DEFLATE_DEF_WINBITS" class="sref">DEFLATE_DEF_WINBITS./a>,3.a href="+code=DEFLATE_DEF_MEMLEVEL" class="sref">DEFLATE_DEF_MEMLEVEL./a>));>L52" class="line" namon>L52">3 52./a>        if (!.a href="+code=stream" class="sref">stream./a>->.a href="+code=workspace" class="sref">workspace./a>) {>L53" class="line" namon>L53">3 53./a>                .a href="+code=ret" class="sref">ret./a> = -.a href="+code=ENOMEM" class="sref">ENOMEM./a>;>L54" class="line" namon>L54">3 54./a>                goto .a href="+code=out" class="sref">out./a>;>L55" class="line" namon>L55">3 55./a>        }>L56" class="line" namon>L56">3 56./a>        .a href="+code=ret" class="sref">ret./a> = .a href="+code=zlib_deflateInit2" class="sref">zlib_deflateInit2./a>(.a href="+code=stream" class="sref">stream./a>,3.a href="+code=DEFLATE_DEF_LEVEL" class="sref">DEFLATE_DEF_LEVEL./a>,3.a href="+code=Z_DEFLATED" class="sref">Z_DEFLATED./a>,>L57" class="line" namon>L57">3 57./a>                                -.a href="+code=DEFLATE_DEF_WINBITS" class="sref">DEFLATE_DEF_WINBITS./a>,3.a href="+code=DEFLATE_DEF_MEMLEVEL" class="sref">DEFLATE_DEF_MEMLEVEL./a>,>L58" class="line" namon>L58">3 58./a>                                .a href="+code=Z_DEFAULT_STRATEGY" class="sref">Z_DEFAULT_STRATEGY./a>);>L59" class="line" namon>L59">3 59./a>        if (.a href="+code=ret" class="sref">ret./a> != .a href="+code=Z_OK" class="sref">Z_OK./a>) {>L60" class="line" namon>L60">3 60./a>                .a href="+code=ret" class="sref">ret./a> = -.a href="+code=EINVAL" class="sref">EINVAL./a>;>L61" class="line" namon>L61">3 61./a>                goto .a href="+code=out_free" class="sref">out_free./a>;>L62" class="line" namon>L62">3 62./a>        }>L63" class="line" namon>L63">3 63./a>.a href="+code=out" class="sref">out./a>:>L64" class="line" namon>L64">3 64./a>        return .a href="+code=ret" class="sref">ret./a>;>L65" class="line" namon>L65">3 65./a>.a href="+code=out_free" class="sref">out_free./a>:>L66" class="line" namon>L66">3 66./a>        .a href="+code=vfree" class="sref">vfree./a>(.a href="+code=stream" class="sref">stream./a>->.a href="+code=workspace" class="sref">workspace./a>);>L67" class="line" namon>L67">3 67./a>        goto .a href="+code=out" class="sref">out./a>;>L68" class="line" namon>L68">3 68./a>}>L69" class="line" namon>L69">3 69./a>>L70" class="line" namon>L70">3 70./a>static int .a href="+code=deflate_decomp_init" class="sref">deflate_decomp_init./a>(struct .a href="+code=deflate_ctx" class="sref">deflate_ctx./a> *.a href="+code=ctx" class="sref">ctx./a>)>L71" class="line" namon>L71">3 71./a>{>L72" class="line" namon>L72">3 72./a>        int .a href="+code=ret" class="sref">ret./a> = 0;>L73" class="line" namon>L73">3 73./a>        struct .a href="+code=z_stream_s" class="sref">z_stream_s./a> *.a href="+code=stream" class="sref">stream./a> = &.a href="+code=ctx" class="sref">ctx./a>->.a href="+code=decomp_stream" class="sref">decomp_stream./a>;>L74" class="line" namon>L74">3 74./a>>L75" class="line" namon>L75">3 75./a>        .a href="+code=stream" class="sref">stream./a>->.a href="+code=workspace" class="sref">workspace./a> = .a href="+code=vzalloc" class="sref">vzalloc./a>(.a href="+code=zlib_inflate_workspacesize" class="sref">zlib_inflate_workspacesize./a>());>L76" class="line" namon>L76">3 76./a>        if (!.a href="+code=stream" class="sref">stream./a>->.a href="+code=workspace" class="sref">workspace./a>) {>L77" class="line" namon>L77">3 77./a>                .a href="+code=ret" class="sref">ret./a> = -.a href="+code=ENOMEM" class="sref">ENOMEM./a>;>L78" class="line" namon>L78">3 78./a>                goto .a href="+code=out" class="sref">out./a>;>L79" class="line" namon>L79">3 79./a>        }>L80" class="line" namon>L80">3 80./a>        .a href="+code=ret" class="sref">ret./a> = .a href="+code=zlib_inflateInit2" class="sref">zlib_inflateInit2./a>(.a href="+code=stream" class="sref">stream./a>,3-.a href="+code=DEFLATE_DEF_WINBITS" class="sref">DEFLATE_DEF_WINBITS./a>);>L81" class="line" namon>L81">3 81./a>        if (.a href="+code=ret" class="sref">ret./a> != .a href="+code=Z_OK" class="sref">Z_OK./a>) {>L82" class="line" namon>L82">3 82./a>                .a href="+code=ret" class="sref">ret./a> = -.a href="+code=EINVAL" class="sref">EINVAL./a>;>L83" class="line" namon>L83">3 83./a>                goto .a href="+code=out_free" class="sref">out_free./a>;>L84" class="line" namon>L84">3 84./a>        }>L85" class="line" namon>L85">3 85./a>.a href="+code=out" class="sref">out./a>:>L86" class="line" namon>L86">3 86./a>        return .a href="+code=ret" class="sref">ret./a>;>L87" class="line" namon>L87">3 87./a>.a href="+code=out_free" class="sref">out_free./a>:>L88" class="line" namon>L88">3 88./a>        .a href="+code=vfree" class="sref">vfree./a>(.a href="+code=stream" class="sref">stream./a>->.a href="+code=workspace" class="sref">workspace./a>);>L89" class="line" namon>L89">3 89./a>        goto .a href="+code=out" class="sref">out./a>;>L90" class="line" namon>L90">3 90./a>}>L91" class="line" namon>L91">3 91./a>>L92" class="line" namon>L92">3 92./a>static void .a href="+code=deflate_comp_exit" class="sref">deflate_comp_exit./a>(struct .a href="+code=deflate_ctx" class="sref">deflate_ctx./a> *.a href="+code=ctx" class="sref">ctx./a>)>L93" class="line" namon>L93">3 93./a>{>L94" class="line" namon>L94">3 94./a>        .a href="+code=zlib_deflateEnd" class="sref">zlib_deflateEnd./a>(&.a href="+code=ctx" class="sref">ctx./a>->.a href="+code=comp_stream" class="sref">comp_stream./a>);>L95" class="line" namon>L95">3 95./a>        .a href="+code=vfree" class="sref">vfree./a>(.a href="+code=ctx" class="sref">ctx./a>->.a href="+code=comp_stream" class="sref">comp_stream./a>..a href="+code=workspace" class="sref">workspace./a>);>L96" class="line" namon>L96">3 96./a>}>L97" class="line" namon>L97">3 97./a>>L98" class="line" namon>L98">3 98./a>static void .a href="+code=deflate_decomp_exit" class="sref">deflate_decomp_exit./a>(struct .a href="+code=deflate_ctx" class="sref">deflate_ctx./a> *.a href="+code=ctx" class="sref">ctx./a>)>L99" class="line" namon>L99">3 99./a>{>L100" class="line" namon>L100">3100./a>        .a href="+code=zlib_inflateEnd" class="sref">zlib_inflateEnd./a>(&.a href="+code=ctx" class="sref">ctx./a>->.a href="+code=decomp_stream" class="sref">decomp_stream./a>);>L101" class="line" namon>L101">3101./a>        .a href="+code=vfree" class="sref">vfree./a>(.a href="+code=ctx" class="sref">ctx./a>->.a href="+code=decomp_stream" class="sref">decomp_stream./a>..a href="+code=workspace" class="sref">workspace./a>);>L102" class="line" namon>L102">3102./a>}>L103" class="line" namon>L103">3103./a>>L104" class="line" namon>L104">3104./a>static int .a href="+code=deflate_init" class="sref">deflate_init./a>(struct .a href="+code=crypto_tfm" class="sref">crypto_tfm./a> *.a href="+code=tfm" class="sref">tfm./a>)>L105" class="line" namon>L105">3105./a>{>L106" class="line" namon>L106">3106./a>        struct .a href="+code=deflate_ctx" class="sref">deflate_ctx./a> *.a href="+code=ctx" class="sref">ctx./a> = .a href="+code=crypto_tfm_ctx" class="sref">crypto_tfm_ctx./a>(.a href="+code=tfm" class="sref">tfm./a>);>L107" class="line" namon>L107">3107./a>        int .a href="+code=ret" class="sref">ret./a>;>L108" class="line" namon>L108">3108./a>>L109" class="line" namon>L109">3109./a>        .a href="+code=ret" class="sref">ret./a> = .a href="+code=deflate_comp_init" class="sref">deflate_comp_init./a>(.a href="+code=ctx" class="sref">ctx./a>);>L110" class="line" namon>L110">3110./a>        if (.a href="+code=ret" class="sref">ret./a>)>L111" class="line" namon>L111">3111./a>                goto .a href="+code=out" class="sref">out./a>;>L112" class="line" namon>L112">3112./a>        .a href="+code=ret" class="sref">ret./a> = .a href="+code=deflate_decomp_init" class="sref">deflate_decomp_init./a>(.a href="+code=ctx" class="sref">ctx./a>);>L113" class="line" namon>L113">3113./a>        if (.a href="+code=ret" class="sref">ret./a>)>L114" class="line" namon>L114">3114./a>                .a href="+code=deflate_comp_exit" class="sref">deflate_comp_exit./a>(.a href="+code=ctx" class="sref">ctx./a>);>L115" class="line" namon>L115">3115./a>.a href="+code=out" class="sref">out./a>:>L116" class="line" namon>L116">3116./a>        return .a href="+code=ret" class="sref">ret./a>;>L117" class="line" namon>L117">3117./a>}>L118" class="line" namon>L118">3118./a>>L119" class="line" namon>L119">3119./a>static void .a href="+code=deflate_exit" class="sref">deflate_exit./a>(struct .a href="+code=crypto_tfm" class="sref">crypto_tfm./a> *.a href="+code=tfm" class="sref">tfm./a>)>L120" class="line" namon>L120">312ue=a>{>L121" class="line" namon>L121">3121./a>        struct .a href="+code=deflate_ctx" class="sref">deflate_ctx./a> *.a href="+code=ctx" class="sref">ctx./a> = .a href="+code=crypto_tfm_ctx" class="sref">crypto_tfm_ctx./a>(.a href="+code=tfm" class="sref">tfm./a>);>L122" class="line" namon>L122">3122./a>>L123" class="line" namon>L123">3123./a>        .a href="+code=deflate_comp_exit" class="sref">deflate_comp_exit./a>(.a href="+code=ctx" class="sref">ctx./a>);>L124" class="line" namon>L124">3124./a>        .a href="+code=deflate_decomp_exit" class="sref">deflate_decomp_exit./a>(.a href="+code=ctx" class="sref">ctx./a>);>L125" class="line" namon>L125">3125./a>}>L126" class="line" namon>L126">3126./a>>L127" class="line" namon>L127">3127./a>static int .a href="+code=deflate_compress" class="sref">deflate_compress./a>(struct .a href="+code=crypto_tfm" class="sref">crypto_tfm./a> *.a href="+code=tfm" class="sref">tfm./a>, const .a href="+code=u8" class="sref">u8./a> *.a href="+code=src" class="sref">src./a>,>L128" class="line" namon>L128">3128./a>                            unsigned int .a href="+code=slen" class="sref">slen./a>, .a href="+code=u8" class="sref">u8./a> *.a href="+code=dst" class="sref">dst./a>, unsigned int *.a href="+code=dlen" class="sref">dlen./a>)>L129" class="line" namon>L129">3129./a>{>L130" class="line" namon>L130">3130./a>        int .a href="+code=ret" class="sref">ret./a> = 0;>L131" class="line" namon>L131">3131./a>        struct .a href="+code=deflate_ctx" class="sref">deflate_ctx./a> *.a href="+code=dctx" class="sref">dctx./a> = .a href="+code=crypto_tfm_ctx" class="sref">crypto_tfm_ctx./a>(.a href="+code=tfm" class="sref">tfm./a>);>L132" class="line" namon>L132">3132./a>        struct .a href="+code=z_stream_s" class="sref">z_stream_s./a> *.a href="+code=stream" class="sref">stream./a> = &.a href="+code=dctx" class="sref">dctx./a>->.a href="+code=comp_stream" class="sref">comp_stream./a>;>L133" class="line" namon>L133">3133./a>>L134" class="line" namon>L134">3134./a>        .a href="+code=ret" class="sref">ret./a> = .a href="+code=zlib_deflateReset" class="sref">zlib_deflateReset./a>(.a href="+code=stream" class="sref">stream./a>);>L135" class="line" namon>L135">3135./a>        if (.a href="+code=ret" class="sref">ret./a> != .a href="+code=Z_OK" class="sref">Z_OK./a>) {>L136" class="line" namon>L136">3136./a>                .a href="+code=ret" class="sref">ret./a> = -.a href="+code=EINVAL" class="sref">EINVAL./a>;>L137" class="line" namon>L137">3137./a>                goto .a href="+code=out" class="sref">out./a>;>L138" class="line" namon>L138">3138./a>        }>L139" class="line" namon>L139">3139./a>>L140" class="line" namon>L140">3140./a>        .a href="+code=stream" class="sref">stream./a>->.a href="+code=next_in" class="sref">next_in./a> = (.a href="+code=u8" class="sref">u8./a> *).a href="+code=src" class="sref">src./a>;>L141" class="line" namon>L141">3141./a>        .a href="+code=stream" class="sref">stream./a>->.a href="+code=avail_in" class="sref">avail_in./a> = .a href="+code=slen" class="sref">slen./a>;>L142" class="line" namon>L142">3142./a>        .a href="+code=stream" class="sref">stream./a>->.a href="+code=next_out" class="sref">next_out./a> = (.a href="+code=u8" class="sref">u8./a> *).a href="+code=dst" class="sref">dst./a>;>L143" class="line" namon>L143">3143./a>        .a href="+code=stream" class="sref">stream./a>->.a href="+code=avail_out" class="sref">avail_out./a> = *.a href="+code=dlen" class="sref">dlen./a>;>L144" class="line" namon>L144">3144./a>>L145" class="line" namon>L145">3145./a>        .a href="+code=ret" class="sref">ret./a> = .a href="+code=zlib_deflate" class="sref">zlib_deflate./a>(.a href="+code=stream" class="sref">stream./a>,3.a href="+code=Z_FINISH" class="sref">Z_FINISH./a>);>L146" class="line" namon>L146">3146./a>        if (.a href="+code=ret" class="sref">ret./a> != .a href="+code=Z_STREAM_END" class="sref">Z_STREAM_END./a>) {>L147" class="line" namon>L147">3147./a>                .a href="+code=ret" class="sref">ret./a> = -.a href="+code=EINVAL" class="sref">EINVAL./a>;>L148" class="line" namon>L148">3148./a>                goto .a href="+code=out" class="sref">out./a>;>L149" class="line" namon>L149">3149./a>        }>L150" class="line" namon>L150">3150./a>        .a href="+code=ret" class="sref">ret./a> = 0;>L151" class="line" namon>L151">3151./a>        *.a href="+code=dlen" class="sref">dlen./a> = .a href="+code=stream" class="sref">stream./a>->.a href="+code=total_out" class="sref">total_out./a>;>L152" class="line" namon>L152">3152./a>.a href="+code=out" class="sref">out./a>:>L153" class="line" namon>L153">3153./a>        return .a href="+code=ret" class="sref">ret./a>;>L154" class="line" namon>L154">3154./a>}>L155" class="line" namon>L155">3155./a>>L156" class="line" namon>L156">3156./a> 71./a>{>deflate_c#L72" res./a>(struct .a href="+code=crypto_tfm" class="sref">crypto_tfm./a> *.a href="+code=tfm" class="sref">tfm./a>, const .a href="+code=u8" class="sref">u8./a> *.a href="+code=src" class="sref">src./a>,>L57" class="line"1 namo1>L57">3 57./a>                              unsigned int .a href="+code=slen" class="sref">slen./a>, .a href="+code=u8" class="sref">u8./a> *.a href="+code=dst" class="sref">dst./a>, unsigned int *.a href="+code=dlen" class="sref">dlen./a>)>L58" class="line"1 namo1>L58">ND./a>) {>L59" class="line"1 namo15139">3139./a>>L60" class="line"1 namo16130">3130./a>        int .a href="+code=ret" class="sref">ret./a> = 0;>L61" class="line"1 namo16131">3131./a>        struct .a href="+code=deflate_ctx" class="sref">deflate_ctx./a> *.a href="+code=dctx" class="sref">dctx./a> = .a href="+code=crypto_tfm_ctx" class="sref">crypto_tfm_ctx./a>(.a href="+code=tfm" class="sref">tfm./a>);>L62" class="line"1 namo16132">3132./a>        struct .a href="+code=z_stream_s" class="sref">z_stream_s./a> *.a href="+code=stream" class="sref">stream./a> = &.a href="+code=dctx" class="sref">dctx./a>->.a href="+code=decomp_stream" class="sref">decomp_stream./a>;>L63" class="line"1 namo16133">3133./a>>L64" class="line"1 namo16134">3134./a>        .a href="+code=ret" class="sref">ret./a> = .a href="+cof">zlib_deflateReset" class="sref">zlib_deflateReset./a>(.a href="+code=stream" class="sref">stream./a>);>L65" class="line"1 namo16135">3135./a>        if (.a href="+code=ret" class="sref">ret./a> != .a href="+code=Z_OK" class="sref">Z_OK./a>) {>L16" class="line" namon>6136">3136./a>                .a href="+code=ret" class="sref">ret./a> = -.a href="+code=EINVAL" class="sref">EINVAL./a>;>L67" class="line"1 namo16137">3137./a>                goto .a href="+code=out" class="sref">out./a>;>L68" class="line"1 namo16138">3138./a>        }>L69" class="line"1 namo1>L69">3 69./a>>L70" class="line"1 namo17140">3140./a>        .a href="+code=stream" class="sref">stream./a>->.a href="+code=next_in" class="sref">next_in./a> = (.a href="+code=u8" class="sref">u8./a> *).a href="+code=src" class="sref">src./a>;>L71" class="line"1 namo17141">3141./a>        .a href="+code=stream" class="sref">stream./a>->.a href="+code=avail_in" class="sref">avail_in./a> = .a href="+code=slen" class="sref">slen./a>;>L72" class="line"1 namo17142">3142./a>        .a href="+code=stream" class="sref">stream./a>->.a href="+code=next_out" class="sref">next_out./a> = (.a href="+code=u8" class="sref">u8./a> *).a href="+code=dst" class="sref">dst./a>;>L73" class="line"1 namo17143">3143./a>        .a href="+code=stream" class="sref">stream./a>->.a href="+code=avail_out" class="sref">avail_out./a> = *.a href="+code=dlen" class="sref">dlen./a>;>L74" class="line"1 namo1>L74">3 74./a>>L75" class="line"1 namo1>L75">3 75./a>        .a href="+code=ret" class="sref">ret./a> = .a href="+cof">zlibateReset" class="sref">zlib_deflate./a>(.a href="+code=stream" class="sref">stream./a>,3.a href="SYNC_FLUe=Z_FINISH" class="SYNC_FLUe=">stream./a>);>L76" class="line"1 namo1>L76">3 76./a>3 31./a>.spa. class="comment">/*./spa. >L17" class="line" nnamo17L17">3 17./a>.spa. class="cooooooooo* Work arftwa a bugfm b="sr, whicht may i 200someonrelaas * Dn "srrament">/*./spa. >L78" class="line"1 namo17L18">3 18./a>.spa. class="cooooooooo* by * whe.  Iingnel dfm basis(twaocu * imp) raw* FIXME: mhre default../spa. >L79" class="line"1 namo17L19">3 19./a>.spa. class="cooooooooo* (From USAGIRFC 2394)../spa. >L80" class="line"1 namo18L20">3 2ue=a>.spa. class="cooooooooo*ment"> */./spa. >L81" class="line"1 namo1>L81">3 81./a>        if (.a href="+code=ret" class="sref">=et./a> != .a href="+code=Z_OK" class="sref">am./a>FC 317    if (!.a href="+code=stream" class="sref">stream./a>->.a href="+code=avail_in" class="sref">availm./a>FC 317        .a href="+code=stream" class="sref">stream./a>->.a href="+code=avail_out" class="sref">availZ_OK./a>) {>L82" class="line"1 namo1>L82">3 82./a>                .a href="+code=u8" class="sref"t./a> = .a href=erostuffateReset" class=erostuffref">ret./a> = 0;>L83" class="line"1 namo1>L83">3 83./a>                .a href="+code=stream" class="sref">stream./a>->.a href="+code=next_in" class="sref">next_im./a> = &.a href=erostuffateReset" class=erostuffref"./a> = 0;>L84" class="line"1 namo1>L84">3 84./a>3141./a>        .a href="+code=stream" class="sref">stream./a>->.a href="+code=avail_in" class="sref">avail_i1./a> = 0;>L85" class="line"1 namo18584">3 84./a>3141./a>        .a href="+code=ret" class="sref">ret./a> = .a href="+cof">zlibateReset" class="sref">zlib_deflate./a>(.a href="+code=stream" class="sref">stream./a>,3.a href="+code=Z_FINISH" class="sref">Z_FINISH./a>);>L86" class="line"1 namo1>L86">3 86./a>        }>L87" class="line"1 namo18781">3 81./a>        if (.a href="+code=ret" class="sref">ret./a> != .a href="+code=Z_STREAM_END" class="sref">Z_STREAM_END./a>) {>L88" class="line"1 namo18148">3148./a>                .a href="+code=ret" class="sref">ret./a> = -.a href="+code=EINVAL" class="sref">EINVAL./a>;>L89" class="line"1 namo2>L89">3 89./a>9./a>9./      goto .a href="+code=out" class="sref">out./a>;>L90" class="line"1 namo19086">3 86./a>        }>L91" class="line"1 namo19141">3141./a>        .a href="+code=ret" class="sref">ret./a> = 0;>L92" class="line"1 namo19L82">3 82./a>        *.a href="+code=dlen" class="sref">dlen./a> = .a href="+code=stream" class="sref">stream./a>->.a href="+code=total_out" class="sref">total_out./a>;>L93" class="line"1 namo19L63">3 63./a>.a href="+code=out" class="sref">out./a>:>L94" class="line"1 namo1>L94">3 94./a>        return .a href="+code=ret" class="sref">ret./a>;>L95" class="line"1 namo19125">3125./a>}>L96" class="line"1 namo19126">3126./a>>L97" class="line"1 namo19127">3127./ares./a>(struct .a href="+codealg_tfm_ctx" class="sref"algsref"t./a> = .a hrefalg_tfm_ctx" classalgsref"=END./a>) {>L98" class="line"1 namo19148">3148./a>ream./a>..a hrefcra_="li_tfm_ctx" class="a_="li89">3 89./a>9./a>9.=>3 31./a>.spa.ca. ng">""crypto"ent"> *>src./a>,>L99" class="line"1 namo19948">3148./a>ream./a>..a hrefcra_rypg_stream_s" classcra_rypg_89">3 89./a>9./a>9len./a> = .a hrefCRYPTO_ALG_TYPE_DEFAULT_stream_s" classCRYPTO_ALG_TYPE_DEFAULT_ref">src./a>,>L100" class="line"2namon2L100">3100./a>ream./a>..a hrefcra_ctxorkspacesize" classcra_ctxorks89">3 89./a>9./a= orksofexit./a>(struct .a href="+code=deflate_ctx" class="sref">deflate)>src./a>,>L101" class="line"2namon2L101">3101./a>ream./a>..a hrefcra_">linupacesize" classcra_">linu89">3 89./a>9./a>len./a> = .a hrefTHIS_MODULEpacesize" classTHIS_MODULEref">src./a>,>L102" class="line"2namon20201">3101./a>ream./a>..a hrefcra__decomp_init" classcra__dec89">3 89./a>9./a>9.=>3struct .a href="+code=deflate_init" class="sref">deflate_>src./a>,>L103" class="line"2namon20301">3101./a>ream./a>..a hrefcra__decomp_exit" classcra__dec89">3 89./a>9./a>9.=>3struct .a href="+code=deflate_exit" class="sref">deflate_>src./a>,>L104" class="line"2namon20401">3101./a>ream./a>..a hrefcra_uomp_exit" classcra_u57">3 57./a>          =EN>ream./a>..a hrefcate.c#L72" ress" classflate_c#L72""=END./a>) {>L105" class="line"2namon20501">3101./a>ream./a>..a hrefcoa=deflate_compress" classcoa=deflate_57">3 57./a>   ret./a> = .a href="+code=deflate_compress" class="sref">deflate_comp>src./a>,>L106" class="line"2namon2L106">3106./a>ream./a>..a hrefcoa=eflate.c#L72" ress" classcoa=eflate.c#L57">3 57./a> ret./a> = .a href="+code=deflat.c#L72" ress" class="sref">deflate_c#L72" }>        }>L107" class="line"2namon2L107">3 43./a>};>L108" class="line"2namon2L108">3108./a>>L109" class="line"2namon20119">3119./a        int .a href_=deflate_init" class___dec89">3t./a> = .a href="+code=">l=deflate_init" class="sref">">l=defl_defl>stadlen./a>)>L110" class="line"2namon21120">312ue=a>{>L111" class="line"2namon2L111">3111./a>        return .a href="sref"registerealg_tfm_ctx" class="sref"registerealg_deflm./a> = &.a hrefalg_tfm_ctx" classalgsrefNISH./a>);>L112" class="line"2namon21102">3102./a>}>L113" class="line"2namon21133">3133./a>>L114" class="line"2namon21104">3104./a>static void .a href_=deflate_exit" class___dec89">3t./a> = .a href="+code=">l=fdefate_init" class="sref">">l=fdef_defl>stadlen./a>)>L115" class="line"2namon21105">3105./a>{>L116" class="line"2namon21L66">3 66./a>        .a href="sref"unregisterealg_tfm_ctx" class="sref"unregisterealg_deflm./a> = &.a hrefalg_tfm_ctx" classalgsrefNISH./a>);>L117" class="line"2namon2L117">3117./a>}>L118" class="line"2namon2L118">3118./a>>L119" class="line"2namon2L119"> = &.a href">linu=deflate_init" class">linu=defl_deflate./a>(.a href="+code=">l=deflate_init" class="sref">">l=defl_defNISH./a>);>L120" class="line"2namon2L120"> = &.a href">linu=deflate_exit" class">linu=defl_deflate./a>(.a href="+code=">l=fdefate_init" class="sref">">l=fdef_defNISH./a>);>L121" class="line"2namon22L91">3 91./a>>L122" class="line"2namon22152">3152./a>.a hrefMODULE_LICENSEpacesize" classMODULE_LICENSE_defla 31./a>.spa.ca. ng">"GPL"ent"> *NISH./a>);>L123" class="line"2namon22L63">3 63./a>.a hrefMODULE_DESCRIPTCOMPRESSION" classMODULE_DESCRIPTCOM_defla 31./a>.spa.ca. ng">"DFIXME: Clate_c#ion Algorithm for IPDEFA"ent"> *NISH./a>);>L124" class="line"2namon2L124">3 63./a>.a hrefMODULE_AUTHORPRESSION" classMODULE_AUTHOR_defla 31./a>.spa.ca. ng">"Ja 200Morris#incljmorris@">lin hre.fla.aueam."ent"> *NISH./a>);>L125" class="line"2namon22155">3155./a>>L126" class="line"2namon2L126">




L126"foolin">
The original LXR software bybasis155./a>>LXR  clauefly">strethis#experiass=al ver#ion byb155./a>>lxn@ clux.no">st.

L126"subfoolin">
lxn. clux.no kindly hosted byb155./a>>Redpill Lclteo AF_WINBIteovider of Lcluxtfm./ultingnand oper04.m./ servic200sinceo1995.