Score:0

EC NIST P-256 FIPS-186-4 B.5.1 Per-Message Secret Number Generation Using Extra Random Bits operation

cn flag

I need to implement following operation:

w = (z mod (n-1)) + 1

where

z: 40-byte array

n: the order n of base point defined for NIST P-256.

I assume that resulted 'w' could be a point on the curve.

Any opinions are more than welcome

Daniel S avatar
ru flag
$w$ is not a point on the curve but rather a secret value corresponding to $k$ in section 4.5 of the DSS document. It should be used to compute a point $wG$ on the curve where $G$ is the base point. This is analogous to the calculation of $g^k$ in section 4.6 of the DSS document.
fgrieu avatar
ng flag
You need to interpret the byte array $z$ as an integer per the appropriate, system-dependent convention (in the context that would be big-endian binary if the data is in the form it has externally), reduce it modulo $(n-1)$ (where $n$ is the integer given in [D.1.2.3](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf#page=100)), then add $1$, yielding (pseudorandom) integer $z$ in the interval $[1,n-1]$. That's not a point. but $w\,G$ would be a pseudorandom point. Except for side-channel considerations, the rest is a programming problem, thus off-topic.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.