2
$\begingroup$

try to implement the AugPake protocol in java using BigInteger.

I am having some difficulty computing $K=Y^z \mod p$ because $z$ is always $0$, for $z={1\over x+(w*r)} \mod q$. Being a ratio between $1$ and a very large number $z$ will be always zero using the BigInteger.

Can help me to understand how to compute $z$? Maybe I misunderstood some of the document.


Thanks for your reponse.

To compute Z i use the extended Euclidean algorithm: ax + qy = gdc(a,b)

Thanks a lot

$\endgroup$
  • $\begingroup$ Please note that the BigInteger.modInverse function, as most BigInteger-methods, does not run with constant time, so your implementation will be vulnerable to timing attacks. $\endgroup$ – VincBreaker Jan 15 '18 at 16:51
3
$\begingroup$

This is not ordinary real-valued division.

The computation you are looking at is done in the field $\mathbb F_q$ instead of $\mathbb R$, that is $1/x$ actually is the modular multiplicative inverse of $x\bmod q$.

| improve this answer | |
$\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.