BitPunch McEliece  v0.0.4
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
BitPunch McEliece v0.0.4

Introduction

Goal of BitPunch project is to make a standalone McEliece implementation. Current version is only develompent version, it is not suitable to use in real-life implementation. Our implementation of MECS uses Goppa codes. For ASN.1 we are using libtasn1 library (tested with version 3.4-3).

  • in Debian based distro install package:
    • apt-get install libtasn1-6 libtasn1-6-dev

I know, there is a lot of BUGS now. If you have any questions, ideas create new issue or contact me:

  • xuhreckyf [ you know what to put here ] stuba.sk

Where are the most important processes done?

Structure

Here is the basic structure overview.

Convention

Current version: 0.0.3

  • function name format: BPU_thisFunctionMakesMeDead
  • data types name format: BPU_T_This_Data_Type_Rocks
  • variable name format: four_your_information
  • all data types has prefix BPU_T_*
  • data types has also prefix, which are working with some general types:
    • BPU_T_GF2_*
    • BPU_T_GF2_16x_*
  • enumeration data types BPU_T_EN_* -enumeration etries BPU_EN_*
  • unoin data types BPU_T_UN_*

error codes definitions BPU_EC_*

  • all functions, macros has prefix BPU_*
    • there is also specific prefix for functions, which are working with kind of data:
      • BPU_gf2Vec*
      • BPU_gf2xVec*
      • BPU_gf2xPoly*
      • BPU_gf2Mat*
      • BPU_gf2xMat*
      • BPU_perm*
      • BPU_code*
      • BPU_goppa*
      • BPU_mecs*
      • BPU_math*
      • BPU_pad*
      • BPU_prng*
  • print functions stating with prefix: -BPU_print*

Modules

BitPunch has more modules, all sources are located in lib/src/bitpunch/:

  • asn1
    • is used for searializing key using libtasn1 (tested with version 3.4-3)

it uses DER encoding

  • math

contains all arithmetic operation over GF2, GF2x, polynomials, Matrices, Vectors, Permutations, ...

  • code

implements code matters, here you can specify your own codes

  • goppa

crypto

  • implements cryptosystem matters
  • mecsbasic, padding

prng

  • interface for PRNG

Contexts

There are 3 contexts:

  • Mecs context
    • this context registers encrypt, decrypt and key generation functions
  • Code context
    • this context registers encode, decode and code generation functions
  • Math context
    • speed up math operations over GF2x When you want to use MECS you just need to initialize context, using BPU_mecsInitCtx, see doc for more details.

Build

For build details go to lib/ and see makefile help. Now you can build test aplication, realease or debug, you can specify wheter you want to use precomputed H matrix (more memory) or not:

  • make help - it is make help
  • make print-info - info where is your aplication
  • make test - with H matrix
  • make test-debug - with H matrix
  • make test-wo-h - without H matrix
  • make test-with-debug - without H matrix
  • make static - to build static lib
  • make shared - to build shared lib

Builded libraries are located in dist/ folder. For more preprocesor options see lib/src/bitpunch/config.h file. Default optimization is -O2. To set up more verbosity define -DERRORL, -DWARNING_L or DDEBUG_L, this are using functions like BPU_printError(), BPU_printWarning(), BPU_printDebug().