@@ -416,15 +416,16 @@ private static BitArray GetVersionString(int version)
416
416
/// </summary>
417
417
private static byte [ ] CalculateECCWords ( BitArray bitArray , int offset , int count , ECCInfo eccInfo )
418
418
{
419
+ var eccWords = eccInfo . ECCPerBlock ;
419
420
// Calculate the message polynomial from the bit array data.
420
421
var messagePolynom = CalculateMessagePolynom ( bitArray , offset , count ) ;
421
422
// Generate the generator polynomial using the number of ECC words.
422
- var generatorPolynom = CalculateGeneratorPolynom ( eccInfo . ECCPerBlock ) ;
423
+ var generatorPolynom = CalculateGeneratorPolynom ( eccWords ) ;
423
424
424
425
// Adjust the exponents in the message polynomial to account for ECC length.
425
426
for ( var i = 0 ; i < messagePolynom . PolyItems . Count ; i ++ )
426
427
messagePolynom . PolyItems [ i ] = new PolynomItem ( messagePolynom . PolyItems [ i ] . Coefficient ,
427
- messagePolynom . PolyItems [ i ] . Exponent + eccInfo . ECCPerBlock ) ;
428
+ messagePolynom . PolyItems [ i ] . Exponent + eccWords ) ;
428
429
429
430
// Adjust the generator polynomial exponents based on the message polynomial.
430
431
for ( var i = 0 ; i < generatorPolynom . PolyItems . Count ; i ++ )
@@ -1042,10 +1043,10 @@ int[] GetNotUniqueExponents(List<PolynomItem> list)
1042
1043
if ( dic . TryAdd ( row . Exponent , false ) )
1043
1044
dic [ row . Exponent ] = true ;
1044
1045
#else
1045
- if ( ! dic . ContainsKey ( row . Exponent ) )
1046
- dic . Add ( row . Exponent , false ) ;
1047
- else
1048
- dic [ row . Exponent ] = true ;
1046
+ if ( ! dic . ContainsKey ( row . Exponent ) )
1047
+ dic . Add ( row . Exponent , false ) ;
1048
+ else
1049
+ dic [ row . Exponent ] = true ;
1049
1050
#endif
1050
1051
}
1051
1052
0 commit comments