Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update include and using of modules - use only one of this options #2

Open
fepaul-book opened this issue Nov 15, 2023 · 0 comments
Open

Comments

@fepaul-book
Copy link

In the project are several modules with dependencies shown below
All modules export some functions, but when a module is used by another module most of the modules are not only imported by using the "using" statement but also "include" the module

using statement:
allows to access exported functions without module prefix e.g. encrypt
if a function is not exported you can only access it by module_name.function_name e.g. McEliece.encrypt
include statement:
makes content of this file available in current file - as if the code was written in this file - there exports and stuff like that does not
matter at all
--> using "include" and "using" on same file is bad practice and should be updated

Overview of dependancies

Misc [self-contained]
InvalidCodewordError, - defines new Exception called InvalidCodewordError
string2bits, - Takes a plaintext and returns its binary representation
- with as much padding as needed to make its length divisible by k.
bits2string - Returns the string that msg represents.

ExtensionField [self-contained]
primitivePolynomials, - dictionary of irreducible polynomials for given degree
add, - add polynomials
multiply, - in GF(2)
divide, - only quotient in GF(2) with extended Euclidean
modulo, - only remainder
power, - x^n modulo g in GF(2^m)
inverse, - of a mod g
squareroot, - of p in GF(2^m)
polygcd - of polynomials

FiniteFieldMatrix [ExtensionField Random Nemo LinearAlgebra]
multiplyPolyMatrices!, - Multiplies two matrices in GF(2^m)
gaussianEliminationColumnPivoting!, - Applies Gauss-Jordan elimination
- to matrix H of dimension nxk.
- It also permutes a given code support
- to keep a coherent goppa code.
GeneratorInverse!, - Finds the right inverse of a generator matrix.
getPermutation, - Returns a random permutation matrix of dimension nxn.
getScrambler - Returns a random binary non-singular matrix of dimension kxk.

Polynomials [ExtensionField]
PolynomialConstants, - defines 0, 1, x as polynomial
monomial, - Returns a monomial of the given degree.
evaluate!, - Evaluates p(x) modulo g(x).
addRing!, - Adds two polynomials with coefficients in GF(2^m).
multiplyRing!, - Multiplies two polynomials with coefficients in GF(2^m).
divRing!, - Returns the quotient of a/b with coefficients in GF(2^m).
modRing!, - Returns the remainder of a/b with coefficients in GF(2^m).
makePolynomialMonic!, - Returns p as a monic polynomial by dividing p by the
- inverse of its leading coefficient.
inverseRing!, - Computes the inverse of a mod g with coefficients in GF(2^m).
- Throws an exception if the inverse doesn't exist.
isPolynomialIrreducible!, - Checks if the given polynomial has at least one root in GF(2^m).
- TODO: is irreducible the right term here? i guess not
- Returns true if it doesn't have roots, false otherwise.
randomPoly, - Returns a random monic irreducible polynomial of degree t
- over the extension field GF(2^m).
splitPolynomial! - Splits the polynomial p into even and odd terms in GF(2^m).

Goppa [Misc ExtensionField FiniteFieldMatrix Polynomials StatsBase LinearAlgebra DelimitedFiles]
generateGoppaCode, - Generates a (n, k) irreducible linear Goppa code with minimum
- distance d >= 2t + 1. Returns the generator matrix G, the goppa
- polynomial, the code support, and the number of rows k of G.
- return G, goppaPolynomial, codeSupport, k
decode! - Given a msg with noise, finds a codeword in the goppa code defined
- by the goppaPolynomial and codeSupport in GF(2^m)

McEliece [Misc FiniteFieldMatrix GoppaCode Random StatsBase DelimitedFiles]
generateKeys,
saveKeys,
encrypt, - enc returns array of ciphertexts of length k
decrypt,
haltingCheck

Test [McEliece DelimitedFiles]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant