Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:mpi_read_from_buffer

Proto:MPI mpi_read_from_buffer(const void *xbuffer, unsigned *ret_nread)

Type:MPI

Parameter:

TypeParameterName
const void *xbuffer
unsigned *ret_nread
83  buffer = xbuffer
87  If ret_nread < 2 Then Return ERR_PTR( - EINVAL)
89  nbits = buffer[0] << 8 | buffer[1]
91  If nbits > MAX_EXTERN_MPI_BITS Then
92  pr_info("MPI: mpi too large (%u bits)\n", nbits)
93  Return ERR_PTR( - EINVAL)
96  nbytes = DIV_ROUND_UP(nbits, 8)
97  If nbytes + 2 > ret_nread Then
98  pr_info("MPI: mpi larger than buffer nbytes=%u ret_nread=%u\n", nbytes, * ret_nread)
100  Return ERR_PTR( - EINVAL)
103  val = mpi_read_raw_data - Read a raw byte stream as a positive integer*@xbuffer: The data to read*@nbytes: The amount of data to read
104  If Not val Then Return ERR_PTR( - ENOMEM)
107  ret_nread = nbytes + 2
108  Return val
Caller
NameDescribe
digsig_verify_rsaRSA Signature verification with public key