@@ -457,9 +457,9 @@ std::string LocateErrors(const std::string& str, std::vector<int>& error_locatio
457457 int s2 = syn >> 20 ;
458458
459459 // 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) ;
463463
464464 // First, suppose there is only a single error. Then E(x) = e1*x^p1 for some position p1
465465 // 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
494494 // (Because we are working in characteristic 2.)
495495 // = e2*(e)^(998*p2) ((e)^p2 + (e)^p1)
496496 //
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 ) );
498498 if (s2_s1p1 == 0 ) continue ;
499- int l_s2_s1p1 = GF1024_LOG[ s2_s1p1] ;
499+ int l_s2_s1p1 = GF1024_LOG. at ( s2_s1p1) ;
500500
501501 // Similarly, s1 + s0*(e)^p1
502502 // = 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 ) );
504504 if (s1_s0p1 == 0 ) continue ;
505- int l_s1_s0p1 = GF1024_LOG[ s1_s0p1] ;
505+ int l_s1_s0p1 = GF1024_LOG. at ( s1_s0p1) ;
506506
507507 // So, putting these together, we can compute the second error position as
508508 // (e)^p2 = (s2 + s1^p1)/(s1 + s0^p1)
@@ -515,12 +515,12 @@ std::string LocateErrors(const std::string& str, std::vector<int>& error_locatio
515515 // Now we want to compute the error values e1 and e2.
516516 // Similar to above, we compute s1 + s0*(e)^p2
517517 // = 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 ) );
519519 if (s1_s0p2 == 0 ) continue ;
520- int l_s1_s0p2 = GF1024_LOG[ s1_s0p2] ;
520+ int l_s1_s0p2 = GF1024_LOG. at ( s1_s0p2) ;
521521
522522 // 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)) ;
524524
525525 // Then (s1 + s0*(e)^p1) * (1/((e)^p1 + (e)^p2)))
526526 // = e2*(e)^(997*p2)
0 commit comments