All pastes #811430 Raw Edit

Someone

public text v1 · immutable
·published 2007-12-10 22:18 UTC
rendered paste body

void ec_enc_uint64(ec_enc *_this,ec_uint64 _fl,ec_uint64 _ft){
   ec_uint64 mask;
   ec_uint64 ft;
   unsigned  fl;
   int       ftb;
   _ft--;
   ftb=ec_ilog64(_ft);
   while(ftb>EC_UNIT_BITS){
      ftb-=EC_UNIT_BITS;
      ft=(_ft>>ftb)+1;
      fl=(unsigned)(_fl>>ftb);
      ec_encode(_this,fl,fl+1,ft);
      if(fl<ft-1){
         ec_enc_bits(_this,_fl,ftb);
         return;
      }
      mask=((ec_uint64)1<<ftb)-1;
      _fl=_fl&mask;
      _ft=_ft&mask;
   }
   ec_encode(_this,_fl,_fl+1,_ft+1);
}