Skip to content

Commit

Permalink
chore(math): fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
chokobole committed Oct 24, 2024
1 parent 0975448 commit 3d80407
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tachyon/math/finite_fields/extension_field_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ class ExtensionFieldBase {
using PackedField = typename PackedFieldTraits<BaseField>::PackedField;
constexpr uint32_t kDegree = T::ExtensionDegree();

// if |PackedField::N| = 8:
// |first_n_powers[i]| = {1, aᵢ, ..., a⁷ᵢ}
// if |PackedField::N| = 8,
// |first_n_powers| = [ 1, b, b², b³,..., b⁶, b⁷ ], where b is an extension
// field of |base|.
ExtendedPackedField first_n_powers;
T pow = T::One();
for (size_t i = 0; i < PackedField::N; ++i) {
Expand All @@ -80,15 +81,17 @@ class ExtensionFieldBase {
pow *= base;
}

// |multiplier[j]| = {a⁸ⱼ, a⁸ⱼ, ..., a⁸ⱼ, a⁸ⱼ}
// |multiplier| = [ b⁸, b⁸, ..., b⁸, b⁸ ], where b is an extension field of
// |base|. #|multiplier| = 8
ExtendedPackedField multiplier;
for (size_t i = 0; i < PackedField::N; ++i) {
for (uint32_t j = 0; j < kDegree; ++j) {
multiplier[j][i] = pow[j];
}
}

// |ret[i]| = {(a⁸ᵢ)ⁱ, aᵢ * (a⁸ᵢ)ⁱ, ..., a⁷ᵢ * (a⁸ᵢ)ⁱ}
// |ret[i]| = [ b⁸ⁱ, b⁸ⁱ⁺¹, ..., b⁸ⁱ⁺⁶, b⁸ⁱ⁺⁷ ], where b is an extension
// field of |base|.
std::vector<ExtendedPackedField> ret;
ret.reserve(size);
ret.emplace_back(first_n_powers);
Expand Down

0 comments on commit 3d80407

Please sign in to comment.