Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Multiply the natural numbers u (pointed to by UP, with USIZE limbs)* and v (pointed to by VP, with VSIZE limbs), and store the result at* PRODP. USIZE + VSIZE limbs are always stored, but if the input* operands are normalized

Proto:int mpihelp_mul(mpi_ptr_t prodp, mpi_ptr_t up, mpi_size_t usize, mpi_ptr_t vp, mpi_size_t vsize, mpi_limb_t *_result)

Type:int

Parameter:

TypeParameterName
mpi_ptr_tprodp
mpi_ptr_tup
mpi_size_tusize
mpi_ptr_tvp
mpi_size_tvsize
mpi_limb_t *_result
430  prod_endp = prodp + usize + vsize - 1
434  If vsize < sted 4, 16, 32 and 64, where 16 gave the best performance when* checking a 768 and a 1024 bit ElGamal signature.* (wk 22.12.97) Then
438  If Not vsize Then
439  _result = 0
440  Return 0
445  v_limb = vp[0]
446  If v_limb <= 1 Then
451  cy = 0
452  Else cy = mpihelp_mul_1(prodp, up, usize, v_limb)
455  prodp[usize] = cy
456  prodp++
460  When i < vsize cycle
461  v_limb = vp[i]
462  If v_limb <= 1 Then
463  cy = 0
464  If v_limb == 1 Then cy = mpihelp_add_n(prodp, prodp, up, usize)
467  Else cy = mpihelp_addmul_1(prodp, up, usize, v_limb)
470  prodp[usize] = cy
471  prodp++
474  _result = cy
475  Return 0
478  memset( & ctx, 0, sizeofctx)
479  If mpihelp_mul_karatsuba_case(prodp, up, usize, vp, vsize, & ctx) < 0 Then Return -ENOMEM
481  mpihelp_release_karatsuba_ctx( & ctx)
482  _result = prod_endp
483  Return 0
Caller
NameDescribe
mpihelp_mul_karatsuba_case
mpi_powmRES = BASE ^ EXP mod MOD