Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:solve a m x m linear system in GF(2) with an expected number of solutions,* and return the number of found solutions

Proto:static int solve_linear_system(struct bch_control *bch, unsigned int *rows, unsigned int *sol, int nsol)

Type:int

Parameter:

TypeParameterName
struct bch_control *bch
unsigned int *rows
unsigned int *sol
intnsol
445  m = GF_M(bch)
449  k = 0
450  mask = 1 << m
453  When c < m cycle
454  rem = 0
455  p = c - k
457  When r < m cycle
458  If rows[r] & mask Then
459  If r != p Then
460  tmp = rows[r]
461  rows[r] = rows[p]
462  rows[p] = tmp
464  rem = r + 1
465  Break
468  If rem Then
470  tmp = rows[p]
471  When r < m cycle
472  If rows[r] & mask Then rows[r] ^= tmp
475  Else
477  param[k++] = c
479  mask >>= 1
482  If k > 0 Then
483  p = k
484  When r >= 0 cycle
485  If r > m - 1 - k && rows[r] Then Return 0
489  rows[r] = If p && r == param[p - 1] Then p-- , 1u << m - r : rows[r - p]
494  If nsol != 1 << k Then Return 0
498  When p < nsol cycle
500  When c < k cycle rows[param[c]] = rows[param[c]] & ~1 | p >> c & 1
504  tmp = 0
505  When r >= 0 cycle
506  mask = rows[r] & (tmp | 1)
507  tmp |= parity(mask) << m - r
509  sol[p] = tmp >> 1
511  Return nsol
Caller
NameDescribe
find_affine4_rootshis function builds and solves a linear system for finding roots of a degree* 4 affine monic polynomial X^4+aX^2+bX+c over GF(2^m).