@@ -457,9 +457,9 @@ std::string LocateErrors(const std::string& str, std::vector<int>& error_locatio
457
457
int s2 = syn >> 20 ;
458
458
459
459
// Get the discrete logs of these values in GF1024 for more efficient computation
460
- int l_s0 = GF1024_LOG[s0] ;
461
- int l_s1 = GF1024_LOG[s1] ;
462
- int l_s2 = GF1024_LOG[s2] ;
460
+ int l_s0 = GF1024_LOG. at (s0) ;
461
+ int l_s1 = GF1024_LOG. at (s1) ;
462
+ int l_s2 = GF1024_LOG. at (s2) ;
463
463
464
464
// First, suppose there is only a single error. Then E(x) = e1*x^p1 for some position p1
465
465
// Then s0 = E((e)^997) = e1*(e)^(997*p1) and s1 = E((e)^998) = e1*(e)^(998*p1)
@@ -494,15 +494,15 @@ std::string LocateErrors(const std::string& str, std::vector<int>& error_locatio
494
494
// (Because we are working in characteristic 2.)
495
495
// = e2*(e)^(998*p2) ((e)^p2 + (e)^p1)
496
496
//
497
- int s2_s1p1 = s2 ^ (s1 == 0 ? 0 : GF1024_EXP[( l_s1 + p1) % 1023 ] );
497
+ int s2_s1p1 = s2 ^ (s1 == 0 ? 0 : GF1024_EXP. at (( l_s1 + p1) % 1023 ) );
498
498
if (s2_s1p1 == 0 ) continue ;
499
- int l_s2_s1p1 = GF1024_LOG[ s2_s1p1] ;
499
+ int l_s2_s1p1 = GF1024_LOG. at ( s2_s1p1) ;
500
500
501
501
// Similarly, s1 + s0*(e)^p1
502
502
// = e2*(e)^(997*p2) ((e)^p2 + (e)^p1)
503
- int s1_s0p1 = s1 ^ (s0 == 0 ? 0 : GF1024_EXP[( l_s0 + p1) % 1023 ] );
503
+ int s1_s0p1 = s1 ^ (s0 == 0 ? 0 : GF1024_EXP. at (( l_s0 + p1) % 1023 ) );
504
504
if (s1_s0p1 == 0 ) continue ;
505
- int l_s1_s0p1 = GF1024_LOG[ s1_s0p1] ;
505
+ int l_s1_s0p1 = GF1024_LOG. at ( s1_s0p1) ;
506
506
507
507
// So, putting these together, we can compute the second error position as
508
508
// (e)^p2 = (s2 + s1^p1)/(s1 + s0^p1)
@@ -515,12 +515,12 @@ std::string LocateErrors(const std::string& str, std::vector<int>& error_locatio
515
515
// Now we want to compute the error values e1 and e2.
516
516
// Similar to above, we compute s1 + s0*(e)^p2
517
517
// = e1*(e)^(997*p1) ((e)^p1 + (e)^p2)
518
- int s1_s0p2 = s1 ^ (s0 == 0 ? 0 : GF1024_EXP[( l_s0 + p2) % 1023 ] );
518
+ int s1_s0p2 = s1 ^ (s0 == 0 ? 0 : GF1024_EXP. at (( l_s0 + p2) % 1023 ) );
519
519
if (s1_s0p2 == 0 ) continue ;
520
- int l_s1_s0p2 = GF1024_LOG[ s1_s0p2] ;
520
+ int l_s1_s0p2 = GF1024_LOG. at ( s1_s0p2) ;
521
521
522
522
// And compute (the log of) 1/((e)^p1 + (e)^p2))
523
- int inv_p1_p2 = 1023 - GF1024_LOG[ GF1024_EXP[p1] ^ GF1024_EXP[p2]] ;
523
+ int inv_p1_p2 = 1023 - GF1024_LOG. at ( GF1024_EXP. at (p1) ^ GF1024_EXP. at (p2)) ;
524
524
525
525
// Then (s1 + s0*(e)^p1) * (1/((e)^p1 + (e)^p2)))
526
526
// = e2*(e)^(997*p2)
0 commit comments