枫师司令部
Maple division command
我一直在尝试使用 maple 从给定的雅可比坐标中找到仿射坐标,但我无法正确执行除法和 mod 函数。下面是代码。
> x := convert("9BAE2D5BAC61E6EA5DE635BCA754B2564B7D78C45277CAD67E45C4CBBEA6E706", decimal, hex);
7041623596977247007669265857371148522199703362600663731937152060\
0331187054342
> y := convert("34FB8147EED1C0FBE29EAD4D6C472EB4EF7B2191FDE09E494B2A9845FE3F605E", decimal, hex);
print(`output redirected...`); # input placeholder
23964639004174789156012647374812775627552779006284114197031881030909921550430
> P = convert("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F", decimal, hex);
P = 115792089237316195423570985008687907853269984665640564039457584007908834671663
> z := convert("C327B5D2636B32F27B051E4742B1BBD5324432C1000BFEDCA4368A29F6654152", decimal, hex);
88271167397410887906404620526072296461301967675745183033087652951303987216722
> pxaffine := x/z^2 mod p;
modp(35208117984886235038346329286855742610998516813003318659685\
760300165593527171/3895899496850867432972229541307004669958561\
04445384115473225358287940086633208436094051269966956339075604\
3250895513211480436277854984163960587194098212642, p) // this is returned as a result while i expect a whole number value
xa := convert(pxaffine,hex);
//下面是发现的错误
Error, invalid input: convert/hex expects its 1st argument, n, to be of type nonnegint, but received modp(35208117984886235038346329286855742610998516813003318659685760300165593527171/3895899496850867432972229541307004669958561044453841154732253582879400866332084360940512699669563390756043250895513211480436277854984163960587194098212642, p)
当然,我会得到这个错误,因为 pxaffine 中的值无效,,,现在我的问题是为什么这个命令 "pxaffine := x/z^2 mod p;" 不起作用?
小写名称 p
未在代码中的任何位置赋值,因此以下命令不会产生整数结果(即 returns 未计算),
x/z^2 mod p;
您的以下代码行没有将整数分配给小写 p
。它甚至不分配给大写 P
因为它使用 =
而不是 :=
.
P = convert("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F", decimal, hex);
也许您打算将其实际分配给小写 p
,即
p := convert("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F", decimal, hex);
现在让我们试试这个例子,不包括对 y
的赋值,它没有在其他任何地方使用。这是我得到的(输出缩进):
x := convert("9BAE2D5BAC61E6EA5DE635BCA754B2564B7D78C45277CAD67E45C4CBBEA6E706", decimal, hex);
x := 70416235969772470076692658573711485221997033626006637319371520600331187054342
p := convert("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F", decimal, hex);
p := 115792089237316195423570985008687907853269984665640564039457584007908834671663
z := convert("C327B5D2636B32F27B051E4742B1BBD5324432C1000BFEDCA4368A29F6654152", decimal, hex);
z := 88271167397410887906404620526072296461301967675745183033087652951303987216722
pxaffine := x/z^2 mod p;
pxaffine := 103388573995635080359749164254216598308788835304023601477803095234286494993683
xa := convert(pxaffine,hex);
xa := E493DBF1C10D80F3581E4904930B1404CC6C13900EE0758474FA94ABE8C4CD13
我一直在尝试使用 maple 从给定的雅可比坐标中找到仿射坐标,但我无法正确执行除法和 mod 函数。下面是代码。
> x := convert("9BAE2D5BAC61E6EA5DE635BCA754B2564B7D78C45277CAD67E45C4CBBEA6E706", decimal, hex);
7041623596977247007669265857371148522199703362600663731937152060\
0331187054342
> y := convert("34FB8147EED1C0FBE29EAD4D6C472EB4EF7B2191FDE09E494B2A9845FE3F605E", decimal, hex);
print(`output redirected...`); # input placeholder
23964639004174789156012647374812775627552779006284114197031881030909921550430
> P = convert("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F", decimal, hex);
P = 115792089237316195423570985008687907853269984665640564039457584007908834671663
> z := convert("C327B5D2636B32F27B051E4742B1BBD5324432C1000BFEDCA4368A29F6654152", decimal, hex);
88271167397410887906404620526072296461301967675745183033087652951303987216722
> pxaffine := x/z^2 mod p;
modp(35208117984886235038346329286855742610998516813003318659685\
760300165593527171/3895899496850867432972229541307004669958561\
04445384115473225358287940086633208436094051269966956339075604\
3250895513211480436277854984163960587194098212642, p) // this is returned as a result while i expect a whole number value
xa := convert(pxaffine,hex);
//下面是发现的错误 Error, invalid input: convert/hex expects its 1st argument, n, to be of type nonnegint, but received modp(35208117984886235038346329286855742610998516813003318659685760300165593527171/3895899496850867432972229541307004669958561044453841154732253582879400866332084360940512699669563390756043250895513211480436277854984163960587194098212642, p)
当然,我会得到这个错误,因为 pxaffine 中的值无效,,,现在我的问题是为什么这个命令 "pxaffine := x/z^2 mod p;" 不起作用?
小写名称 p
未在代码中的任何位置赋值,因此以下命令不会产生整数结果(即 returns 未计算),
x/z^2 mod p;
您的以下代码行没有将整数分配给小写 p
。它甚至不分配给大写 P
因为它使用 =
而不是 :=
.
P = convert("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F", decimal, hex);
也许您打算将其实际分配给小写 p
,即
p := convert("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F", decimal, hex);
现在让我们试试这个例子,不包括对 y
的赋值,它没有在其他任何地方使用。这是我得到的(输出缩进):
x := convert("9BAE2D5BAC61E6EA5DE635BCA754B2564B7D78C45277CAD67E45C4CBBEA6E706", decimal, hex);
x := 70416235969772470076692658573711485221997033626006637319371520600331187054342
p := convert("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F", decimal, hex);
p := 115792089237316195423570985008687907853269984665640564039457584007908834671663
z := convert("C327B5D2636B32F27B051E4742B1BBD5324432C1000BFEDCA4368A29F6654152", decimal, hex);
z := 88271167397410887906404620526072296461301967675745183033087652951303987216722
pxaffine := x/z^2 mod p;
pxaffine := 103388573995635080359749164254216598308788835304023601477803095234286494993683
xa := convert(pxaffine,hex);
xa := E493DBF1C10D80F3581E4904930B1404CC6C13900EE0758474FA94ABE8C4CD13