Skip to content

Commit

Permalink
doc: function help for MP_SIZE macro
Browse files Browse the repository at this point in the history
Includes warning to use 4K stack in any task calling into MPARITH.LIB.
  • Loading branch information
tomlogic committed May 1, 2019
1 parent b5b4d0f commit d516c50
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions Lib/Rabbit4000/Crypto/MPARITH.LIB
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,25 @@ END DESCRIPTION ***************************************************************/
#ifndef MPARITH_H
#define MPARITH_H

/* START FUNCTION DESCRIPTION ********************************************
MP_SIZE <MPARITH.LIB>

SYNTAX: #define MP_SIZE 258

DESCRIPTION: This MACRO controls the maximum key size supported by
MPARITH.LIB. Defined as the number of bytes in modulus,
plus 2 for temporary 16-bit carry out. Must be a multiple
of 4, plus 2.

130 : 1024-bit keys
258 : 2048-bit keys (default value)
514 : 4096-bit keys

An MP_SIZE of 514 increases stack usage in this library so
all uC/OS-II tasks calling into the library (including tasks
using TLS/SSL) should use a 4KB stack.
END DESCRIPTION **********************************************************/
#ifndef MP_SIZE
// Number of bytes in modulus, plus 2 for temporary 16-bit carry out
// Make this a multiple of 4, plus 2. The default, 258, specifies
// 2048-bit key lengths. This is the maximum key size supported;
// all shorter lengths are automatically supported.
// Use a value of 130 for 1024-bit keys, or 514 for 4096-bit keys.
#define MP_SIZE 258
#endif

Expand Down

0 comments on commit d516c50

Please sign in to comment.