iPXE
x25519_multiply_step2 Union Reference

X25519 multiplication step 2 result. More...

Public Member Functions

 bigint_t (bigint_required_size((260+7)/8)+bigint_required_size((6+7)/8))
 Raw product.

Data Fields

 parts

Detailed Description

X25519 multiplication step 2 result.

Step 2 of X25519 multiplication is to multiply the high-order 260 bits from step 1 with the 6-bit reduction constant 38, and to add this to the low-order 256 bits from step 1.

The multiplication inputs are limited to 260 and 6 bits respectively, and so the product will have at most 266 bits. After adding the low-order 256 bits from step 1, the result will have at most 267 bits.

Definition at line 145 of file x25519.c.

Member Function Documentation

◆ bigint_t()

x25519_multiply_step2::bigint_t ( bigint_required_size((260+7)/8)+bigint_required_size((6+7)/8) )
inline

Raw product.

Big integer multiplication produces a result with a number of elements equal to the sum of the number of elements in each input. Partition into low-order and high-order bits

Reduction modulo p requires separating the low-order 256 bits from the remaining high-order bits.

Since the value will never exceed 267 bits (see above), there will be at most 11 high-order bits.

Low-order 256 bits

High-order 11 bits

Definition at line 152 of file x25519.c.

168 {
169 /** Low-order 256 bits */
170 bigint_t ( bigint_required_size ( ( 256 /* bits */ + 7 ) / 8 ) )
171 low_256bit;
172 /** High-order 11 bits */
173 bigint_t ( bigint_required_size ( ( 11 /* bits */ + 7 ) / 8 ) )
174 high_11bit;
175 } __attribute__ (( packed )) parts;
#define __attribute__(x)
Definition compiler.h:10
#define bigint_t(size)
Define a big-integer type.
Definition bigint.h:20
#define bigint_required_size(len)
Determine number of elements required for a big-integer type.
Definition bigint.h:31
bigint_t(bigint_required_size((260+7)/8)+bigint_required_size((6+7)/8))
Raw product.
Definition x25519.c:152

References bigint_required_size, bigint_t, product, and value.

Field Documentation

◆ parts

x25519_multiply_step2::parts

Definition at line 175 of file x25519.c.

Referenced by x25519_multiply().


The documentation for this union was generated from the following file: