Commit 9b9ff83e authored by Laurent Grémy's avatar Laurent Grémy
Browse files

Initial commit.

parents
# Contributing to `discretelogdb`
Create an account on `gitlab.inria.fr`.
Fork the project by clicking on the `Fork` item on the webpage
https://gitlab.inria.fr/dldb/discretelogdb. You must now have a copy of the
project `discretelogdb` in your space. Clone the project.
```
git clone git@gitlab.inria.fr:<user>/discretelogdb.git
```
or
```
git clone https://gitlab.inria.fr/<user>/discretelogdb.git
```
From now on, we assume that you are in the directory `discretelogdb`.
## Modifying or adding files
Link `request.py` as a pre-commit hook. It must be done to verify if `db.json`
is well formed and can be requested.
```
ln -s request.py .git/hooks/pre-commit
```
### Adding a contribution
Eventually, you can create a branch where you put all your changes.
Modify files. Add the files, commit them and push them.
### Sending a merge request
Look for the icon `+`, click on it and select `New merge request`.
Select the branch you want to merge to `dldb/discretelogdb`, and continue.
Describe your changes and submit the request.
## Keeping your fork up to date
### Adding remote from original repository
This must be done once.
```
git remote add upstream <what/the/way/you/want>dldb/discretelogdb.git
```
```
git fetch upstream
```
### Uptading your fork
Now, you can perform, at any time, an update of your fork.
```
git pull upstream master
```
## More about Gitlab
Additional help can be found by following [Gitlab
help](https://gitlab.inria.fr/help).
Creative Commons Legal Code
CC0 1.0 Universal
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
HEREUNDER.
Statement of Purpose
The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator
and subsequent owner(s) (each and all, an "owner") of an original work of
authorship and/or a database (each, a "Work").
Certain owners wish to permanently relinquish those rights to a Work for
the purpose of contributing to a commons of creative, cultural and
scientific works ("Commons") that the public can reliably and without fear
of later claims of infringement build upon, modify, incorporate in other
works, reuse and redistribute as freely as possible in any form whatsoever
and for any purposes, including without limitation commercial purposes.
These owners may contribute to the Commons to promote the ideal of a free
culture and the further production of creative, cultural and scientific
works, or to gain reputation or greater distribution for their Work in
part through the use and efforts of others.
For these and/or other purposes and motivations, and without any
expectation of additional consideration or compensation, the person
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
is an owner of Copyright and Related Rights in the Work, voluntarily
elects to apply CC0 to the Work and publicly distribute the Work under its
terms, with knowledge of his or her Copyright and Related Rights in the
Work and the meaning and intended legal effect of CC0 on those rights.
1. Copyright and Related Rights. A Work made available under CC0 may be
protected by copyright and related or neighboring rights ("Copyright and
Related Rights"). Copyright and Related Rights include, but are not
limited to, the following:
i. the right to reproduce, adapt, distribute, perform, display,
communicate, and translate a Work;
ii. moral rights retained by the original author(s) and/or performer(s);
iii. publicity and privacy rights pertaining to a person's image or
likeness depicted in a Work;
iv. rights protecting against unfair competition in regards to a Work,
subject to the limitations in paragraph 4(a), below;
v. rights protecting the extraction, dissemination, use and reuse of data
in a Work;
vi. database rights (such as those arising under Directive 96/9/EC of the
European Parliament and of the Council of 11 March 1996 on the legal
protection of databases, and under any national implementation
thereof, including any amended or successor version of such
directive); and
vii. other similar, equivalent or corresponding rights throughout the
world based on applicable law or treaty, and any national
implementations thereof.
2. Waiver. To the greatest extent permitted by, but not in contravention
of, applicable law, Affirmer hereby overtly, fully, permanently,
irrevocably and unconditionally waives, abandons, and surrenders all of
Affirmer's Copyright and Related Rights and associated claims and causes
of action, whether now known or unknown (including existing as well as
future claims and causes of action), in the Work (i) in all territories
worldwide, (ii) for the maximum duration provided by applicable law or
treaty (including future time extensions), (iii) in any current or future
medium and for any number of copies, and (iv) for any purpose whatsoever,
including without limitation commercial, advertising or promotional
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
member of the public at large and to the detriment of Affirmer's heirs and
successors, fully intending that such Waiver shall not be subject to
revocation, rescission, cancellation, termination, or any other legal or
equitable action to disrupt the quiet enjoyment of the Work by the public
as contemplated by Affirmer's express Statement of Purpose.
3. Public License Fallback. Should any part of the Waiver for any reason
be judged legally invalid or ineffective under applicable law, then the
Waiver shall be preserved to the maximum extent permitted taking into
account Affirmer's express Statement of Purpose. In addition, to the
extent the Waiver is so judged Affirmer hereby grants to each affected
person a royalty-free, non transferable, non sublicensable, non exclusive,
irrevocable and unconditional license to exercise Affirmer's Copyright and
Related Rights in the Work (i) in all territories worldwide, (ii) for the
maximum duration provided by applicable law or treaty (including future
time extensions), (iii) in any current or future medium and for any number
of copies, and (iv) for any purpose whatsoever, including without
limitation commercial, advertising or promotional purposes (the
"License"). The License shall be deemed effective as of the date CC0 was
applied by Affirmer to the Work. Should any part of the License for any
reason be judged legally invalid or ineffective under applicable law, such
partial invalidity or ineffectiveness shall not invalidate the remainder
of the License, and in such case Affirmer hereby affirms that he or she
will not (i) exercise any of his or her remaining Copyright and Related
Rights in the Work or (ii) assert any associated claims and causes of
action with respect to the Work, in either case contrary to Affirmer's
express Statement of Purpose.
4. Limitations and Disclaimers.
a. No trademark or patent rights held by Affirmer are waived, abandoned,
surrendered, licensed or otherwise affected by this document.
b. Affirmer offers the Work as-is and makes no representations or
warranties of any kind concerning the Work, express, implied,
statutory or otherwise, including without limitation warranties of
title, merchantability, fitness for a particular purpose, non
infringement, or the absence of latent or other defects, accuracy, or
the present or absence of errors, whether or not discoverable, all to
the greatest extent permissible under applicable law.
c. Affirmer disclaims responsibility for clearing rights of other persons
that may apply to the Work or any use thereof, including without
limitation any person's Copyright and Related Rights in the Work.
Further, Affirmer disclaims responsibility for obtaining any necessary
consents, permissions or other rights required for any use of the
Work.
d. Affirmer understands and acknowledges that Creative Commons is not a
party to this document and has no duty or obligation with respect to
this CC0 or use of the Work.
# Database of computed discrete logarithms
## Aim of the project
The aim of the project is to list all the computed discrete logarithms in
finite fields of any characteristic, with references.
## List of main files
* `db.json`: the database, JSON format.
* `request.py`: a python script to perform simple requests on `db.json`.
* `index.html` and `view.js`: example of a presentation tool on the web.
## Contributing to the project
`discretelogdb` welcomes contributions. See [CONTRIBUTING.md](CONTRIBUTING.md).
## Other lists of computed discrete logarithms
* [Discrete logarithm records on Wikipedia](https://en.wikipedia.org/wiki/Discrete_logarithm_records)
* [Slides of Razvan Barbulescu, ECC 2014](http://www.imsc.res.in/~ecc14/slides/razvan.pdf)
* [Slides of Rob Granger, ECC 2014](http://www.imsc.res.in/~ecc14/slides/jens.pdf)
* [C&eacute;cile Pierrot's thesis](https://almasty.lip6.fr/~pierrot/papers/Cecile'sPhDThesis.pdf)
## Contributors
* Laurent Gr&eacute;my
* Aurore Guillevic
## Licence
This project is distributed under the [Creative Commons Zero
license](LICENSE).
This diff is collapsed.
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="https://www.w3schools.com/lib/w3.css">
<meta name="description"
content="Database of computed discrete logarithms."/>
<title>
Computed discrete logarithms
</title>
</head>
<body onload="loadDoc(-1, -1)">
<div class="w3-container w3-responsive">
<h1>Computed discrete logarithms sorted by date</h1>
This page is built to be a presentation tool. If you want to perform more
specific requests, you are invited to download the
<a href="db.json" download>database (json file)</a> and eventually, the
<a href="request.py" download>python file</a> to perform some requests.
<br/>
To select a specific kind of finite field, you can choose either the
characteristic or the extension degree, then click on the corresponding
button.
<br/>
<table>
<tr>
<td>
<button class="w3-btn w3-white w3-border w3-round-xlarge"
type="button" onclick="loadDoc(-1, -1)">All</button>
</td>
<td>
</td>
</tr>
<tr>
<td>
<button class="w3-btn w3-white w3-border w3-round-xlarge"
type="button" onclick="loadDoc(1, -1)">Characteristic</button>
</td>
<td>
<input type="number" size="2" id="char" min="2">
</td>
</tr>
<tr>
<td>
<button class="w3-btn w3-white w3-border w3-round-xlarge"
type="button" onclick="loadDoc(-1, 1)">Extension degree</button>
</td>
<td>
<input type="number" size="2" id="ext" min="1">
</td>
</tr>
</table>
<br/>
<table class="w3-table w3-border w3-bordered" id="db">
<thead>
<tr class="w3-light-grey">
<th>Type</th>
<th>Size of <i>p<sup>n</sup></i></th>
<!--<th><i>n</i></th>-->
<th>Date</th>
<th>Authors</th>
<th>Reference</th>
<th>Note</th>
</tr>
</thead>
</table>
</div>
<script src="view.js"></script>
</body>
</html>
#! /usr/bin/python3
# Link this file in .git/hooks/pre-commit
# Call by ./request.py [-date] [-size] [-char <p>|-n <n>]
import sys
import json
import argparse
from math import log, ceil
from datetime import datetime
def key_date(i):
return datetime(int(i["year"]), int(i["month"]), int(i["day"]))
def key_size(i):
return (ceil(int(i["n"]) * log(int(i["p"]), 2)))
filer = open("db.json")
parser = argparse.ArgumentParser(description='Request database.')
parser.add_argument('-date', help='Sort by date.',required=False, action='store_true')
parser.add_argument('-size', help='Sort by size.',required=False, action='store_true')
parser.add_argument('-char', help='Extract characteristic.',required=False)
parser.add_argument('-n', help='Extract extension.',required=False)
args = parser.parse_args()
date = args.date
size = args.size
char = "-1"
if args.char != None:
char = args.char
n = "-1"
if args.n != None:
if char != "-1":
print("Can not extract characteristic and extension.")
sys.exit(2)
n = args.n
try:
data = list(json.load(filer))
if char != "-1":
L = []
for i in data:
if i["p"] == char:
L.append(i)
data = L
if n != "-1":
L = []
for i in data:
if i["n"] == n:
L.append(i)
data = L
if date:
data.sort(key=key_date)
if size:
data.sort(key=key_date)
data.sort(key=key_size)
for i in data:
s = ""
# s = s + i["algorithm"] + ", "
s = s + str((ceil(int(i["n"]) * log(int(i["p"]), 2)))) + ", "
s = s + str(int(i["n"])) + ", "
s = s + "["
for k in range(len(i["authors"]) - 1):
s = s + i["authors"][k]["name"] + ", "
s = s + i["authors"][len(i["authors"]) - 1]["name"] + "], "
s = s + i["day"] + "/" + i["month"] + "/" + i["year"] + ", "
s = s + "["
for k in range(len(i["references"]) - 1):
s = s + i["references"][k]["link"] + ", "
s = s + i["references"][len(i["references"]) - 1]["link"] + "]"
if "notes" in i.keys():
s = s + ", " + "{"
for k in range(len(i["notes"]) - 1):
s = s + i["notes"][k]["note"] + ", "
s = s + i["notes"][len(i["notes"]) - 1]["note"] + "}"
print(s)
except Exception as e:
print(str(e))
sys.exit(1)
filer.close()
sys.exit(0)
var load_db = 0;
var db;
function loadDoc(characteristic, extension) {
var xhttp;
if (window.XMLHttpRequest) {
// code for modern browsers
xhttp = new XMLHttpRequest();
} else {
// code for IE6, IE5
xhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
if (load_db == 0) {
db = JSON.parse(this.responseText);
load_db = 1;
}
erase_db();
sort_date(db);
if (characteristic == -1 && extension != -1) {
x = document.getElementById("ext").value;
if (x > 0) {
extension = x;
} else {
extension = -1;
document.getElementById("ext").value = "";
}
document.getElementById("char").value = "";
} else if (characteristic != -1 && extension == -1) {
x = document.getElementById("char").value;
if (x > 1) {
characteristic = x;
} else {
characteristic = -1;
document.getElementById("char").value = "";
}
document.getElementById("ext").value = "";
} else if (characteristic == -1 && extension == -1) {
document.getElementById("char").value = "";
document.getElementById("ext").value = "";
}
print_db(db, characteristic, extension);
}
};
xhttp.open("GET", "db.json", true);
xhttp.send();
}
function erase_db() {
var table = document.getElementById("db");
var len = table.children.length;
while (len > 1) {
table.removeChild(table.children[1]);
len = len - 1;
}
}
function print_db(db, characteristic, extension) {
var table = document.getElementById("db");
var row;
var cell;
var out;
var att;
var ind = 0;
for (var i = 0; i < db.length; i++) {
row = document.createElement("tr");
//Type
cell = document.createElement("td");
if (parseInt(db[i].n) == 1) {
cell.innerHTML = "<i>p</i>";
att = document.createAttribute("title");
//Not too long tooltip.
if (db[i].p.length <= 155) {
att.value = db[i].p;
} else {
att.value = db[i].p.substring(0, 154) + ""
}
cell.setAttributeNode(att);
} else if (parseInt(db[i].n) < 60) {
cell.innerHTML = "<i>p<sup>" + db[i].n + "</sup></i>";
att = document.createAttribute("title");
//Not too long tooltip.
if (db[i].p.length <= 155) {
att.value = db[i].p;
} else {
att.value = db[i].p.substring(0, 154) + ""
}
cell.setAttributeNode(att);
} else {
cell.innerHTML = "<i>" + db[i].p + "<sup>" + db[i].n + "</sup></i>";
}
row.appendChild(cell);
// Size
cell = document.createElement("td");
cell.innerHTML = Math.ceil(Math.log2((parseFloat(db[i].p))) * parseFloat(db[i].n));
row.appendChild(cell);
//// n
//cell = document.createElement("td");
//cell.innerHTML = db[i].n;
//row.appendChild(cell);
// Date
cell = document.createElement("td");
cell.innerHTML = db[i].day + "/" + db[i].month + "/" + db[i].year;
row.appendChild(cell);
// Authors
cell = document.createElement("td");
out = db[i].authors[0].name;
for (j = 1; j < db[i].authors.length - 1; j++) {
out += ", " + db[i].authors[j].name;
}
if (db[i].authors.length > 1) {
out += " and " + db[i].authors[db[i].authors.length - 1].name
}
cell.innerHTML = out;
row.appendChild(cell);
//References
cell = document.createElement("td");
out = ""
out = "<a href=\"" + db[i].references[0].link + "\">Link</a>";
for (j = 1; j < db[i].references.length; j++) {
out += ", " + "<a href=\"" + db[i].references[j].link + "\">link</a>";
}
cell.innerHTML = out;
row.appendChild(cell);
//Note
cell = document.createElement("td");
out = "";
if (db[i].hasOwnProperty('notes')) {
out = format_special_p(db[i].notes[0].note, 0);
for (j = 1; j < db[i].notes.length - 1; j++) {
out += ", " + format_special_p(db[i].notes[j].note, j);
}
}
if (is_prime(parseInt(db[i].n)) && parseInt(db[i].p) == 2) {
if (out == "") {
out += "Prime extension"
} else {
out += ", prime extension"
}
}
cell.innerHTML = out;
row.appendChild(cell);
if ((characteristic == -1 && extension == -1) ||
(characteristic == -1 && extension == parseInt(db[i].n)) ||
(characteristic == parseInt(db[i].p) && extension == -1)) {
att = document.createAttribute("class");
att.value = "w3-hover-grey";
if (ind % 2 == 1) {
att.value += " w3-light-grey";
}
ind = ind + 1;
row.setAttributeNode(att);
table.appendChild(row);
}
}
}
function format_special_p(s, j) {
if (s == "special p") {
if (j == 0) {
return "Special <i>p</i>";
} else {
return "special <i>p</i>";
}
}
return s;
}
function errase_table(db) {
table = document.getElementById("db");
for (var i = db.length; i > 0; i--) {
table.deleteRow(i);
}
}
function sort_date(db) {
db.sort(compare_size);
db.sort(compare_date);
}
function compare_date(a, b) {
var datea = new Date(a.year, a.month - 1, a.day);
var dateb = new Date(b.year, b.month - 1, b.day);
if (datea.getTime() < dateb.getTime()) {
return 1;
}
if (datea.getTime() > dateb.getTime()) {
return -1;
}
return 0;
}
function compare_p(a, b) {
var pa = parseFloat(a.p);
var pb = parseFloat(b.p);
if (pa < pb) {
return 1;
}
if (pa > pb) {
return -1;
}
return 0;
}
function compare_n(a, b) {
var na = parseInt(a.n);
var nb = parseInt(b.n);
if (na < nb) {
return 1;
}
if (na > nb) {
return -1;
}
return 0;
}
function compare_size(a, b) {
var sa = Math.ceil(Math.log2((parseFloat(a.p))) * parseFloat(a.n));
var sb = Math.ceil(Math.log2((parseFloat(b.p))) * parseFloat(b.n));
if (sa < sb) {
return 1;
}
if (sa > sb) {
return -1;
}
return 0;
}
function is_prime(n) {
if (n <= 1) {
return false;
}
if (n <= 3) {
return true;
} else if (n % 2 == 0 || n % 3 == 0) {
return false;
}
var i = 5;
while (i * i <= n) {