# How to convert d into 64bit limbs? [closed]

Given a d value = -(10240/10241)

How would I convert this into 64 bit limbs?

I have to expand on this because of stackoverflow quality algorithm, I've tried using python to get the integer rep/hex rep, but it's not a whole number, so I'm a bit lost

• What field are we working in? – Squeamish Ossifrage Apr 28 '19 at 16:01
• Any field, just want to see the process @SqueamishOssifrage – WeCanBeFriends Apr 28 '19 at 16:03
• Well, if you're talking about the rational numbers, it depends on how you encode them: as numerator/denominator fractions? as fixed-point? as floating-point? If you're talking about finite fields, look up modular multiplicative inverses. – Squeamish Ossifrage Apr 28 '19 at 16:05
• Trying to look up if this was about crypto (didn't hear about limbs before, I guess we normally just use "words"), I found this presentation Could you take a look at page 7 to see if it answers your question? – Maarten Bodewes Apr 28 '19 at 22:58

Assuming that this is related to the Jubjub Edwards curve, for which d = -(10240/10241) (mod r = 52435875175126190479447740508185965837690552500527637822603658699938581184513) = 19257038036680949359750312669786877991949435402254120286184196891950884077233, the four 64-bit limbs (in little-endian order) are:
(73851820219580081, 2967167836563676454, 17725484271033745364, 3067823152860638024)
• 73851820219580081 = d mod 2^64
• 2967167836563676454 = (d / 2^64) mod 2^64
• 17725484271033745364 = (d / 2^128) mod 2^64
• 3067823152860638024 = (d / 2^192) mod 2^64