<html><body><span class="xfm_37261019"><pre>Hello all!<br/><br/>I searches simple solution for PAKE using only X25519 library.<br/>Unfortunately mostly all protocols requires group addition or/and elligator.<br/>Thanks Mike Humburg refers to inverse square root code and also AMBER <span class="xfmc1 xfmc2 xfmc3">Cryptography library</span> (https://github.com/bernedogit/amber) I successfully add elligator2 to ASM Cortex M0 uNaCl library, without long multiplication (https://munacl.cryptojedi.org/cortexm0.shtml) <br/>and also to forx25519-cortexm4 ASM library with long multiplication (https://github.com/weedegee/x25519-cortexm4 ).<br/>M0 code of isr() is about 400 bytes. This solve my problem.<br/><br/>But recently I re-read paper of Daniel J. Bernstein, Mike Hamburg, Anna Krasnova, Tanja Lange Elligator: Elliptic-curve points indistinguishable from uniform random strings (http://elligator.cr.yp.to/elligator-20130828.pdf) and find interest moment.<br/>On "2.7 Active attacks" authors refers to old paper of Colin Boyd , Paul Montague , Khanh Nguyen Elliptic Curve Based Password Authenticated Key Exchange Protocols (2001) <br/>(http://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=CC0144B723B43385A22CA617D53FEF15?doi=10.1.1.10.6273&rep=rep1&type=pdf)<br/>described EC-EKE protocol with compressed Edwards points.<br/><br/>DJB at all. said: "Our attack is to actively rerandomize one of the two points sent by Bob. If this point is on the same curve then Alice aborts; if this point is not on the same curve then Alice does not notice and communication continues."<br/><br/>I'm not sure, but this attack can be completely solved including all public values under hash: if Eva will modifies any value the authentificator will be wrong so Eva can not obtain was this work or dummy point. <br/><br/>I tried to rewrite Boyd at all. EC-EKE for Montgomery X25519, now it is not require any checking of point is on curve or on twist (so not need square root):<br/><br/>Let G is Montgomery generator on EC25519 curve and J - on it's twist. All multiplications are with standard X25519 procedure (i.e. *8). H is PRF (Keccak). <br/><br/>Alice is initiate and randomly select G or J for this session.<br/>Alice generate random a and compute X*a = G*a or J*a depends selecting, set bit 255 randomly. Now it is completely random string.<br/>Alice encrypt X*a by password, and send Enc(X*a) to Bob.<br/><br/>Bob decrypt Enc(X*a) to X*a by password.<br/>Bob generate random b and compute both G*b and J*b<br/>Bob compute secret Sb=X*a*b<br/>Bob compute authentificator Mb=H(Sb || Enc(X*a) || G*b || J*b)<br/>Bob sends to Alice: Mb, G*b, J*b<br/><br/>Alice compute two secrets S1=G*b*a and S2=J*b*a<br/>Alice compute two authentificators: M1=H(S1 || Enc(X*a) || G*b || J*b) and M2=H(S1 || Enc(X*a) || G*b || J*b)<br/>Alice checks either Mb ?= M1 or Mb ?= M2<br/>Alice compute her authentificator Ma=(S1 || G*b || J*b || Enc(X*a)) or Ma=(S2 || G*b || J*b || Enc(X*a)) depends M1 or M2 matched or set Ma as random if not matched<br/>Alice send Ma to Bob<br/><br/>Bob check Ma ?= H(Sb || G*b || J*b || Enc(X*a))<br/><br/>This seems safe against partition attack but I'm not sure...<br/>Van Gegel<br/></pre></span></body></html>