-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathdilog.htm
418 lines (418 loc) · 27 KB
/
dilog.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
<!doctype html>
<html lang="en" prefix="og: http://ogp.me/ns# article: http://ogp.me/ns/article#">
<head>
<meta charset="utf-8">
<meta name="Author" content="Dario Alejandro Alpern">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Web application that finds discrete logarithms. Written by Dario Alpern.">
<meta name="theme-color" content="#db5945">
<meta name="twitter:card" content="summary_large_image">
<meta property="og:title" content="Discrete logarithm calculator">
<meta property="og:type" content="article">
<meta property="og:site_name" content="Alpertron">
<meta property="og:url" content="https://www.alpertron.com.ar/DILOG.HTM">
<meta property="og:image" content="https://www.alpertron.com.ar/dilog.png">
<meta property="og:image:width" content="895">
<meta property="og:image:height" content="465">
<meta property="og:image:alt" content="Screenshot">
<meta property="og:locale" content="en_US">
<meta property="og:locale:alternate" content="es_ES">
<meta property="og:description" content="Web application that finds discrete logarithms.">
<meta property="article:published_time" content="2025-03-08">
<meta property="fb:app_id" content="1495228927625175">
<link rel="alternate" hreflang="es" href="https://www.alpertron.com.ar/LOGDI.HTM">
<link rel="alternate" hreflang="en" href="https://www.alpertron.com.ar/DILOG.HTM">
<link rel="manifest" href="dilog.webmanifest">
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="apple-touch-icon" href="dilog-icon-180px.png">
<link rel="canonical" href="https://www.alpertron.com.ar/DILOG.HTM">
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Q7PH40GPHC"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-Q7PH40GPHC');
</script>
<title>Discrete logarithm calculator</title>
<style>
@media only screen {
nav {background-color:#000080; width:100%; margin:0px; text-align:center}
nav ul {padding:0; margin:0 auto; list-style:none; display:inline-block}
nav li {float:left; position:relative; display:block; margin-top:0px; margin-bottom:0px; margin-left:5px; margin-right:5px; background-color:#000080; color:#FFFFFF; cursor: pointer; text-align:left}
nav li[aria-expanded="true"] {background-color:#004000; color:#FFFFFF}
nav li ul {display:none; position:absolute}
nav li[aria-expanded="true"] ul.alignleft {display:block; height:auto}
nav li[aria-expanded="true"] ul.alignright {display:block; height:auto; right:0px; background-color:#004000}
nav li ul li {clear:both; white-space: nowrap; border:0px; background-color:#004000; width:100%; padding-top:1em; padding-bottom:0.5em}
nav a:link{color:#FFFFFF; text-decoration:none}
nav a:visited{color:#FFFFFF; text-decoration:none}
nav a:hover{background-color:#004000; color:#FFFFFF; text-decoration:none}
nav a:active{background-color:#004000; color:#FFFFFF; text-decoration:none}
nav li ul li a:link{background-color:#004000; color:#FFFFFF; display:block; width:100%}
nav li ul li a:visited{background-color:#004000;color:#FFFFFF; display:block; width:100%}
nav li ul li a:hover{background-color:#FFFFFF; color:#004000; display:block; width:100%}
nav li ul li a:active{background-color:#FFFFFF; color:#004000; display:block; width:100%}
nav::after {clear:both}
.inputfbck{width: calc(100% - 10em);float:right;padding:3px;margin:0px;}
@media (max-width: 400px) { nav { font-size:0.7em;} }
@media (min-width: 400px) { nav { font-size:1em;} }
@media (min-width: 500px) {#formleft {float:left;width:50%;} #formright {float:right;width:50%;}}
}
@media only print {nav, #footer {display:none;}}
.modal-header {padding: 2px 10px; background-color: #5cb85c; color: white}
.modal-body {padding: 2px 10px}
.modal-content {
position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
background-color: #fefefe;
padding: 0;
border: 1px solid #888;
width: 80%;
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
}
.modal {
display: none;
position: fixed;
z-index: 1;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgb(0,0,0);
background-color: rgba(0,0,0,0.4);
}
input {min-height:2em; border-radius:10px}
#close {float:right}
#modal-header-text {font-size:1.5em}
#sending, #sentOK, #notSent {display:none}
.center {text-align:center}
#skip a {padding:6px; position:absolute; top:-40px; left:0px; color:white; border-right:1px solid white; border-bottom:1px solid white; border-bottom-right-radius:8px; background:#BF1722; transition:top 1s ease-out; z-index:100}
#skip a:focus {position:absolute; left:0px; top:0px; outline-color:transparent; transition: top .1s ease-in}
.bread {padding:0px;list-style:none; display:inline-block;}
.bread li {display:inline}
.bread li+li:before {content:"›"}
.pad, #footer {padding:10px}
.new {color: #0000FF; font-weight:bold}
body {font-family: Arial, sans-serif; margin: 0; padding: 0;}
main {padding:10px;}
h1, .h2title {text-align:center}
input[type=text], input[type=email], input[type=number] {min-height:2em; border-radius:10px}
input[type=button], button {min-height:2.5em; min-width:2.5em; border-radius:5px}
#actions button {color: white; background-color: #3b3b3b; min-height:100%; border-radius:10px}
#actbtn {display:flex; flex-flow:row wrap; justify-content:space-around; min-height:3em}
#funcbtns {display:flex; justify-content:space-around; flex-flow:row wrap; margin-top:3px; margin-bottom:3px}
#funcbtns button {min-height:2.5em; min-width:2.5em; margin:3px}
fieldset {border-radius:10px}
.hex {font-family: Courier, "Lucida Console", monospace}
.lf,.labels {padding:0.2em; clear:both;}
.applet {margin-left: auto;margin-right: auto; border: 0px none;width:90%;text-align:center;background-color:#c0c0c0;padding:10px;border-radius:10px}
#valueapp {display:grid}
.atright {float:right;}
#feedback {display:none}
@media (min-width: 400px) { .input{width: calc(100% - 7em);float:right;padding:3px;margin:0px;}}
@media (max-width: 400px) { .input{width:100%;padding:3px;margin:0px;}}
@media (max-width: 53em) {
#actions {grid-column:1/3; grid-row:1}
#inputs {grid-column:1/3; grid-row:2}
#functions {grid-column:1/3; grid-row:3}
}
@media (min-width: 53em) {
#inputs {grid-column:1/3; grid-row:1}
#actions {grid-column:1; grid-row:2; width:320px}
#functions {grid-column:2/3; grid-row:2}
}
@media screen and (prefers-color-scheme: dark) {
body {color: #ddd; background-color: #121212}
.applet {background-color:#606060; color: #fff}
a {color: #a3d4a7}
a:link,a:active {color: #a3d4a7}
a:hover {color: #f5cba7}
a:visited {color: #d7bde2}
input, textarea {color: white; background-color: #3b3b3b}
button:disabled {color: #808080; background-color: #606060}
.new {color: #E0E000}
}
</style>
<noscript>
<style>
.applet {display:none}
</style>
</noscript>
</head>
<body>
<div id="skip"><a href="#main">Skip to main content</a></div>
<nav aria-label="Main navigation">
<ul role="menubar">
<li role="menuitem" aria-haspopup="true" aria-expanded="false" tabindex="0">Electronics
<ul role="menu" class="alignleft popup">
<li role="menuitem"><a href="INTEL.HTM" hreflang="es" title="All Intel microprocessors from the 4004 up to Pentium (Spanish only)">Intel Microprocessors</a></li>
</ul>
</li>
<li role="menuitem" aria-haspopup="true" aria-expanded="false" tabindex="-1">Mathematics
<ul role="menu" class="alignleft popup">
<li role="menuitem"><a href="CALTORS.HTM" title="Web applications with JavaScript and WebAssembly implementing calculators">Calculators</a></li>
<li role="menuitem"><a href="NUMBERT.HTM" title="Articles and programs about number theory">Number Theory</a></li>
<li role="menuitem"><a href="PROBLEMS.HTM" title="Interesting math problems">Problems</a></li>
</ul>
</li>
<li role="menuitem" aria-haspopup="true" aria-expanded="false" tabindex="-1">Programs
<ul role="menu" class="alignright popup">
<li role="menuitem"><a href="ASSEM386.HTM" title="Programs written in 80386 Assembler">Assembler 80386</a></li>
<li role="menuitem"><a href="JAVAPROG.HTM" title="Web applications with JavaScript and WebAssembly">Web applications</a></li>
<li role="menuitem"><a href="GAMES.HTM" title="Computer games">Games</a></li>
</ul>
</li>
<li class="alignright" role="menuitem" aria-haspopup="true" aria-expanded="false" tabindex="-1">Contact
<ul role="menu" class="alignright popup">
<li role="menuitem"><a href="EPERS.HTM" title="Personal information">Personal</a></li>
<li role="menuitem"><a href="FORM.HTM" title="Form to send comments">Comments</a></li>
<li role="menuitem"><a href="EGBOOK.HTM" title="Old and new guestbook">Guestbook</a></li>
<li role="menuitem"><a href="PRIVACY.HTM" title="Privacy Policy">Privacy</a></li>
<li role="menuitem"><a href="DONATION.HTM" title="Donations to the author of this Web site">Donations</a></li>
</ul>
</li>
</ul>
<ul class="atright"><li><a href="LOGDI.HTM" hreflang="es" title="Esta página Web en español">ESP</a></li></ul>
</nav>
<main id="main">
<article>
<h1>Discrete logarithm calculator</h1>
<ol class="bread" vocab="https://schema.org/" typeof="BreadcrumbList">
<li property="itemListElement" typeof="ListItem">
<a property="item" typeof="WebPage" href="ENGLISH.HTM"><span property="name">Alpertron</span></a>
<meta property="position" content="1">
</li>
<li property="itemListElement" typeof="ListItem">
<a property="item" typeof="WebPage" href="JAVAPROG.HTM"><span property="name">Web applications</span></a>
<meta property="position" content="2">
</li>
<li property="itemListElement" typeof="ListItem">
<span property="name">Discrete logarithm calculator</span>
<meta property="position" content="3">
</li>
</ol>
<noscript><p><strong>The calculator does not work with Javascript disabled. Please check your browser settings.</strong></p></noscript>
<div class="applet" id="valueapp">
<div id="inputs">
<label for="base">Base</label><input type="text" inputmode="numeric" id="base" value="" class="input">
<div class="lf"></div>
<label for="pow">Power</label><input type="text" inputmode="numeric" id="pow" value="" class="input">
<div class="lf"></div>
<label for="mod">Modulus</label><input type="text" inputmode="numeric" id="mod" value="" class="input">
</div>
<fieldset id="actions"><legend>Actions</legend>
<div id="actbtn">
<button type="button" id="dlog" title="Compute exponent from base, power and modulus">Discrete<br>logarithm</button>
<button type="button" id="stop" title="Stop calculation">Stop</button>
<button type="button" id="helpbtn" title="Read information about this calculator">Help</button>
<button type="button" id="config" title="Change parameters used in the application">Config</button>
<button type="button" id="clrinput" title="Erase input boxes contents">Clear<br>input</button>
</div>
</fieldset>
<fieldset id="functions"><legend>Functions</legend>
<label for="funccat">Category:</label>
<select id="funccat">
<optgroup label="Functions or operators">
<option value="0" selected>Basic Math</option>
<option value="1">Comparisons</option>
<option value="2">Logic</option>
<option value="3">Divisibility</option>
<option value="4">Recreational Math</option>
<option value="5">Number Theory</option>
<option value="6">Other</option>
</optgroup>
</select>
<span id="funcbtns">
<button type="button">(</button><button type="button">)</button><button type="button">+</button><button type="button">-</button><button type="button">*</button><button type="button">/</button><button type="button">%</button><button type="button">^</button><button type="button">ans</button><button type="button">sqrt(</button><button type="button">iroot(</button><button type="button">Random(</button><button type="button">Abs(</button><button type="button">Sign(</button>
</span>
</fieldset>
</div>
<div id="help" aria-live="polite" class="pad">
<p>This web application computes discrete logarithms.</p>
<p>The discrete logarithm problem is to find the exponent in the expression <var>Base</var><sup><var>Exponent</var></sup> = <var>Power</var> (mod <var>Modulus</var>).</p>
<p>This applet works for both prime and composite moduli. The only restriction is that the base and the modulus, and the power and the modulus must be relatively prime.</p>
<p>In this version of the discrete logarithm calculator only the Pohlig-Hellman algorithm is implemented, so the execution time is proportional to the square root of the largest prime factor of the modulus minus 1.
The applet works in a reasonable amount of time if this factor is less than <span role="math" aria-label="10 raised to the power of 17">10<sup>17</sup></span>.</p>
<p>I will add the index-calculus algorithm soon. This algorithm has subexponential running time.</p>
<h2>Expressions</h2>
<p>You can also enter expressions that use the following operators and parentheses:</p>
<ul>
<li><strong>+</strong> for addition</li>
<li><strong>-</strong> for subtraction</li>
<li><strong>*</strong> for multiplication</li>
<li><strong>/</strong> for division</li>
<li><strong>%</strong> for remainder</li>
<li><strong>^</strong> or <strong>**</strong> for exponentiation</li>
<li> <strong><</strong>, <strong>==</strong>, <strong>></strong>; <strong><=</strong>, <strong>>=</strong>, != for comparisons. The operators return zero for false and -1 for true.</li>
<li> <strong>Ans</strong>: retrieves the last answer.</li>
<li> <strong>AND</strong>, <strong>OR</strong>, <strong>XOR</strong>, <strong>NOT</strong> for binary logic. The operations are done in binary (base 2). Positive (negative) numbers are prepended with an infinite number of bits set to zero (one).</li>
<li> <strong>SHL</strong> or <strong><<</strong>: When <var>b</var> ≥ 0, <var>a</var> SHL <var>b</var> shifts <var>a</var> left the number of bits specified by <var>b</var>. This is equivalent to <var>a</var> × 2<sup><var>b</var></sup>. Otherwise, <var>a</var> SHL <var>b</var> shifts <var>a</var> right the number of bits specified by −<var>b</var>. This is equivalent to floor(<var>a</var> / 2<sup>−<var>b</var></sup>). Example: 5 SHL 3 = 40.</li>
<li> <strong>SHR</strong> or <strong>>></strong>: When <var>b</var> ≥ 0, <var>a</var> SHR <var>b</var> shifts <var>a</var> right the number of bits specified by <var>b</var>. This is equivalent to floor(<var>a</var> / 2<sup><var>b</var></sup>). Otherwise, <var>a</var> SHR <var>b</var> shifts <var>a</var> left the number of bits specified by −<var>b</var>. This is equivalent to <var>a</var> × 2<sup>−<var>b</var></sup>. Example: -19 SHR 2 = -5.</li>
<li> <strong>n!</strong>: factorial (<var>n</var> must be greater than or equal to zero). Example: 6! = 6 × 5 × 4 × 3 × 2 = 720.</li>
<li> <strong>n!! ... !</strong>: multiple factorial (<var>n</var> must be greater than or equal to zero). It is the product of <var>n</var> times <var>n</var> − <var>k</var> times <var>n</var> − <var>2k</var> ... (all numbers greater than zero) where <var>k</var> is the number of exclamation marks. Example: 7!! = 7 × 5 × 3 × 1 = 105.</li>
<li> <strong>p#</strong>: primorial (product of all primes less or equal than <var>p</var>). Example: 12# = 11 × 7 × 5 × 3 × 2 = 2310.</li>
<li> <strong>B(n)</strong>: Previous probable prime before <em>n</em>. Example: B(24) = 23.</li>
<li> <strong>F(n)</strong>: Fibonacci number F<sub>n</sub> from the sequence 0, 1, 1, 2, 3, 5, 8, 13, 21, etc. where each element equals the sum of the previous two members of the sequence. Example: F(7) = 13.</li>
<li> <strong>L(n)</strong>: Lucas number L<sub>n</sub> = F<sub><var>n</var>-1</sub> + F<sub><var>n</var>+1</sub></li>
<li> <strong>N(n)</strong>: Next probable prime after <em>n</em>. Example: N(24) = 29.</li>
<li> <strong>P(n)</strong>: Unrestricted Partition Number (number of decompositions of <var>n</var> into sums of integers without regard to order). Example: P(4) = 5 because the number 4 can be partitioned in 5 different ways: 4 = 3+1 = 2+2 = 2+1+1 = 1+1+1+1.</li>
<li> <strong>Gcd(m,n, ...)</strong>: Greatest common divisor of these integers. Example: GCD(12, 16) = 4.</li>
<li> <strong>Lcm(m,n, ...)</strong>: Least common multiple of these integers. Example: LCM(12, 16, 24) = 48.</li>
<li> <strong>FloorDiv(m,n)</strong>: integer part of the quotient of <var>m</var> divided by <var>n</var>. Examples: floordiv(10, 7) = 1 and floordiv(-10, 7) = -2.</li>
<li> <strong>Mod(m,n)</strong>: value of <var>m</var> modulo the absolute value of <var>n</var>. Examples: Mod(10, 7) = 3 and Mod(-10, 7) = 4.</li>
<li> <strong>Modinv(m,n)</strong>: inverse of <var>m</var> modulo <var>n</var>, only valid when <var>m</var> and <var>n</var> are coprime, meaning that they do not have common factors. Example: Modinv(3,7) = 5 because 3 × 5 ≡ 1 (mod 7)</li>
<li> <strong>Modpow(m,n,r)</strong>: finds <var>m</var><sup><var>n</var></sup> modulo <var>r</var>. Example: Modpow(3, 4, 7) = 4, because 3<sup>4</sup> ≡ 4 (mod 7).</li>
<li> <strong>Totient(n)</strong>: finds the number of positive integers less than <var>n</var> which are relatively prime to <var>n</var>. Example: Totient(6) = 2 because 1 and 5 do not have common factors with 6.</li>
<li> <strong>Jacobi(m,n)</strong>: obtains the Jacobi symbol of <var>m</var> and <var>n</var>. When the second argument is prime, the result is zero when <var>m</var> is multiple of <var>n</var>, it is one if there is a solution of <var>x</var>² ≡ <var>m</var> (mod <var>n</var>) and it is equal to −1 when the mentioned congruence has no solution.</li>
<li> <strong>Random(m,n)</strong>: integer random number between <var>m</var> and <var>n</var>.</li>
<li> <strong>Abs(n)</strong>: absolute value of <var>n</var>.</li>
<li> <strong>Sign(n)</strong>: returns zero if <var>n</var> is zero, −1 if negative or 1 if positive.</li>
<li> <strong>IsPrime(n)</strong>: returns zero if <var>n</var> is not probable prime, −1 if it is. Example: IsPrime(5) = −1.</li>
<li> <strong>Sqrt(n)</strong>: Integer part of the square root of the argument.</li>
<li> <strong>Iroot(n, r)</strong>: Integer r-root of the first argument. Example: Iroot(8, 3) = 2.</li>
<li> <strong>NumDigits(n,r)</strong>: Number of digits of <var>n</var> in base <var>r</var>. Example: NumDigits(13, 2) = 4 because 13 in binary (base 2) is expressed as 1101.</li>
<li> <strong>SumDigits(n,r)</strong>: Sum of digits of <var>n</var> in base <var>r</var>. Example: SumDigits(213, 10) = 6 because the sum of the digits expressed in decimal is 2+1+3 = 6.</li>
<li> <strong>RevDigits(n,r)</strong>: finds the value obtained by writing backwards the digits of <var>n</var> in base <var>r</var>. Example: RevDigits(213, 10) = 312.</li>
</ul>
<p>You can use the prefix <em>0x</em> for hexadecimal numbers, for example 0x38 is equal to 56.</p>
<p>The exponentiation symbol is not present in some mobile devices, so two asterisks ** can by typed as the exponentiation operator.</p>
<p>Example: Find the number <var>n</var> such that <span role="math" aria-label="7 raised to the power of n is congruent to 23 modulo 43241">7<sup>n</sup> ≡ 23 (mod 43241)</span>.</p>
<p>Type 7 in the Base input box, 23 in the Power input box and 43241 in the Mod input box. Then press the button named "Discrete logarithm".</p>
<p>The result is 3360 + 3930 k. As a check you can compute <span role="math" aria-label="7 raised to the power of 3360 is congruent to 23 modulo 43241">7<sup>3360</sup> ≡ 23 (mod 43241)</span> and <span role="math" aria-label="7 raised to the power of 3930 is congruent to 1 modulo 43241">7<sup>3930</sup> ≡ 1 (mod 43241)</span>.</p>
<div class="noand">
<h2>Configuration</h2>
<p>You can change settings for this application by pressing the Config button when a factorization is not in progress. A new window will pop up where you can select different settings:</p>
<ul>
<li><strong>Digits per group</strong>: In order to improve readability, big numbers are separated by spaces forming groups of a fixed number of digits. With this input box, you can determine the number of digits in a group.</li>
<li><strong>Hexadecimal output</strong>: If this checkbox is set, the numbers are shown in hexadecimal format instead of decimal, which is the common notation.
To enter numbers in hexadecimal format, you will need to precede them by the string 0x. For instance, 0x38 = 56. The program shows hexadecimal numbers with monospaced font.</li>
<li><strong>Keyboard</strong>: This enables the user to select between numeric or complete (alphanumeric) virtual keyboard. The virtual keyboard appears on the screen when the user selects an input box on touch screens.
</ul>
<p>The configuration is saved in your device, so when you start again the calculator, all settings remain the same.</p>
<h2>Source code</h2>
<p>You can download the source of the current program and the old sum polynomial factorization applet from <a href="https://github.com/alpertron/calculators">GitHub</a>. Notice that the source code is in C language and you need the <a href="https://emscripten.org/docs/getting_started/downloads.html">Emscripten</a> environment in order to generate JavaScript.</p>
</div>
<p>Written by Dario Alpern. Last updated 8 March 2025.</p>
</div>
<div id="result" aria-live="polite" class="pad"></div>
<div>
<div id="footer">
<p><span class="new">New!</span> You can download an application for Android that includes this calculator from <a href="https://play.google.com/store/apps/details?id=ar.com.alpertron.calculators">Google Play</a>.</p>
<p>If you find any error or you have a comment, please fill in the <a href="#" id="formlink">form</a>.</p>
<p>If you like these calculators and you want to support free software with no annoying advertisements, you can <a href="https://www.PayPal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=MR65QPWZM5JT6&source=url">donate through PayPal</a>.</p>
</div>
</div>
</article>
</main>
<div id="modal-config" class="modal" role="dialog" aria-labelledby="conf">
<div class="modal-content">
<div class="modal-header"><span id="close-config" aria-label="close" class="atright">×</span><p id="conf">Configuration</p></div>
<div class="modal-body">
<div class="applet">
<fieldset>
<legend>Configuration parameters</legend>
<p><label for="digits">Digits per group</label> <input type="number" id="digits" value="6" min="0" max="10000" step="1"></p>
<p><label for="kbd">Keyboard: </label><select id="kbd"><option value="numeric">Numeric</option><option value="comp">Complete</option></select>
<p><input type="checkbox" id="hex"><label for="hex">Hexadecimal output</label></p>
</fieldset>
<p><input type="button" id="save-config" value="Save" title="Save configuration"><input type="button" id="cancel-config" value="Cancel" title="Discard changes to configuration"></p>
</div>
</div></div></div>
<aside id="feedback" aria-label="Feedback form">
<h2 class="h2title">Feedback form</h2>
<form class="applet" id="formfeedback">
<input type="hidden" name="subject" value="Discrete logarithm calculator feedback">
<div id="formleft">
<div class="labels"><label for="name">Your name is:</label><input class="inputfbck" type="text" name="name" maxlength="40" id="name" autocomplete="name"></div>
<div class="labels"><label for="age">Age:</label><input class="inputfbck" type="number" name="age" min="0" max="999" id="age"></div>
<div class="labels"><label for="city">City:</label><input class="inputfbck" type="text" name="city" maxlength="70" id="city" autocomplete="address-level2"></div>
<div class="labels"><label for="province">Province/State:</label><input class="inputfbck" type="text" name="province" maxlength="70" id="province" autocomplete="address-level1"></div>
<div class="labels"><label for="country">Country:</label><input class="inputfbck" type="text" name="country" maxlength="70" id="country" autocomplete="country-name"></div>
<div class="labels"><label for="reply">E-mail address:</label><input class="inputfbck" type="email" name="reply" maxlength="70" id="reply" autocomplete="email"></div>
<p>All fields are optional. Enter your e-mail address if you want a reply from the author of this application.</p>
<p><input type="checkbox" id="adduserdata"><label for="adduserdata">Send input data</label></p>
<input type="hidden" name="userdata" value="" id="userdata">
</div>
<div id="formright">
<label for="comments">Please feel free to add comments:</label><br>
<textarea name="Comments" rows="7" cols="40" id="comments"></textarea>
<p><label for="how">How did you find my page?</label><br>
<select name="how" title="How did you find my page?" id="how">
<optgroup label="Select response">
<option value="from a search engine" selected>From a search engine</option>
<option value="from a friend">From a friend</option>
<option value="from a link">From a link</option>
<option value="from Wikipedia">From Wikipedia or another reference</option>
<option value="other">Other</option>
</optgroup>
</select></p>
<fieldset><legend>Are the programs instructive?</legend>
<input type="radio" name="Instructive" value="Yes" id="insyes"><label for="insyes">Yes</label>
<input type="radio" name="Instructive" value="No" id="insno"><label for="insno">No</label>
</fieldset>
<fieldset><legend>Are the programs interesting?</legend>
<input type="radio" name="Interesting" value="Yes" id="intyes"><label for="intyes">Yes</label>
<input type="radio" name="Interesting" value="No" id="intno"><label for="intno">No</label>
</fieldset>
<p><button type="submit" disabled="disabled" id="formsend" title="Deliver this form">Send it in!</button>
<button type="reset">Reset</button>
<button type="button" id="formcancel" title="Do not deliver this form">Cancel</button></p>
</div>
<div class="lf"></div>
</form>
</aside>
<aside id="sending">
<p>Sending comments...</p>
</aside>
<aside id="sentOK">
<p>Feedback sent successfully.</p>
<div class="center"><button type="button" id="btnSentOK">Go back</button></div>
</aside>
<aside id="notSent">
<p>Feedback could not be sent.</p>
<div class="center"><button type="button" id="btnNotSent">Go back</button></div>
</aside>
<script type="text/wasmb64" id="wasmb64">
</script>
<script type="text/js-worker" id="worker">
<!--
//-->
</script>
<script>
<!--
//-->
</script>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebApplication",
"browserRequirements": "Requires HTML5. Requires Javascript.",
"name": "Discrete logarithm calculator",
"description": "Web application that finds discrete logarithms.",
"image": ["https://www.alpertron.com.ar/dilog.png"],
"datePublished": "2025-03-08",
"dateModified": "2025-03-08",
"operatingSystem": "Any",
"applicationCategory": "EducationalApplication",
"author": {
"@type": "Person",
"name": "Dario Alpern"
},
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "4.2",
"ratingCount": "75"
},
"inLanguage": "en",
"license": "https://www.gnu.org/licenses/gpl-3.0.en.html",
"isAccessibleForFree": true,
"offers": {
"@type": "Offer",
"availability": "https://schema.org/OnlineOnly",
"price": "0",
"priceCurrency": "USD"
}
}
</script>
</body>
</html>