Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:mpute roots of a degree 2 polynomial over GF(2^m)

Proto:static int find_poly_deg2_roots(struct bch_control *bch, struct gf_poly *poly, unsigned int *roots)

Type:int

Parameter:

TypeParameterName
struct bch_control *bch
struct gf_poly *poly
unsigned int *roots
573  n = 0
576  If polynomial terms [0] && polynomial terms [1] Then
578  l0 = a_log_tab[polynomial terms [0]]
579  l1 = a_log_tab[polynomial terms [1]]
580  l2 = a_log_tab[polynomial terms [2]]
583  u = a_pow(bch, l0 + l2 + 2 * (GF_N(bch) - l1))
590  r = 0
591  v = u
592  When v cycle
593  i = deg(v)
594  r ^= xi_tab[i]
595  v ^= 1 << i
598  If (gf_sqr(bch, r) ^ r) == u Then
600  roots[n++] = modulo(bch, 2 * GF_N(bch) - l1 - a_log_tab[r] + l2)
602  roots[n++] = modulo(bch, 2 * GF_N(bch) - l1 - a_log_tab[r ^ 1] + l2)
606  Return n
Caller
NameDescribe
find_poly_rootsd roots of a polynomial, using BTZ algorithm; see the beginning of this* file for details