瀏覽代碼

:fire_engine: phan happy

codemasher 5 年之前
父節點
當前提交
902486edc3
共有 2 個文件被更改,包括 3 次插入2 次删除
  1. 2 1
      src/Common/GF256.php
  2. 1 1
      src/Common/GenericGFPoly.php

+ 2 - 1
src/Common/GF256.php

@@ -37,7 +37,8 @@ final class GF256{
 #	private int $primitive = 0x011D;
 
 	private const logTable = [
-		null,  0,   1,  25,   2,  50,  26, 198,   3, 223,  51, 238,  27, 104, 199,  75,
+		  0, // the first value is never returned, index starts at 1
+		       0,   1,  25,   2,  50,  26, 198,   3, 223,  51, 238,  27, 104, 199,  75,
 		  4, 100, 224,  14,  52, 141, 239, 129,  28, 193, 105, 248, 200,   8,  76, 113,
 		  5, 138, 101,  47, 225,  36,  15,  33,  53, 147, 142, 218, 240,  18, 130,  69,
 		 29, 181, 194, 125, 106,  39, 249, 185, 201, 154,   9, 120,  77, 228, 114, 166,

+ 1 - 1
src/Common/GenericGFPoly.php

@@ -31,7 +31,7 @@ final class GenericGFPoly{
 	private array $coefficients;
 
 	/**
-	 * @param array|null $coefficients array coefficients as ints representing elements of GF(size), arranged
+	 * @param array      $coefficients array coefficients as ints representing elements of GF(size), arranged
 	 *                                 from most significant (highest-power term) coefficient to least significant
 	 * @param int|null   $degree
 	 *