Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\mpi\generic_mpih-rshift.c Create Date:2022-07-28 07:18:30
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Shift U (pointed to by UP and USIZE limbs long) CNT bits to the right* and store the USIZE least significant limbs of the result at WP.* The bits shifted out to the right are returned.* Argument constraints:* 1. 0 < CNT < BITS_PER_MP_LIMB* 2

Proto:mpi_limb_t mpihelp_rshift(mpi_ptr_t wp, mpi_ptr_t up, mpi_size_t usize, unsigned cnt)

Type:mpi_limb_t

Parameter:

TypeParameterName
mpi_ptr_twp
mpi_ptr_tup
mpi_size_tusize
unsignedcnt
36  sh_1 = cnt
37  wp -= 1
38  sh_2 = BITS_PER_MPI_LIMB - sh_1
39  high_limb = up[0]
40  retval = high_limb << sh_2
41  low_limb = high_limb
42  When i < usize cycle
43  high_limb = up[i]
44  wp[i] = low_limb >> sh_1 | high_limb << sh_2
45  low_limb = high_limb
47  wp[i] = low_limb >> sh_1
49  Return retval
Caller
NameDescribe
mpi_powmRES = BASE ^ EXP mod MOD