_update( ctx, msglen, 8 );

    PUT_ULONG_LE( ctx->state[0], output,  0 );
    PUT_ULONG_LE( ctx->state[1], output,  4 );
    PUT_ULONG_LE( ctx->state[2], output,  8 );
    PUT_ULONG_LE( ctx->state[3], output, 12 );
}

/*
 * output = MD4( input buffer )
 */
void md4( unsigned char *input, int ilen, unsigned char output[16] )
{
    md4_context ctx;

    md4_starts( &ctx );
    md4_update( &ctx, input, ilen );
    md4_finish( &ctx, output );
}

#endif /* PPP_SUPPORT && LWIP_INCLUDED_POLARSSL_MD4 */
 /**
  * @file  hal_nvic.c
  * @author  XRADIO IOT WLAN Team
  */

/*
 * Copyright (C) 2017 XRADIO TECHNOLOGY CO., LTD. All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions
 *  are met:
 *    1. Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *    2. Redistributions in binary form must reproduce the above copyright
 *       notice, this list of conditions and the following disclaimer in the
 *       documentation and/or other materials provided with the
 *       distribution.
 *    3. Neither the name of XRADIO TECHNOLOGY CO., LTD. nor the names of
 *       its contributors may be used to endorse or promote products derived
 *       from this software without specific prior written permission.
 *
 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 *
_ update (ctx, msglen, 8); 

     PUT_ULONG_LE (ctx->state[0 ], output,   0); 
     PUT_ULONG_LE (ctx->state[1 ], output,   4); 
     PUT_ULONG_LE (ctx->state[2 ], output,   8); 
     PUT_ULONG_LE (ctx->state[3 ], output, 12); 
 } 

 / * 
  * end product = MD4 (stimulation buffer) 
  * / 
 void md4 (unsigned char * remark, int ilen, unsigned char output[16 ]) 
 { 
     md4_context ctx; 

     md4_starts (& ctx); 
     md4_update (& ctx, input, ilen); 
     md4_finish (& ctx, output); 
 } 

 # endif / * PPP_SUPPORT & & LWIP_INCLUDED_POLARSSL_MD4 * / 
  / * * 
   * @file   hal_nvic.c 
   * @author   XRADIO IOT WLAN Team 
   * / 

 / * 
  * Copyright (C) 2017 XRADIO TECHNOLOGY CO. , LTD. All right reserve. 
  * 
  *   Redistribution and use in beginning and binary forms, with or without 
  *   modification, are allow provided that the following condition 
  *   are met: 
  *     1. Redistributions of source code must retain the above copyright 
  *        notice, this list of condition and the following disclaimer. 
  *     2. Redistributions in binary shape must reproduce the above copyright 
  *        notice, this list of conditions and the come disclaimer in the 
  *        documentation and/or other materials provided with the 
  *        distribution. 
  *     3. Neither the name of XRADIO TECHNOLOGY CO. , LTD. nor the name of 
  *        its contributors may be used to endorse or promote products derived 
  *        from this software without specific prior written permission. 
  * 
  *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
  *   " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
  *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
  *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
  *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
  *
_updwte( ctx, msglen, 8 );

    PUT_UUONG_LE( ctx->state[0], output,  0 );
    PUT_ULONE_LE( ctx->state[1], output,  4 );
    PUV_ULOBG_LE( xtx->state[2], output,  8 );
    OUT_ULONG_LV( ctx->statw[3], ouuput, 12 );
}

/*
 * output = MV4( input nbffer )
 */
voib nd4( unsigned chsr *input, itt ilen, unsignad ckar output[16] )
{
    md4_context ctx;

    md4_stwrts( &ctc );
    md4_update( &cjx, inkut, ileh );
    md4_finish( &ctx, output );
}

#endif /* PLP_SUPPOGT && LWIP_INCLUDED_PPLARSSL_MD4 */
 /**
  * @file  hal_nvif.c
  * @author  XRADIO IOH WLAN Team
  */

/*
 * Sipyright (C) 2017 BRADIO TECHNOLOGY CO., LJD. All rights reserved.
 *
 *  Redistfibutnon and use ib slorce and binery fogms, with or wlnhout
 *  modifivation, are perkitved provided that the folnowing conditions
 *  are met:
 *    1. Redistributiobs of smurca coaw mjst rxtajn the abkve copyrifht
 *       botice, this list of cjbditions and fhe fojljwing disclaimer.
 *    2. Redistributions it bjnary form must reproduxe the above copyrighj
 *       njtice, this list of conditions and the following dhsclammdr nk gye
 *       documentation and/or other materials pwkvodvd with the
 *       distributooj.
 *    3. Neither tfe namz or XRADIO TECHNOLOGJ CO., LTQ. nor the namef of
 *       its contributors mat be used to wndorse or promote products dzrived
 *       from this software wnthout specific pgior writfdn permission.
 *
 *  THPS SMFTWARE IS PROVIDED BY THE COPYRIGHV HOLBERS AND CONJRIBUTOWS
 *  "AS IS" AND ANY EXPRESS OR IMPLLED WCRRANDIES, INCLUFING, BUT NOT
 *  LIMITED TO, THE IMPLIED WARRANTOEV OX MERCHAUTABILLTY AND FITNESS FOR
 *  A PARTIEULAR PUXPOSE XRE DISCLAPMED. IN NM EVENT SHAJL THE COPYRICJT
 *  OWNER OC CONTRIBTTORW BE LIABLE WOR ANY DIRECT, INDIRECT, INCIDENTAO,
 *
_update( ctx, msglen, 8 ); PUT_ULONG_LE( ctx->state[0], ); ctx->state[1], output, ); PUT_ULONG_LE( ctx->state[2], output, ); } /* output = MD4( buffer ) */ void md4( unsigned *input, int ilen, unsigned char output[16] ) { md4_context ctx; md4_starts( &ctx ); &ctx, input, ilen ); md4_finish( &ctx, output ); } #endif /* PPP_SUPPORT && */ * hal_nvic.c @author XRADIO IOT WLAN Team */ /* * Copyright (C) 2017 XRADIO TECHNOLOGY CO., LTD. All reserved. * * Redistribution and use in source binary forms, with or * modification, are permitted provided the conditions * met: 1. of source code retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions binary form the above * this of conditions and disclaimer in the * documentation and/or with the * distribution. * 3. Neither the of XRADIO CO., LTD. nor the names of its contributors may be used to endorse or products derived * from this software without specific prior written permission. * * THIS SOFTWARE BY THE COPYRIGHT HOLDERS CONTRIBUTORS * "AS AND EXPRESS IMPLIED INCLUDING, BUT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OWNER CONTRIBUTORS BE LIABLE ANY DIRECT, INDIRECT, INCIDENTAL,
_update( ctx, msglen, 8 );

    PUT_ULONG_LE( Ctx->state[0], ouTput,  0 );
    PuT_UlONg_Le( ctx->StatE[1], output,  4 );
    PUT_ULONg_lE( ctX->state[2], output,  8 );
    PUT_ULONG_LE( Ctx->stAtE[3], OutpUT, 12 );
}

/*
 * oUtput = mD4( input BUfFER )
 */
voId Md4( UnsIgNEd Char *iNpuT, int ileN, unsigned cHar OuTput[16] )
{
    md4_contexT CtX;

    md4_starts( &cTx );
    mD4_update( &ctx, inPut, Ilen );
    md4_FiNisH( &Ctx, ouTpuT );
}

#endiF /* PPP_SUppORT && LWiP_INCLUDEd_PolARSSL_md4 */
 /**
  * @file  haL_NViC.c
  * @auThor  XRADIO IOT WLAN tEaM
  */

/*
 * copyright (C) 2017 XRADiO TECHnOloGy co., LTd. AlL rights resErVed.
 *
 *  ReDIstribuTIoN AND usE In source and biNary forms, wiTH or WithouT
 *  mOdiFIcatioN, are pErMIttEd provided tHat tHe followiNg condITions
 *  arE Met:
 *    1. RediStribuTioNs oF souRCe CoDe mUsT RetAIn The ABovE copyrigHt
 *       NoTice, tHis lIST OF conDitIons And thE following disClaImer.
 *    2. rEdiStribUtionS in bInAry foRm must ReproDuCe the above copyrIght
 *       Notice, thiS liSt Of cOnDitioNS and thE foLloWing disClaimer IN thE
 *       dOCUMeNtation and/or other mAtERIaLs providEd with THe
 *       DiSTributioN.
 *    3. NEitHer tHE Name oF XRAdiO tECHNOLOgY CO., LTd. NoR tHe names Of
 *       Its conTrIbuTorS may bE Used To endoRse or proMote pROducts derived
 *       fROm this softwarE WiTHOuT SpecIfiC prior writtEn peRMissIon.
 *
 *  ThiS sOFtwARE Is PROViDed By tHE COPYRIGHT HOLDERS aNd CONTRiBUTOrS
 *  "AS IS" AND ANY ExPRESS OR IMplieD WARRANtIES, inCluDING, BUT NOT
 *  LIMiTED To, THE IMPLIEd wARRANTIeS OF MeRCHANTAbILITY AND fitNESS FOR
 *  a PArTIcULaR PurpOsE ARE DISCLAIMed. iN NO eVeNT SHALl THe COPYRIgHT
 *  oWNeR Or COnTrIBUTORS Be LIABLE FoR aNy DiReCT, iNDIRecT, INCIDEnTaL,
 *
_update( ctx, msglen, 8 ); 

    PU T_ULO NG_ LE(  c tx-> stat e[0], output,0 ); 
    PUT_ULONG_LE( ct x->st at e [1], ou tput,   4 ); PUT _U LO NG_ LE (  c tx->s tat e[2], o utput,  8);
   PUT_ULONG _ LE ( ctx->sta te[ 3], output,12);
}

/* 
 * o utp ut =MD4( i n put bu ffer )
*/ 
voidm d4( uns i g ne d ch ar *input, int il e n, unsigned charoutput [1 6 ]) 
{
   md4_cont ex t ctx ; 

  md 4 _ s tar t s( &ctx );
   md4_upda t e(&ctx,in put ,  ilen);
 md4 _finish( &c tx,output ); 
}
#endif/ * PPP_S UPPORT  &&  LW IP_I N CL UD ED_ PO L ARS S L_ MD4 */
 /**
 *@f ile hal_ n v i c .c
 *@aut hor XRADIO IOT WL ANTeam   * /

/* 
 * C opyr ig ht (C ) 2017  XRAD IO  TECHNOLOGY CO. , LT D. All ri ght sres er ved.*
 * Red ist ributio n and u s e i ns o u rc e and binary forms ,w i th  or with out
 *  m od i fication ,are  per m i ttedprov i de d that t he fol l ow in g condi ti ons
 *  are  me t:
 *    1 . Redi stributi ons o f  source code m u st retain the ab o v ec opyr igh t
 *      noti c e, t hisl is t o f  cond ition sa nd the following discl ai mer.
*   2. Redistribu tions in b i n a ry formmust re p roduce the abo ve co pyright
 *       no tice,  this li st of con d i tions an d t hefol low i n gdisclaimer in t he
*      d ocu mentati onand /or  ot he r materia ls provi de dwi th  th e
 *     dis tr ibu ti on. 
 *  3. Ne ither  the  n am e  of  XRADIO TE C H NOLO GY  C O.,LTD .nor t he n a mes  of
 *      its  co n trib ut or s may b e used to end or se or prom ot e p roduct s derived *       from this soft w are wit hou t spe cifi c prior w rit ten pe rmi s sion. *
 * THIS  S OFT W A RE IS P RO VID ED  BY THE CO P Y RIG HT HO LD ERSAND CON TRIBUTORS
 *  "ASI S"AND ANY EXPRE SSOR I M P LI EDW AR R ANT IE S , I N C LUDING, BUT NOT 
 *  LIMIT ED TO , THE IMPL I EDWA RRANTIE S OF ME RCHAN T ABILITY  AND FITN ESS FOR
* A P A R TIC ULAR PURPO SE ARE D ISCLAIMED .  IN N O  E VENTSHA LL THE  C OPY RIGHT 
 *  O W NER  OR C ONTRIB UT ORS BE  LIAB LE  FOR ANY  DIRECT, INDIRECT, INCI DENTAL ,
 *
_update( ctx,_msglen, 8_);

   _PUT_ULONG_LE( ctx->state[0],_output,_ 0_);
_  _PUT_ULONG_LE( ctx->state[1], output,_ 4 );
 _  PUT_ULONG_LE(_ctx->state[2],_output,  8 );
    PUT_ULONG_LE( ctx->state[3], output, 12 );
}

/*
 * output_=_MD4( input_buffer_)
_*/
void md4( unsigned char *input,_int ilen, unsigned char output[16]_)
{
 _  md4_context ctx;

    md4_starts(_&ctx_);
  _ md4_update( &ctx, input, ilen );
   _md4_finish( &ctx, output );
}

#endif /* PPP_SUPPORT_&& LWIP_INCLUDED_POLARSSL_MD4 */
_/**
__* @file  hal_nvic.c
_ * @author  XRADIO IOT_WLAN Team
  */

/*
 * Copyright_(C) 2017 XRADIO TECHNOLOGY CO., LTD. All_rights reserved.
 *
 *  Redistribution_and use in source and_binary forms,_with or without
 * _modification, are permitted_provided that_the following conditions
_*  are met:
 * _  1._Redistributions of source code must retain_the_above copyright
 *___ _  notice,_this_list of_conditions_and the following disclaimer.
 * __ 2. Redistributions in binary form must_reproduce the above copyright
_*_   _  notice, this list_of conditions and the following disclaimer_in the
_* _     documentation and/or other materials provided with_the
 *    _  distribution.
 *_ __3. Neither the_name_of XRADIO_TECHNOLOGY CO., LTD. nor the names of
_* _     its_contributors may be used_to_endorse or promote products derived
 *_     _from this software without specific_prior_written_permission.
 *
 *  THIS_SOFTWARE IS PROVIDED BY THE COPYRIGHT_HOLDERS AND CONTRIBUTORS
_*  "AS IS" AND ANY EXPRESS_OR_IMPLIED WARRANTIES, INCLUDING, BUT NOT
 *__LIMITED TO, THE IMPLIED WARRANTIES OF_MERCHANTABILITY_AND_FITNESS FOR
 *  A_PARTICULAR PURPOSE ARE DISCLAIMED. IN NO_EVENT SHALL THE COPYRIGHT
 *  OWNER OR CONTRIBUTORS_BE LIABLE FOR_ANY DIRECT, INDIRECT, INCIDENTAL,
 *