logmod

版本 1.4.0.0 (22.6 KB) 作者: Steven Gregory
Computes y such that mod(a^y, p^N) == x
643.0 次下载
更新时间 2009/4/23

查看许可证

Suppose
p is an odd prime,
ord(a) = p-1
GCD(x, p) = 1
N is an integer >= 2

Then
y = logmod(x, a, p, N)

Returns y such that a^y = x (mod p^N)

Example
Let x= vpi(154), a = vpi(7), p = vpi(17), N = vpi(37)
y = logmod(x, a, p, N)
returns
y = 2088349219044680767324467844670001776975183904

引用格式

Steven Gregory (2024). logmod (https://www.mathworks.com/matlabcentral/fileexchange/23803-logmod), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2006a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Number Theory 的更多信息
致谢

参考作品: nextperm, modinv(x, N)

启发作品: modinv(x, N), nextperm, egcd.m

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.4.0.0

Brought the description up to date. This routine no longer needs the m-file modinv.m.

1.3.0.0

Modified to correct logic errors and to exploit the latest version of the vpi software. A Microsoft word file has been included that describes and proves the algorithm used.

1.2.0.0

Rewrote the description.

1.0.0.0