History: enc_base

This page describes all changes made to the enc_base package, Embedded Encryption Manager, since its release.


1.27 (2019-10-11, 15:00):

  • Added 0 initialization to g_enc_config, because some compilers did not initialize global structures to zero.

1.26 (2019.04.29, 19:00):

  • MISRA 2012: violations eliminated (excluding big_num.c).

1.25 (2019-02-03, 23:55):

  • Removed obsolete configuration option READ_CHECK_ALIGNMENT from the configuration file.

1.24 (2019-01-07, 15:00):

  • Corrected reading of high and low 32 bits in sbn_mul_int().

1.23 r2 (2018-08-29, 18:24):

  • Document HTML link added to the documentation folder.
  • History and document files renamed to the package name.

1.23 (2018-07-18, 12:00)

  • Corrected sbn_div_int(), sbn_invmod(), sbn_gf_add(), sbn_inverse_modulo() to work in Big Endian mode.

1.22 (2018-01-19, 13:00):

  • Corrected typo in sbn_correct_len().

1.21 (2017-08-30, 9:30):

  • Added function enc_key_get_value() to read values from RSA/DSS keys.

1.20r2 (2017-06-08, 9:00):

  • Updated history file with release date.

1.20 (2017-06-06, 13:00):

  • Added functions for addition and multiply in Galois Field for GCM.
  • Added p_ecd_auth, ecd_auth_size fields to t_enc_cypher_data (needed by AEAD encryption algorithms).


  • enc_get_random_bytes(): corrected to small loop index.


  • Added const to buffers in t_enc_cypher_data structure.

1.17 r2:

  • Moved PSP template to psp_base_template module.


  • Barret reduction is now used only if modulus value has length that is power of 2.


  • Corrected possible use of uninitialized variable in sbn_div_int().
  • Get random bytes uses now RTC for generating seed value.


  • Added function sbn_add_fast().
  • Modified functions sbn_shl(), sbn_shr() to be able to take as input and output the same parameter.
  • Moved function declarations to the api file: sbn_get_bit(), sbn_sub_fast(), sbn_add_fast(), sbn_correct_len().


  • Optimized sbn_invers_modulo() ( it uses euclidean GCD algorithm for even modulus values and binary GCD algorithm for odd modulus value).
  • Corrected sbn_shr() function.
  • Corrected sbn_add() function.
  • Function sbn_shr() can now take as input and output the same Big number variable.
  • Corrected length of allocated buffers in sbn_div_int().


  • Function sbn_mul() is now visible to the user ( needed by RSA CRT ).


  • Corrected block division function sbn_div_block() - added second quotient correction.


Optimized functions:

  • sbn_div_int(): (algorithm based on long division).
  • sbn_modulo(): replaced by new division.
  • sbn_modular_multiplication(): replaced by multiply and modulo operation.


  • Optimized functions sbn_shl() and sbn_shr().


  • Corrected sbn_shr() for numbers of length smaller than 4 bytes.
  • bn_copy() and bn_get_length() functions are now visible for user.


  • Moved Big Number maximum size to configuration file.
  • Corrected sbn_compare() buffer index casting  (from uint8_t to uint16_t, index is of int16_t type).


  • Corrected handling of carry bit in big number add.


  • sbn_assign_be()/le_buff() added correction of Big number size.


  • Removed mutex protection from enc_init(), enc_start(), enc_stop(), enc_delete().
  • Code change in sbn_get_power_module() to enable passing the same parameter for input p_a and output p_r.
  • Removed setting '0' in  sbn_get_be_buf().


  • Code review.
  • Big number: Replaced aligned checking with PSP functions.
  • Simplified Big number allocation mechanism.
  • Modified stack get/put mechanism.


  • Big number: sbn_get_power_module checks in run time if it can use simple Barret method.


  • Big number Library updated to work under Big Endian architecture.


 Big number library changes:

  • new buffer allocation system.
  • added checking of alignment (all passed big numbers must have buffers aligned to 4 bytes and its length must be multiple of 4).
  • corrected some functions to work on DWORDS.


  • ver_big_num.h
  • ver_big_num_ifc.h
  • ver_enc_common.h
  • ver_sw_big_num.h

Moved big number library API to api_enc.h and configuration to config_enc.h.


  • Initial release.