Elliptic-Curves

edwards448 生成器是如何從 RFC 7748 中的 curve448 生成器派生而來的?

  • September 9, 2022

RFC 7748中,解釋了蒙哥馬利曲線,curve448,是如何從素數確定性生成的 $ p = 2^{448} - 2^{224} - 1 $ . 它還解釋瞭如何導出曲線 448 的生成器(如下所示)。

   U(P)  5

   V(P)  355293926785568175264127502063783334808976399387714271831880898
         435169088786967410002932673765864550910142774147268105838985595290
         606362

RFC 7748 還定義了 Edwards 曲線 edwards448,並指出從 curve448 到 edwards448 存在同源性(為 curve448 –> edwards448 和 edwards448 –> curve448 定義了顯式轉換)。

給出了 edwards448 的以下生成器:

  X(P)  224580040295924300187604334099896036246789641632564134246125461
        686950415467406032909029192869357953282578032075146446173674602635
        247710

  Y(P)  298819210078481492676017930443930673437544040154080242095928241
        372331506189835876003536878655418784733982303233503462500531545062
        832660

有人可以解釋如何從 U(P),V(P) 計算 X(P),Y(P) 嗎?

將 U(P),V(P) 插入轉換曲線 448 –> edwards448 不會產生 X(P),Y(P) (也許它會在具有 X(P),Y(P) 的等價類中產生一些點但我不確定如何檢查)。但是,如果將 X(P),Y(P) 代入轉換 edwards448 –> curve448,則得到 U(P),V(P)。

如果有幫助,RFC 7748 中給出的映射在下面顯示為 sage 程式碼:

p =  2^448 - 2^224 - 1


# edwards448 --> curve448
def getU(x,y):
   u = mod(y^2/x^2, p)
   return u

def getV(x,y):
   v = mod((2 - x^2 - y^2)*y/x^3, p)
   return v

# curve448 --> edwards448
def getX(u,v):
   x = mod(4*v*(u^2 - 1)/(u^4 - 2*u^2 + 4*v^2 + 1), p)
   return x

def getY(u,v):
   y = mod(-(u^5 - 2*u^3 - 4*u*v^2 + u)/(u^5 - 2*u^2*v^2 - 2*u^3 - 2*v^2 + u), p)
   return y

# edwards448 generator
Gx = 224580040295924300187604334099896036246789641632564134246125461686950415467406032909029192869357953282578032075146446173674602635247710
Gy = 298819210078481492676017930443930673437544040154080242095928241372331506189835876003536878655418784733982303233503462500531545062832660

# curve448 generator
Gu = 5
Gv = 355293926785568175264127502063783334808976399387714271831880898435169088786967410002932673765864550910142774147268105838985595290606362

它不像你期望的那樣工作。

這是 4 度同源,不是同構或雙有理等價。一張完整的地圖 $ toMonty(toEdwards(P)) $ 不會讓你到達起點 $ (P) $ ,它會讓你 $ 4*P $ 由於同源性的程度。

所以,地圖從 $ x,y $ 至 $ u,v $ 像你期望的那樣工作,因為 edwards448 上的點是專門選擇匹配的,但是逆映射會將你移動到 $ 4*P $ 而不是 $ P $ .

這是使用您的公式獲取愛德華茲座標的聖人程式碼 $ 4^{-1}G $ 符合愛德華茲的觀點

#define the Montgomery curve. Montgomery curves are natively supported in sage so better to use this instead of Edwards
p = 2^448-2^224-1
F = GF(p)
d = -39081
E = EllipticCurve(F,[0,2-4*d,0,1,0])
#define the base point on Montgomery
curve448_basepoint = E([5,355293926785568175264127502063783334808976399387714271831880898435169088786967410002932673765864550910142774147268105838985595290606362])

#define the order of the point
order = 2^446 - 0x8335dc163bb124b65129c96fde933d8d723a70aadc873d6d54a7bb0d

#Multiply the generator by 4^-1
P = curve448_basepoint*inverse_mod(4,order)

#now use your formulas to get the edwards coordinates
def getX(u,v):
   x = 4*v*(u^2 - 1)/(u^4 - 2*u^2 + 4*v^2 + 1)
   return x

def getY(u,v):
   y = -(u^5 - 2*u^3 - 4*u*v^2 + u)/(u^5 - 2*u^2*v^2 - 2*u^3 - 2*v^2 + u)
   return y

#and verify it matches the expected value (the point multiplied by 4)
assert getX(P.xy()[0],P.xy()[1])==224580040295924300187604334099896036246789641632564134246125461686950415467406032909029192869357953282578032075146446173674602635247710
assert getY(P.xy()[0],P.xy()[1])==298819210078481492676017930443930673437544040154080242095928241372331506189835876003536878655418784733982303233503462500531545062832660

引用自:https://crypto.stackexchange.com/questions/101796