pyecsca.ec.scalar module¶
Provides functions for computing various scalar representations (like NAF, or different bases).
- pyecsca.ec.scalar.sliding_window_ltr(i, w)[source]¶
Compute the sliding-window left-to-right form.
From [BBG+17].
- pyecsca.ec.scalar.sliding_window_rtl(i, w)[source]¶
Compute the sliding-window right-to-left form.
From [BBG+17].
- pyecsca.ec.scalar.wnaf(k, w)[source]¶
Compute width w NAF (Non-Adjacent Form) of the scalar k.
Algorithm 9.35 from [GECC], Algorithm 9.20 from [HEHCC].
Note
According to HEHCC this is actually not unique
A left-to-right variant to compute an NAFw expansion of an integer can be found both in [AVA 2005a] and in [MUST 2005]. The result may differ from the expansion produced by Algorithm 9.20 but they have the same digit set and the same optimal weight.
According to GECC it is.
- pyecsca.ec.scalar.naf(k)[source]¶
Compute the NAF (Non-Adjacent Form) of the scalar k.
- Parameters:
k¶ (
int
) – The scalar.- Return type:
List
[int
]- Returns:
The NAF.
- pyecsca.ec.scalar.booth(k)[source]¶
Original Booth binary recoding, from [B51].
- Parameters:
k¶ (
int
) – The scalar to recode.- Return type:
List
[int
]- Returns:
The recoded list of digits (0, 1, -1), little-endian.