-1
$\begingroup$

From 2.5.1 in this paper, how is

$p$ = FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE FFFFFFFF 00000000 00000000 FFFFFFFF

= $2^{384} − 2^{128} − 2^{96} + 2^{32} − 1$

derived?

$\endgroup$
  • 3
    $\begingroup$ What are you asking ? The conversion ? If so that's just hexadecimal representation of a positive number (there is no two's complement) $\endgroup$ – Ruggero Jan 4 '18 at 12:52
  • $\begingroup$ Using big endian representation, of course. You don't have to derive anything: WolframAlpha al rescate. $\endgroup$ – Maarten Bodewes Jan 4 '18 at 16:08
0
$\begingroup$

To have a signed 2-complement representation then you have to left pad the value with a single 00 valued byte. Generally API's will already view hexadecimals as positive unless they are preceded with a minus sign.

E.g. in Java:

// read value from string
BigInteger x = new BigInteger("FF...FF");
// signed byte representation, with additional zero valued byte to the left
byte[] encX = x.toByteArray();
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.