linux/lib/mpi/generic_mpih-lshift.c
n va.12/spa v3 .12/formv3 .12a n va.1 href="../linux+v3.7.7/lib/mpi/generic_mpih-lshift.c">n va.12img src="../.static/gfx/right.png" alt=">>">n 2/spa v3n 2spa class="lxr_search">n va ="+search" method="post" onsubmit="return do_search(this);">n va.12input typ hidden" nam navtarget" n> ">n va.12input typ text" nam search" id search">n va.12butttiotyp submit">Searchn va.1Prefs3 .12/a>n 2/spa v3va.1 12/divv3va.1 12form ac> ="ajax+*" method="post" onsubmit="return false;">n 2input typ hidden" nam ajax_lookup" id ajax_lookup" n> ">nva.1 12/formv3nva.1 12div class="headingbotttm">3 2div id file_contents"v
1 112/a>2spa  class="comment">/* mpihelp-lshift.c  -  MPI helper func>
  s2/spa v31 122/a>2spa  class="comment"> * Copyright (C) 1994, 1996, 1998, 2001 Free Software Founda>
  , Inc.2/spa v31 132/a>2spa  class="comment"> *2/spa v31 142/a>2spa  class="comment"> * This file is part of GnuPG.2/spa v31 152/a>2spa  class="comment"> *2/spa v31 162/a>2spa  class="comment"> * GnuPG is free software; you ca  redistribute it and/or modify2/spa v31 172/a>2spa  class="comment"> * it under the terms of the GNU General Public License as published by2/spa v31 182/a>2spa  class="comment"> * the Free Software Founda>
  ; either versptio2 of the License, or2/spa v31 192/a>2spa  class="comment"> * (at your   >
  ) any later verspti.2/spa v31 10"
a>2spa  class="comment"> *2/spa v31 112/a>2spa  class="comment"> * GnuPG is distributed in the hope that it will be useful,2/spa v31 122/a>2spa  class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of2/spa v31 132/a>2spa  class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the2/spa v31 142/a>2spa  class="comment"> * GNU General Public License for more details.2/spa v31 152/a>2spa  class="comment"> *2/spa v31 162/a>2spa  class="comment"> * You should have received a copy of the GNU General Public License2/spa v31 172/a>2spa  class="comment"> * along with this program; if not, write to the Free Software2/spa v31 182/a>2spa  class="comment"> * Founda>
  , Inc., 59 Temple Place - Suite 330, Bost  , MA 02111-1307, USA2/spa v31 192/a>2spa  class="comment"> *2/spa v31 20"
a>2spa  class="comment"> * Note: This code is heavily based on the GNU MP Library.2/spa v31 212/a>2spa  class="comment"> *       Actually it's the sam  code with only minor changes in the2/spa v31 222/a>2spa  class="comment"> *       way the da>a is st red; this is to support the abstrac>
  2/spa v31 232/a>2spa  class="comment"> *       of a    >
  al secure memory alloca>
   which may be used2/spa v31 242/a>2spa  class="comment"> *       to avoid revealing of sensitive da>a due to paging etc.2/spa v31 252/a>2spa  class="comment"> *       The GNU MP Library itself is published under the LGPL;2/spa v31 262/a>2spa  class="comment"> *       however I decided to publish this code under the plain GPL.2/spa v31 272/a>2spa  class="comment"> */2/spa v31 282/a>31 292/a>#include "mpi-inter al.h2/a>"31 302/a>31 312/a>2spa  class="comment">/* Shift U (pointed to by UP and USIZE digits long) CNT bits to the left2/spa v31 322/a>2spa  class="comment"> * and st re the USIZE least significant digits of the result at WP.2/spa v31 332/a>2spa  class="comment"> * Return the bits shifted out from the most significant digit.2/spa v31 342/a>2spa  class="comment"> *2/spa v31 352/a>2spa  class="comment"> * Argument constraints:2/spa v31 362/a>2spa  class="comment"> * 1. 0 < CNT < BITS_PER_MP_LIMB2/spa v31 372/a>2spa  class="comment"> * 2. If the result is to be written over the input, WP must be >= UP.2/spa v31 382/a>2spa  class="comment"> */2/spa v31 392/a>31 40"
a>2a href="+code=mpi_limb_t" class="sref">mpi_limb_t2/a>31 41"
a>2a href="+code=mpihelp_lshift" class="sref">mpihelp_lshift"
a>(2a href="+code=mpi_ptr_t" class="sref">mpi_ptr_t"
a> 2a href="+code=wp" class="sref">wp"
a>, 2a href="+code=mpi_ptr_t" class="sref">mpi_ptr_t"
a> 2a href="+code=up" class="sref">up"
a>, 2a href="+code=mpi_size_t" class="sref">mpi_size_t"
a> 2a href="+code=usize" class="sref">usize"
a>, unsigned int 2a href="+code=cnt" class="sref">cnt"
a>)31 422/a>{31 432/a>        2a href="+code=mpi_limb_t" class="sref">mpi_limb_t2/a> 2a href="+code=high_limb" class="sref">high_limb"
a>, 2a href="+code=low_limb" class="sref">low_limb"
a>;31 442/a>        unsigned 2a href="+code=sh_1" class="sref">sh_1"
a>, 2a href="+code=sh_2" class="sref">sh_2"
a>;31 452/a>        2a href="+code=mpi_size_t" class="sref">mpi_size_t"
a> 2a href="+code=i" class="sref">i"
a>;31 462/a>        2a href="+code=mpi_limb_t" class="sref">mpi_limb_t2/a> 2a href="+code=retval" class="sref">retval"
a>;31 472/a>31 482/a>        2a href="+code=sh_1" class="sref">sh_1"
a> = 2a href="+code=cnt" class="sref">cnt"
a>;31 492/a>        2a href="+code=wp" class="sref">wp"
a> += 1;31 502/a>        2a href="+code=sh_2" class="sref">sh_2"
a> = 2a href="+code=BITS_PER_MPI_LIMB" class="sref">BITS_PER_MPI_LIMB"
a> - 2a href="+code=sh_1" class="sref">sh_1"
a>;31 512/a>        2a href="+code=i" class="sref">i"
a> = 2a href="+code=usize" class="sref">usize"
a> - 1;31 522/a>        2a href="+code=low_limb" class="sref">low_limb"
a> = 2a href="+code=up" class="sref">up"
a>[2a href="+code=i" class="sref">i"
a>];31 532/a>        2a href="+code=retval" class="sref">retval"
a> = 2a href="+code=low_limb" class="sref">low_limb"
a> >> 2a href="+code=sh_2" class="sref">sh_2"
a>;31 542/a>        2a href="+code=high_limb" class="sref">high_limb"
a> = 2a href="+code=low_limb" class="sref">low_limb"
a>;31 552/a>        while (--2a href="+code=i" class="sref">i"
a> >= 0) {31 562/a>                2a href="+code=low_limb" class="sref">low_limb"
a> = 2a href="+code=up" class="sref">up"
a>[2a href="+code=i" class="sref">i"
a>];31 572/a>                2a href="+code=wp" class="sref">wp"
a>[2a href="+code=i" class="sref">i"
a>] = (2a href="+code=high_limb" class="sref">high_limb"
a> << 2a href="+code=sh_1" class="sref">sh_1"
a>) | (2a href="+code=low_limb" class="sref">low_limb"
a> >> 2a href="+code=sh_2" class="sref">sh_2"
a>);31 582/a>                2a href="+code=high_limb" class="sref">high_limb"
a> = 2a href="+code=low_limb" class="sref">low_limb"
a>;31 592/a>        }31 602/a>        2a href="+code=wp" class="sref">wp"
a>[2a href="+code=i" class="sref">i"
a>] = 2a href="+code=high_limb" class="sref">high_limb"
a> << 2a href="+code=sh_1" class="sref">sh_1"
a>;31 612/a>31 622/a>        return 2a href="+code=retval" class="sref">retval"
a>;31 632/a>}31 642/a>2/pre>
The origi al LXR software by the LXR community"
a>, this experimental versptioby lxr@linux.no"
a>.
2/divv32div class="subfooter">
lxr.linux.no kindly hosted by Redpill Linpro AS"
a>, provider of Linux consulting and opera>
  s services since 1995.
2/divv3
2/bodyv32/htmlv3