Architecture
[API]

Defines

#define C4E_ARCH_DIGIT_SIZE
 Size of C4eArchDigit, which is typically generated by the configure script.
#define C4E_CONST
 A portability wrapper for const.
#define C4E_INLINE
 A portability wrapper for inline.
#define C4E_RESTRICT
 A portability wrapper for C99 keyword restrict.
#define C4E_ARCH_ASM
 Indicates that assembly code shall be activated for an architecture.
#define C4E_ARCH_ROM(type, name)
 Defines a ROM (located) variable.
#define C4E_ARCH_DIGIT2_MSD(digit2)
 Determines the most significant part (digit) from an C4eArchDigit2 (the overflow of a C4eArchDigit operation).
#define C4E_ARCH_DIGIT2_LSD(digit2)
 Determines the least significant digit of a C4eArchDigit2.
#define C4E_ARCH_DIGIT2_ASGN(digit2, msd, lsd)
 Constructs a C4eArchDigit2 from two C4eArchDigit.
#define C4E_ARCH_DIGIT2_ADD(a, b, c)
 Sum of three C4eArchDigit resulting in a C4eArchDigit2.
#define C4E_ARCH_DIGIT2_MUL(a, b)
 Product of two C4eArchDigit resulting in a C4eArchDigit2.
#define C4E_ARCH_DIGIT2_DIV(a, b)
 Division of a C4eArchDigit2 by a C4eArchDigit resulting in a C4eArchDigit2.

Typedefs

typedef unsigned int C4eArchUint
 Natural (integral, unsigned) number type of CPU/MCU architecture.
typedef uint32_t C4eArchDigit
 One digit, to be used in multi-precision (big number) or binary polynomial arithmetic.
typedef uint64_t C4eArchDigit2
 Number type to be used for the result of a product (sometimes sum) of two digits of type C4eArchDigit.
typedef C4eArchUint C4eArchIdx
 Type for the index into an elements digit array, countable in C4eArchDigit units.
typedef size_t C4eArchSize
 Type for counting bytes and bits, for example buffer sizes and key lengths.
typedef uint8_t C4eArchUint8
 Type for a single byte (octet).

Define Documentation

#define C4E_ARCH_DIGIT_SIZE

Size of C4eArchDigit, which is typically generated by the configure script.

Customize:
In case the configure script is not used to generate c4e_config.h then you (possibly) have to adopt define C4E_ARCH_DIGIT_SIZE by hand.
Note:
Define C4E_ARCH_DIGIT_SIZE is defined in Autoconf output file c4e_config.h, but not commented in Doxygen style.

Definition at line 11 of file c4e_config.h.

#define C4E_ARCH_ROM ( type,
name   ) 

Defines a ROM (located) variable.

Customize:
Variables declared with this macro are constants and therefore can be located in ROM. Customize this macro depending on your compiler/linker and platform.
Parameters:
[in] type The type of variable to be defined.
[in] name Name of variable.

Definition at line 283 of file c4e_arch.h.

#define C4E_ARCH_DIGIT2_MSD ( digit2   ) 

Determines the most significant part (digit) from an C4eArchDigit2 (the overflow of a C4eArchDigit operation).

Customize:
Sometimes it is faster (but less portable) to use a C4eArchDigit based array index access regarding defines C4E_ARCH_LITTLE_ENDIAN/C4E_ARCH_BIG_ENDIAN.
Parameters:
[in] digit2 A C4eArchDigit2 number.
Returns:
The most significant part (digit) of digit2 as a C4eArchDigit type.

Definition at line 300 of file c4e_arch.h.

#define C4E_ARCH_DIGIT2_LSD ( digit2   ) 

Determines the least significant digit of a C4eArchDigit2.

Customize:
Sometimes it is faster (but less portable) to use C4eArchDigit based array index access regarding defines C4E_ARCH_LITTLE_ENDIAN/C4E_ARCH_BIG_ENDIAN.
Parameters:
[in] digit2 A C4eArchDigit2 number.
Returns:
The least significant part (digit) of digit2 as a C4eArchDigit type.

Definition at line 318 of file c4e_arch.h.

#define C4E_ARCH_DIGIT2_ASGN ( digit2,
msd,
lsd   ) 

Constructs a C4eArchDigit2 from two C4eArchDigit.

Customize:
Customize the method to construct a C4eArchDigit2 from two C4eArchDigit (representing least/most significant part) on demand.
Parameters:
[out] digit2 Variable of type C4eArchDigit2, to which the values msd and lsd shall be assigned.
[in] msd The most significant digit (of type C4eArchDigit).
[in] lsd The least significant digit (of type C4eArchDigit).
Returns:
A C4eArchDigit2 number constructed from two C4eArchDigit, lsd and msd.

Definition at line 337 of file c4e_arch.h.

#define C4E_ARCH_DIGIT2_ADD ( a,
b,
 ) 

Sum of three C4eArchDigit resulting in a C4eArchDigit2.

Parameters:
[in] a First C4eArchDigit summand.
[in] b Second C4eArchDigit summand.
[in] c Third C4eArchDigit summand, typically carry.
Returns:
Result of a + b + c, a C4eArchDigit2 number.

Definition at line 351 of file c4e_arch.h.

#define C4E_ARCH_DIGIT2_MUL ( a,
 ) 

Product of two C4eArchDigit resulting in a C4eArchDigit2.

Parameters:
[in] a First C4eArchDigit multiplier.
[in] b Second C4eArchDigit multiplier.
Returns:
Result of a * b, a C4eArchDigit2 number.

Definition at line 364 of file c4e_arch.h.

#define C4E_ARCH_DIGIT2_DIV ( a,
 ) 

Division of a C4eArchDigit2 by a C4eArchDigit resulting in a C4eArchDigit2.

Parameters:
[in] a Dividend, a C4eArchDigit2.
[in] b Divisor, a C4eArchDigit.
Returns:
Result of a / b, a C4eArchDigit2 number.

Definition at line 378 of file c4e_arch.h.


Typedef Documentation

typedef unsigned int C4eArchUint

Natural (integral, unsigned) number type of CPU/MCU architecture.

Customize:
This type typically targets the architecture register width. It must be unsigned, typically declared as unsigned int. In case the configure script is not used to generate c4e_config.h then you (possibly) have to adopt define C4E_ARCH_UINT_SIZE by hand.

Definition at line 186 of file c4e_arch.h.

typedef uint32_t C4eArchDigit

One digit, to be used in multi-precision (big number) or binary polynomial arithmetic.

Attention:
All bytes in a C4eArchDigit must be byte-wise accessible / addressable.
Customize:
This type must be an unsigned integer type, for which basic arithmetic is provided. Typically it targets the architecture register width. All arithmetic on this type must be modulo 256^C4E_ARCH_DIGIT_SIZE, means saturation arithmetic is not allowed. In case the configure script is not used to generate c4e_config.h then you (possibly) have to adopt define C4E_ARCH_DIGIT_SIZE by hand.
See also:
C4eArchDigit2

Definition at line 207 of file c4e_arch.h.

typedef uint64_t C4eArchDigit2

Number type to be used for the result of a product (sometimes sum) of two digits of type C4eArchDigit.

Customize:
This type must have twice the size of one C4eArchDigit. Division by a C4eArchDigit must be supported. Saturation arithmetic is not allowed.
See also:
C4eArchDigit

Definition at line 221 of file c4e_arch.h.

typedef size_t C4eArchSize

Type for counting bytes and bits, for example buffer sizes and key lengths.

Customize:
Customize this type equivalent to size_t or C4eArchUint (if width enough).

Definition at line 238 of file c4e_arch.h.

typedef uint8_t C4eArchUint8

Type for a single byte (octet).

Customize:
Customize this type equivalent to unsigned char, resp. the ISO C99 (POSIX) type uint8_t.

Definition at line 248 of file c4e_arch.h.