public abstract class WNafUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
PRECOMP_NAME |
Constructor and Description |
---|
WNafUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
configureBasepoint(ECPoint p) |
static int[] |
generateCompactNaf(BigInteger k) |
static int[] |
generateCompactWindowNaf(int width,
BigInteger k) |
static byte[] |
generateJSF(BigInteger g,
BigInteger h) |
static byte[] |
generateNaf(BigInteger k) |
static byte[] |
generateWindowNaf(int width,
BigInteger k)
Computes the Window NAF (non-adjacent Form) of an integer.
|
static int |
getNafWeight(BigInteger k) |
static int |
getWindowSize(int bits)
Determine window width to use for a scalar multiplication of the given size.
|
static int |
getWindowSize(int bits,
int maxWidth)
Determine window width to use for a scalar multiplication of the given size.
|
static int |
getWindowSize(int bits,
int[] windowSizeCutoffs)
Determine window width to use for a scalar multiplication of the given size.
|
static int |
getWindowSize(int bits,
int[] windowSizeCutoffs,
int maxWidth)
Determine window width to use for a scalar multiplication of the given size.
|
static WNafPreCompInfo |
getWNafPreCompInfo(ECPoint p) |
static WNafPreCompInfo |
getWNafPreCompInfo(PreCompInfo preCompInfo) |
static WNafPreCompInfo |
precompute(ECPoint p,
int minWidth,
boolean includeNegated) |
static WNafPreCompInfo |
precomputeWithPointMap(ECPoint p,
ECPointMap pointMap,
WNafPreCompInfo fromWNaf,
boolean includeNegated) |
public static final String PRECOMP_NAME
public static void configureBasepoint(ECPoint p)
public static int[] generateCompactNaf(BigInteger k)
public static int[] generateCompactWindowNaf(int width, BigInteger k)
public static byte[] generateJSF(BigInteger g, BigInteger h)
public static byte[] generateNaf(BigInteger k)
public static byte[] generateWindowNaf(int width, BigInteger k)
width
- The width w
of the Window NAF. The width is
defined as the minimal number w
, such that for any
w
consecutive digits in the resulting representation, at
most one is non-zero.k
- The integer of which the Window NAF is computed.k = ∑i=0l-1 ki2i
, where the ki
denote the elements of the
returned byte[]
.public static int getNafWeight(BigInteger k)
public static WNafPreCompInfo getWNafPreCompInfo(ECPoint p)
public static WNafPreCompInfo getWNafPreCompInfo(PreCompInfo preCompInfo)
public static int getWindowSize(int bits)
bits
- the bit-length of the scalar to multiply bypublic static int getWindowSize(int bits, int maxWidth)
bits
- the bit-length of the scalar to multiply bymaxWidth
- the maximum window width to returnpublic static int getWindowSize(int bits, int[] windowSizeCutoffs)
bits
- the bit-length of the scalar to multiply bywindowSizeCutoffs
- a monotonically increasing list of bit sizes at which to increment the window widthpublic static int getWindowSize(int bits, int[] windowSizeCutoffs, int maxWidth)
bits
- the bit-length of the scalar to multiply bywindowSizeCutoffs
- a monotonically increasing list of bit sizes at which to increment the window widthmaxWidth
- the maximum window width to returnpublic static WNafPreCompInfo precompute(ECPoint p, int minWidth, boolean includeNegated)
public static WNafPreCompInfo precomputeWithPointMap(ECPoint p, ECPointMap pointMap, WNafPreCompInfo fromWNaf, boolean includeNegated)
Copyright © 2021 BouncyCastle.org. All rights reserved.