aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--po/POTFILES.in1
-rw-r--r--po/de.po123
-rw-r--r--po/es.po123
-rw-r--r--po/sv.po123
-rw-r--r--po/vi.po123
-rw-r--r--po/zh_CN.po123
-rw-r--r--src/consensus/consensus.h9
-rw-r--r--src/consensus/consensus_api.c6
-rw-r--r--src/consensus/gnunet-consensus-profiler.c2
-rw-r--r--src/consensus/gnunet-service-consensus.c4
-rw-r--r--src/include/gnunet_common.h11
-rw-r--r--src/include/gnunet_consensus_service.h8
-rw-r--r--src/include/gnunet_secretsharing_service.h56
-rw-r--r--src/include/gnunet_signatures.h15
-rw-r--r--src/secretsharing/Makefile.am12
-rwxr-xr-xsrc/secretsharing/gnunet-secretsharing-profiler.c316
-rw-r--r--src/secretsharing/gnunet-service-secretsharing.c772
-rw-r--r--src/secretsharing/secretsharing.h121
-rw-r--r--src/secretsharing/secretsharing_api.c125
-rw-r--r--src/secretsharing/secretsharing_protocol.h45
-rw-r--r--src/secretsharing/test_secretsharing.conf36
-rw-r--r--src/secretsharing/test_secretsharing_sig.c45
22 files changed, 1724 insertions, 475 deletions
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 063c1573a..241ee27d1 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -260,6 +260,7 @@ src/statistics/statistics_api.c
260src/template/gnunet-service-template.c 260src/template/gnunet-service-template.c
261src/template/gnunet-template.c 261src/template/gnunet-template.c
262src/testbed/gnunet-daemon-testbed-blacklist.c 262src/testbed/gnunet-daemon-testbed-blacklist.c
263src/testbed/gnunet-daemon-testbed-underlay.c
263src/testbed/gnunet-helper-testbed.c 264src/testbed/gnunet-helper-testbed.c
264src/testbed/gnunet_mpi_test.c 265src/testbed/gnunet_mpi_test.c
265src/testbed/gnunet-service-test-barriers.c 266src/testbed/gnunet-service-test-barriers.c
diff --git a/po/de.po b/po/de.po
index a6a347468..0e474a06a 100644
--- a/po/de.po
+++ b/po/de.po
@@ -7,7 +7,7 @@ msgid ""
7msgstr "" 7msgstr ""
8"Project-Id-Version: GNUnet 0.7.0b\n" 8"Project-Id-Version: GNUnet 0.7.0b\n"
9"Report-Msgid-Bugs-To: gnunet-developers@mail.gnu.org\n" 9"Report-Msgid-Bugs-To: gnunet-developers@mail.gnu.org\n"
10"POT-Creation-Date: 2013-12-24 21:07+0100\n" 10"POT-Creation-Date: 2014-01-05 13:20+0100\n"
11"PO-Revision-Date: 2006-03-17 21:37+0100\n" 11"PO-Revision-Date: 2006-03-17 21:37+0100\n"
12"Last-Translator: Nils Durner <durner@gnunet.org>\n" 12"Last-Translator: Nils Durner <durner@gnunet.org>\n"
13"Language-Team: German <de@li.org>\n" 13"Language-Team: German <de@li.org>\n"
@@ -390,17 +390,17 @@ msgid ""
390"%llu\n" 390"%llu\n"
391msgstr "" 391msgstr ""
392 392
393#: src/ats/gnunet-service-ats_addresses.c:2180 393#: src/ats/gnunet-service-ats_addresses.c:2184
394#, c-format 394#, c-format
395msgid "Initializing solver `%s '`%s'\n" 395msgid "Initializing solver `%s '`%s'\n"
396msgstr "" 396msgstr ""
397 397
398#: src/ats/gnunet-service-ats_addresses.c:2183 398#: src/ats/gnunet-service-ats_addresses.c:2187
399#, fuzzy, c-format 399#, fuzzy, c-format
400msgid "Failed to initialize solver `%s'!\n" 400msgid "Failed to initialize solver `%s'!\n"
401msgstr "SQLite Datenbank konnte nicht initialisiert werden: %s.\n" 401msgstr "SQLite Datenbank konnte nicht initialisiert werden: %s.\n"
402 402
403#: src/ats/gnunet-service-ats_addresses.c:2206 403#: src/ats/gnunet-service-ats_addresses.c:2210
404#, fuzzy 404#, fuzzy
405msgid "Failed to initialize solver!\n" 405msgid "Failed to initialize solver!\n"
406msgstr "SQLite Datenbank konnte nicht initialisiert werden: %s.\n" 406msgstr "SQLite Datenbank konnte nicht initialisiert werden: %s.\n"
@@ -4783,45 +4783,49 @@ msgstr "Fehler beim Speichern der Konfigurationsdatei `%s':"
4783msgid "Failed to create directory `%s' for storing egos\n" 4783msgid "Failed to create directory `%s' for storing egos\n"
4784msgstr "Fehler beim Lesen der Freunde-Liste von `%s'\n" 4784msgstr "Fehler beim Lesen der Freunde-Liste von `%s'\n"
4785 4785
4786#: src/mesh/gnunet-mesh.c:300 4786#: src/mesh/gnunet-mesh.c:342
4787#, fuzzy, c-format 4787#, fuzzy, c-format
4788msgid "Invalid target `%s'\n" 4788msgid "Invalid target `%s'\n"
4789msgstr "Ungültiger Parameter: `%s'\n" 4789msgstr "Ungültiger Parameter: `%s'\n"
4790 4790
4791#: src/mesh/gnunet-mesh.c:434 4791#: src/mesh/gnunet-mesh.c:503
4792#, fuzzy, c-format 4792#, fuzzy, c-format
4793msgid "Invalid tunnel owner `%s'\n" 4793msgid "Invalid tunnel owner `%s'\n"
4794msgstr "Ungültiger Parameter: `%s'\n" 4794msgstr "Ungültiger Parameter: `%s'\n"
4795 4795
4796#: src/mesh/gnunet-mesh.c:499 4796#: src/mesh/gnunet-mesh.c:568
4797msgid "You must NOT give a TARGET when using options\n" 4797msgid "You must NOT give a TARGET when using options\n"
4798msgstr "" 4798msgstr ""
4799 4799
4800#: src/mesh/gnunet-mesh.c:576 4800#: src/mesh/gnunet-mesh.c:645
4801#, fuzzy 4801#, fuzzy
4802msgid "provide information about a particular channel" 4802msgid "provide information about a particular channel"
4803msgstr "Informationen über andere GNUnet Knoten ausgeben." 4803msgstr "Informationen über andere GNUnet Knoten ausgeben."
4804 4804
4805#: src/mesh/gnunet-mesh.c:579 4805#: src/mesh/gnunet-mesh.c:648
4806#, fuzzy 4806#, fuzzy
4807msgid "provide information about a particular connection" 4807msgid "provide information about a particular connection"
4808msgstr "Informationen über andere GNUnet Knoten ausgeben." 4808msgstr "Informationen über andere GNUnet Knoten ausgeben."
4809 4809
4810#: src/mesh/gnunet-mesh.c:582 4810#: src/mesh/gnunet-mesh.c:651
4811msgid "activate echo mode"
4812msgstr ""
4813
4814#: src/mesh/gnunet-mesh.c:654
4811#, fuzzy 4815#, fuzzy
4812msgid "provide information about all tunnels" 4816msgid "provide information about all tunnels"
4813msgstr "Informationen über andere GNUnet Knoten ausgeben." 4817msgstr "Informationen über andere GNUnet Knoten ausgeben."
4814 4818
4815#: src/mesh/gnunet-mesh.c:585 4819#: src/mesh/gnunet-mesh.c:657
4816#, fuzzy 4820#, fuzzy
4817msgid "provide information about all tunnels (continuously) NOT IMPLEMENTED" 4821msgid "provide information about all tunnels (continuously) NOT IMPLEMENTED"
4818msgstr "Informationen über andere GNUnet Knoten ausgeben." 4822msgstr "Informationen über andere GNUnet Knoten ausgeben."
4819 4823
4820#: src/mesh/gnunet-mesh.c:588 4824#: src/mesh/gnunet-mesh.c:660
4821msgid "port to listen to (default; 0)" 4825msgid "port to listen to (default; 0)"
4822msgstr "" 4826msgstr ""
4823 4827
4824#: src/mesh/gnunet-mesh.c:591 4828#: src/mesh/gnunet-mesh.c:663
4825#, fuzzy 4829#, fuzzy
4826msgid "provide information about a particular tunnel" 4830msgid "provide information about a particular tunnel"
4827msgstr "Informationen über andere GNUnet Knoten ausgeben." 4831msgstr "Informationen über andere GNUnet Knoten ausgeben."
@@ -6071,7 +6075,7 @@ msgstr "Es konnte keine Verbindung mit gnunetd hergestellt werden.\n"
6071msgid "Failed to send a message to the scalarproduct service\n" 6075msgid "Failed to send a message to the scalarproduct service\n"
6072msgstr "Der Transportdienst auf Port %d konnte nicht gestartet werden.\n" 6076msgstr "Der Transportdienst auf Port %d konnte nicht gestartet werden.\n"
6073 6077
6074#: src/set/gnunet-service-set.c:1403 6078#: src/set/gnunet-service-set.c:1416
6075#, fuzzy 6079#, fuzzy
6076msgid "Could not connect to mesh service\n" 6080msgid "Could not connect to mesh service\n"
6077msgstr "Verbindung zu gnunetd konnte nicht hergestellt werden.\n" 6081msgstr "Verbindung zu gnunetd konnte nicht hergestellt werden.\n"
@@ -6211,6 +6215,16 @@ msgid ""
6211"deployments" 6215"deployments"
6212msgstr "" 6216msgstr ""
6213 6217
6218#: src/testbed/gnunet-daemon-testbed-underlay.c:300 src/testing/testing.c:293
6219#: src/util/gnunet-ecc.c:217
6220#, c-format
6221msgid "Incorrect hostkey file format: %s\n"
6222msgstr ""
6223
6224#: src/testbed/gnunet-daemon-testbed-underlay.c:553
6225msgid "Daemon to restrict underlay network in testbed deployments"
6226msgstr ""
6227
6214#: src/testbed/gnunet-service-testbed_cpustatus.c:727 6228#: src/testbed/gnunet-service-testbed_cpustatus.c:727
6215#, c-format 6229#, c-format
6216msgid "" 6230msgid ""
@@ -6433,11 +6447,6 @@ msgstr ""
6433msgid "Hostkeys file not found: %s\n" 6447msgid "Hostkeys file not found: %s\n"
6434msgstr "" 6448msgstr ""
6435 6449
6436#: src/testing/testing.c:293 src/util/gnunet-ecc.c:217
6437#, c-format
6438msgid "Incorrect hostkey file format: %s\n"
6439msgstr ""
6440
6441#: src/testing/testing.c:716 6450#: src/testing/testing.c:716
6442#, fuzzy, c-format 6451#, fuzzy, c-format
6443msgid "Key number %u does not exist\n" 6452msgid "Key number %u does not exist\n"
@@ -7325,44 +7334,44 @@ msgid "Unexpected address length: %u bytes\n"
7325msgstr "" 7334msgstr ""
7326 7335
7327#: src/transport/plugin_transport_tcp.c:799 7336#: src/transport/plugin_transport_tcp.c:799
7328#: src/transport/plugin_transport_tcp.c:979 7337#: src/transport/plugin_transport_tcp.c:980
7329#: src/transport/plugin_transport_tcp.c:2120 7338#: src/transport/plugin_transport_tcp.c:2120
7330#: src/transport/plugin_transport_tcp.c:2723 7339#: src/transport/plugin_transport_tcp.c:2723
7331#, fuzzy 7340#, fuzzy
7332msgid "# TCP sessions active" 7341msgid "# TCP sessions active"
7333msgstr "# Sitzungsschlüssel akzeptiert" 7342msgstr "# Sitzungsschlüssel akzeptiert"
7334 7343
7335#: src/transport/plugin_transport_tcp.c:835 7344#: src/transport/plugin_transport_tcp.c:836
7336#: src/transport/plugin_transport_tcp.c:972 7345#: src/transport/plugin_transport_tcp.c:973
7337#: src/transport/plugin_transport_tcp.c:1061 7346#: src/transport/plugin_transport_tcp.c:1062
7338#: src/transport/plugin_transport_tcp.c:1111 7347#: src/transport/plugin_transport_tcp.c:1112
7339#: src/transport/plugin_transport_tcp.c:1290 7348#: src/transport/plugin_transport_tcp.c:1291
7340#: src/transport/plugin_transport_tcp.c:1309 7349#: src/transport/plugin_transport_tcp.c:1310
7341#, fuzzy 7350#, fuzzy
7342msgid "# bytes currently in TCP buffers" 7351msgid "# bytes currently in TCP buffers"
7343msgstr "# Bytes gesendet über TCP" 7352msgstr "# Bytes gesendet über TCP"
7344 7353
7345#: src/transport/plugin_transport_tcp.c:839 7354#: src/transport/plugin_transport_tcp.c:840
7346#, fuzzy 7355#, fuzzy
7347msgid "# bytes discarded by TCP (disconnect)" 7356msgid "# bytes discarded by TCP (disconnect)"
7348msgstr "# Bytes verworfen von TCP (ausgehend)" 7357msgstr "# Bytes verworfen von TCP (ausgehend)"
7349 7358
7350#: src/transport/plugin_transport_tcp.c:1065 7359#: src/transport/plugin_transport_tcp.c:1066
7351#, fuzzy 7360#, fuzzy
7352msgid "# bytes discarded by TCP (timeout)" 7361msgid "# bytes discarded by TCP (timeout)"
7353msgstr "# Bytes verworfen von TCP (ausgehend)" 7362msgstr "# Bytes verworfen von TCP (ausgehend)"
7354 7363
7355#: src/transport/plugin_transport_tcp.c:1114 7364#: src/transport/plugin_transport_tcp.c:1115
7356#, fuzzy 7365#, fuzzy
7357msgid "# bytes transmitted via TCP" 7366msgid "# bytes transmitted via TCP"
7358msgstr "# Bytes des Typs %d übertragen" 7367msgstr "# Bytes des Typs %d übertragen"
7359 7368
7360#: src/transport/plugin_transport_tcp.c:1263 7369#: src/transport/plugin_transport_tcp.c:1264
7361#, c-format 7370#, c-format
7362msgid "Trying to send with invalid session %p\n" 7371msgid "Trying to send with invalid session %p\n"
7363msgstr "" 7372msgstr ""
7364 7373
7365#: src/transport/plugin_transport_tcp.c:1520 7374#: src/transport/plugin_transport_tcp.c:1521
7366#: src/transport/plugin_transport_udp.c:1488 7375#: src/transport/plugin_transport_udp.c:1488
7367msgid "# requests to create session with invalid address" 7376msgid "# requests to create session with invalid address"
7368msgstr "" 7377msgstr ""
@@ -8288,114 +8297,114 @@ msgstr "Aufruf von `%s' gibt %d zurück.\n"
8288msgid "b" 8297msgid "b"
8289msgstr "b" 8298msgstr "b"
8290 8299
8291#: src/util/strings.c:452 8300#: src/util/strings.c:444
8292#, c-format 8301#, c-format
8293msgid "Character sets requested were `%s'->`%s'\n" 8302msgid "Character sets requested were `%s'->`%s'\n"
8294msgstr "" 8303msgstr ""
8295 8304
8296#: src/util/strings.c:580 8305#: src/util/strings.c:572
8297msgid "Failed to expand `$HOME': environment variable `HOME' not set" 8306msgid "Failed to expand `$HOME': environment variable `HOME' not set"
8298msgstr "" 8307msgstr ""
8299 8308
8300#: src/util/strings.c:677 8309#: src/util/strings.c:669
8301msgid "µs" 8310msgid "µs"
8302msgstr "" 8311msgstr ""
8303 8312
8304#: src/util/strings.c:681 8313#: src/util/strings.c:673
8305msgid "forever" 8314msgid "forever"
8306msgstr "" 8315msgstr ""
8307 8316
8308#: src/util/strings.c:683 8317#: src/util/strings.c:675
8309msgid "0 ms" 8318msgid "0 ms"
8310msgstr "" 8319msgstr ""
8311 8320
8312#: src/util/strings.c:689 8321#: src/util/strings.c:681
8313msgid "ms" 8322msgid "ms"
8314msgstr "ms" 8323msgstr "ms"
8315 8324
8316#: src/util/strings.c:695 8325#: src/util/strings.c:687
8317msgid "s" 8326msgid "s"
8318msgstr "s" 8327msgstr "s"
8319 8328
8320#: src/util/strings.c:701 8329#: src/util/strings.c:693
8321msgid "m" 8330msgid "m"
8322msgstr "m" 8331msgstr "m"
8323 8332
8324#: src/util/strings.c:707 8333#: src/util/strings.c:699
8325msgid "h" 8334msgid "h"
8326msgstr "h" 8335msgstr "h"
8327 8336
8328#: src/util/strings.c:714 8337#: src/util/strings.c:706
8329#, fuzzy 8338#, fuzzy
8330msgid "day" 8339msgid "day"
8331msgstr " Tage" 8340msgstr " Tage"
8332 8341
8333#: src/util/strings.c:716 8342#: src/util/strings.c:708
8334#, fuzzy 8343#, fuzzy
8335msgid "days" 8344msgid "days"
8336msgstr " Tage" 8345msgstr " Tage"
8337 8346
8338#: src/util/strings.c:745 8347#: src/util/strings.c:737
8339msgid "end of time" 8348msgid "end of time"
8340msgstr "" 8349msgstr ""
8341 8350
8342#: src/util/strings.c:1178 8351#: src/util/strings.c:1170
8343msgid "IPv6 address did not start with `['\n" 8352msgid "IPv6 address did not start with `['\n"
8344msgstr "" 8353msgstr ""
8345 8354
8346#: src/util/strings.c:1186 8355#: src/util/strings.c:1178
8347msgid "IPv6 address did contain ':' to separate port number\n" 8356msgid "IPv6 address did contain ':' to separate port number\n"
8348msgstr "" 8357msgstr ""
8349 8358
8350#: src/util/strings.c:1192 8359#: src/util/strings.c:1184
8351msgid "IPv6 address did contain ']' before ':' to separate port number\n" 8360msgid "IPv6 address did contain ']' before ':' to separate port number\n"
8352msgstr "" 8361msgstr ""
8353 8362
8354#: src/util/strings.c:1199 8363#: src/util/strings.c:1191
8355msgid "IPv6 address did contain a valid port number after the last ':'\n" 8364msgid "IPv6 address did contain a valid port number after the last ':'\n"
8356msgstr "" 8365msgstr ""
8357 8366
8358#: src/util/strings.c:1208 8367#: src/util/strings.c:1200
8359#, fuzzy, c-format 8368#, fuzzy, c-format
8360msgid "Invalid IPv6 address `%s': %s\n" 8369msgid "Invalid IPv6 address `%s': %s\n"
8361msgstr "Ungültiger Parameter: `%s'\n" 8370msgstr "Ungültiger Parameter: `%s'\n"
8362 8371
8363#: src/util/strings.c:1414 src/util/strings.c:1430 8372#: src/util/strings.c:1406 src/util/strings.c:1422
8364msgid "Port not in range\n" 8373msgid "Port not in range\n"
8365msgstr "" 8374msgstr ""
8366 8375
8367#: src/util/strings.c:1439 8376#: src/util/strings.c:1431
8368#, fuzzy, c-format 8377#, fuzzy, c-format
8369msgid "Malformed port policy `%s'\n" 8378msgid "Malformed port policy `%s'\n"
8370msgstr "Der Transportdienst auf Port %d konnte nicht gestartet werden.\n" 8379msgstr "Der Transportdienst auf Port %d konnte nicht gestartet werden.\n"
8371 8380
8372#: src/util/strings.c:1522 src/util/strings.c:1553 src/util/strings.c:1601 8381#: src/util/strings.c:1514 src/util/strings.c:1545 src/util/strings.c:1593
8373#: src/util/strings.c:1622 8382#: src/util/strings.c:1614
8374#, c-format 8383#, c-format
8375msgid "Invalid format for IP: `%s'\n" 8384msgid "Invalid format for IP: `%s'\n"
8376msgstr "Ungültiges Format für IP: `%s'\n" 8385msgstr "Ungültiges Format für IP: `%s'\n"
8377 8386
8378#: src/util/strings.c:1579 8387#: src/util/strings.c:1571
8379#, c-format 8388#, c-format
8380msgid "Invalid network notation ('/%d' is not legal in IPv4 CIDR)." 8389msgid "Invalid network notation ('/%d' is not legal in IPv4 CIDR)."
8381msgstr "Ungültige Netzwerk Notation ('/%d ist nicht gültig in IPv4 CIDR)." 8390msgstr "Ungültige Netzwerk Notation ('/%d ist nicht gültig in IPv4 CIDR)."
8382 8391
8383#: src/util/strings.c:1631 8392#: src/util/strings.c:1623
8384#, fuzzy, c-format 8393#, fuzzy, c-format
8385msgid "Invalid format: `%s'\n" 8394msgid "Invalid format: `%s'\n"
8386msgstr "Ungültiger Parameter: `%s'\n" 8395msgstr "Ungültiger Parameter: `%s'\n"
8387 8396
8388#: src/util/strings.c:1683 8397#: src/util/strings.c:1675
8389#, c-format 8398#, c-format
8390msgid "Invalid network notation (does not end with ';': `%s')\n" 8399msgid "Invalid network notation (does not end with ';': `%s')\n"
8391msgstr "Ungültige Netzwerk Notation (endet nicht mit ';': `%s')\n" 8400msgstr "Ungültige Netzwerk Notation (endet nicht mit ';': `%s')\n"
8392 8401
8393#: src/util/strings.c:1733 8402#: src/util/strings.c:1725
8394#, fuzzy, c-format 8403#, fuzzy, c-format
8395msgid "Wrong format `%s' for netmask\n" 8404msgid "Wrong format `%s' for netmask\n"
8396msgstr "Falsches Format `%s' für Netzmaske: %s\n" 8405msgstr "Falsches Format `%s' für Netzmaske: %s\n"
8397 8406
8398#: src/util/strings.c:1764 8407#: src/util/strings.c:1756
8399#, fuzzy, c-format 8408#, fuzzy, c-format
8400msgid "Wrong format `%s' for network\n" 8409msgid "Wrong format `%s' for network\n"
8401msgstr "Falsches Format `%s' für Netzwerk: %s\n" 8410msgstr "Falsches Format `%s' für Netzwerk: %s\n"
diff --git a/po/es.po b/po/es.po
index 52c025a55..218970899 100644
--- a/po/es.po
+++ b/po/es.po
@@ -7,7 +7,7 @@ msgid ""
7msgstr "" 7msgstr ""
8"Project-Id-Version: gnunet 0.9.5a\n" 8"Project-Id-Version: gnunet 0.9.5a\n"
9"Report-Msgid-Bugs-To: gnunet-developers@mail.gnu.org\n" 9"Report-Msgid-Bugs-To: gnunet-developers@mail.gnu.org\n"
10"POT-Creation-Date: 2013-12-24 21:07+0100\n" 10"POT-Creation-Date: 2014-01-05 13:20+0100\n"
11"PO-Revision-Date: 2013-02-23 17:50+0100\n" 11"PO-Revision-Date: 2013-02-23 17:50+0100\n"
12"Last-Translator: Miguel Ángel Arruga Vivas <rosen644835@gmail.com>\n" 12"Last-Translator: Miguel Ángel Arruga Vivas <rosen644835@gmail.com>\n"
13"Language-Team: Spanish <es@li.org>\n" 13"Language-Team: Spanish <es@li.org>\n"
@@ -422,17 +422,17 @@ msgstr ""
422"No hay configurada una cuota de salida para la red «%s», asignando el ancho " 422"No hay configurada una cuota de salida para la red «%s», asignando el ancho "
423"de banda predeterminado %llu\n" 423"de banda predeterminado %llu\n"
424 424
425#: src/ats/gnunet-service-ats_addresses.c:2180 425#: src/ats/gnunet-service-ats_addresses.c:2184
426#, c-format 426#, c-format
427msgid "Initializing solver `%s '`%s'\n" 427msgid "Initializing solver `%s '`%s'\n"
428msgstr "" 428msgstr ""
429 429
430#: src/ats/gnunet-service-ats_addresses.c:2183 430#: src/ats/gnunet-service-ats_addresses.c:2187
431#, fuzzy, c-format 431#, fuzzy, c-format
432msgid "Failed to initialize solver `%s'!\n" 432msgid "Failed to initialize solver `%s'!\n"
433msgstr "¡No se puede inicializar el resolvedor!\n" 433msgstr "¡No se puede inicializar el resolvedor!\n"
434 434
435#: src/ats/gnunet-service-ats_addresses.c:2206 435#: src/ats/gnunet-service-ats_addresses.c:2210
436#, fuzzy 436#, fuzzy
437msgid "Failed to initialize solver!\n" 437msgid "Failed to initialize solver!\n"
438msgstr "¡No se puede inicializar el resolvedor!\n" 438msgstr "¡No se puede inicializar el resolvedor!\n"
@@ -4818,46 +4818,50 @@ msgstr "Se produjo un fallo al borrar el fichero de configuración %s\n"
4818msgid "Failed to create directory `%s' for storing egos\n" 4818msgid "Failed to create directory `%s' for storing egos\n"
4819msgstr "Se produjo un fallo al leer el directorio «%s»\n" 4819msgstr "Se produjo un fallo al leer el directorio «%s»\n"
4820 4820
4821#: src/mesh/gnunet-mesh.c:300 4821#: src/mesh/gnunet-mesh.c:342
4822#, fuzzy, c-format 4822#, fuzzy, c-format
4823msgid "Invalid target `%s'\n" 4823msgid "Invalid target `%s'\n"
4824msgstr "Parámetro no válido «%s»\n" 4824msgstr "Parámetro no válido «%s»\n"
4825 4825
4826#: src/mesh/gnunet-mesh.c:434 4826#: src/mesh/gnunet-mesh.c:503
4827#, fuzzy, c-format 4827#, fuzzy, c-format
4828msgid "Invalid tunnel owner `%s'\n" 4828msgid "Invalid tunnel owner `%s'\n"
4829msgstr "Formato de tiempo no válido «%s»\n" 4829msgstr "Formato de tiempo no válido «%s»\n"
4830 4830
4831#: src/mesh/gnunet-mesh.c:499 4831#: src/mesh/gnunet-mesh.c:568
4832msgid "You must NOT give a TARGET when using options\n" 4832msgid "You must NOT give a TARGET when using options\n"
4833msgstr "" 4833msgstr ""
4834 4834
4835#: src/mesh/gnunet-mesh.c:576 4835#: src/mesh/gnunet-mesh.c:645
4836#, fuzzy 4836#, fuzzy
4837msgid "provide information about a particular channel" 4837msgid "provide information about a particular channel"
4838msgstr "proveer información acerca de un túnel en particular" 4838msgstr "proveer información acerca de un túnel en particular"
4839 4839
4840#: src/mesh/gnunet-mesh.c:579 4840#: src/mesh/gnunet-mesh.c:648
4841#, fuzzy 4841#, fuzzy
4842msgid "provide information about a particular connection" 4842msgid "provide information about a particular connection"
4843msgstr "proveer información acerca de un túnel en particular" 4843msgstr "proveer información acerca de un túnel en particular"
4844 4844
4845#: src/mesh/gnunet-mesh.c:582 4845#: src/mesh/gnunet-mesh.c:651
4846msgid "activate echo mode"
4847msgstr ""
4848
4849#: src/mesh/gnunet-mesh.c:654
4846#, fuzzy 4850#, fuzzy
4847msgid "provide information about all tunnels" 4851msgid "provide information about all tunnels"
4848msgstr "proveer información acerca de un túnel en particular" 4852msgstr "proveer información acerca de un túnel en particular"
4849 4853
4850#: src/mesh/gnunet-mesh.c:585 4854#: src/mesh/gnunet-mesh.c:657
4851msgid "provide information about all tunnels (continuously) NOT IMPLEMENTED" 4855msgid "provide information about all tunnels (continuously) NOT IMPLEMENTED"
4852msgstr "" 4856msgstr ""
4853"proveer información acerca de todos los túneles (de forma continua) SIN " 4857"proveer información acerca de todos los túneles (de forma continua) SIN "
4854"IMPLEMENTAR" 4858"IMPLEMENTAR"
4855 4859
4856#: src/mesh/gnunet-mesh.c:588 4860#: src/mesh/gnunet-mesh.c:660
4857msgid "port to listen to (default; 0)" 4861msgid "port to listen to (default; 0)"
4858msgstr "" 4862msgstr ""
4859 4863
4860#: src/mesh/gnunet-mesh.c:591 4864#: src/mesh/gnunet-mesh.c:663
4861msgid "provide information about a particular tunnel" 4865msgid "provide information about a particular tunnel"
4862msgstr "proveer información acerca de un túnel en particular" 4866msgstr "proveer información acerca de un túnel en particular"
4863 4867
@@ -6121,7 +6125,7 @@ msgstr "¡Se produjo un fallo al conectar al servicio de estadísticas!\n"
6121msgid "Failed to send a message to the scalarproduct service\n" 6125msgid "Failed to send a message to the scalarproduct service\n"
6122msgstr "Se produjo un fallo al enviar una petición al servicio de transporte\n" 6126msgstr "Se produjo un fallo al enviar una petición al servicio de transporte\n"
6123 6127
6124#: src/set/gnunet-service-set.c:1403 6128#: src/set/gnunet-service-set.c:1416
6125#, fuzzy 6129#, fuzzy
6126msgid "Could not connect to mesh service\n" 6130msgid "Could not connect to mesh service\n"
6127msgstr "¡No se pudo conectar al servicio %s!\n" 6131msgstr "¡No se pudo conectar al servicio %s!\n"
@@ -6263,6 +6267,16 @@ msgid ""
6263"deployments" 6267"deployments"
6264msgstr "" 6268msgstr ""
6265 6269
6270#: src/testbed/gnunet-daemon-testbed-underlay.c:300 src/testing/testing.c:293
6271#: src/util/gnunet-ecc.c:217
6272#, c-format
6273msgid "Incorrect hostkey file format: %s\n"
6274msgstr "El fichero de máquinas no tiene el formato correcto: %s\n"
6275
6276#: src/testbed/gnunet-daemon-testbed-underlay.c:553
6277msgid "Daemon to restrict underlay network in testbed deployments"
6278msgstr ""
6279
6266#: src/testbed/gnunet-service-testbed_cpustatus.c:727 6280#: src/testbed/gnunet-service-testbed_cpustatus.c:727
6267#, c-format 6281#, c-format
6268msgid "" 6282msgid ""
@@ -6490,11 +6504,6 @@ msgstr ""
6490msgid "Hostkeys file not found: %s\n" 6504msgid "Hostkeys file not found: %s\n"
6491msgstr "El fichero de máquinas no fue encontrado: %s\n" 6505msgstr "El fichero de máquinas no fue encontrado: %s\n"
6492 6506
6493#: src/testing/testing.c:293 src/util/gnunet-ecc.c:217
6494#, c-format
6495msgid "Incorrect hostkey file format: %s\n"
6496msgstr "El fichero de máquinas no tiene el formato correcto: %s\n"
6497
6498#: src/testing/testing.c:716 6507#: src/testing/testing.c:716
6499#, c-format 6508#, c-format
6500msgid "Key number %u does not exist\n" 6509msgid "Key number %u does not exist\n"
@@ -7393,39 +7402,39 @@ msgid "Unexpected address length: %u bytes\n"
7393msgstr "Longitud de dirección inesperada: %u bytes\n" 7402msgstr "Longitud de dirección inesperada: %u bytes\n"
7394 7403
7395#: src/transport/plugin_transport_tcp.c:799 7404#: src/transport/plugin_transport_tcp.c:799
7396#: src/transport/plugin_transport_tcp.c:979 7405#: src/transport/plugin_transport_tcp.c:980
7397#: src/transport/plugin_transport_tcp.c:2120 7406#: src/transport/plugin_transport_tcp.c:2120
7398#: src/transport/plugin_transport_tcp.c:2723 7407#: src/transport/plugin_transport_tcp.c:2723
7399msgid "# TCP sessions active" 7408msgid "# TCP sessions active"
7400msgstr "# Sesiones TCP activas" 7409msgstr "# Sesiones TCP activas"
7401 7410
7402#: src/transport/plugin_transport_tcp.c:835 7411#: src/transport/plugin_transport_tcp.c:836
7403#: src/transport/plugin_transport_tcp.c:972 7412#: src/transport/plugin_transport_tcp.c:973
7404#: src/transport/plugin_transport_tcp.c:1061 7413#: src/transport/plugin_transport_tcp.c:1062
7405#: src/transport/plugin_transport_tcp.c:1111 7414#: src/transport/plugin_transport_tcp.c:1112
7406#: src/transport/plugin_transport_tcp.c:1290 7415#: src/transport/plugin_transport_tcp.c:1291
7407#: src/transport/plugin_transport_tcp.c:1309 7416#: src/transport/plugin_transport_tcp.c:1310
7408msgid "# bytes currently in TCP buffers" 7417msgid "# bytes currently in TCP buffers"
7409msgstr "# bytes actualmente en los buffer TCP" 7418msgstr "# bytes actualmente en los buffer TCP"
7410 7419
7411#: src/transport/plugin_transport_tcp.c:839 7420#: src/transport/plugin_transport_tcp.c:840
7412msgid "# bytes discarded by TCP (disconnect)" 7421msgid "# bytes discarded by TCP (disconnect)"
7413msgstr "# bytes descartados por TCP (desconectado)" 7422msgstr "# bytes descartados por TCP (desconectado)"
7414 7423
7415#: src/transport/plugin_transport_tcp.c:1065 7424#: src/transport/plugin_transport_tcp.c:1066
7416msgid "# bytes discarded by TCP (timeout)" 7425msgid "# bytes discarded by TCP (timeout)"
7417msgstr "# bytes omitidos por TCP (expirados)" 7426msgstr "# bytes omitidos por TCP (expirados)"
7418 7427
7419#: src/transport/plugin_transport_tcp.c:1114 7428#: src/transport/plugin_transport_tcp.c:1115
7420msgid "# bytes transmitted via TCP" 7429msgid "# bytes transmitted via TCP"
7421msgstr "# bytes recibidos vía TCP" 7430msgstr "# bytes recibidos vía TCP"
7422 7431
7423#: src/transport/plugin_transport_tcp.c:1263 7432#: src/transport/plugin_transport_tcp.c:1264
7424#, c-format 7433#, c-format
7425msgid "Trying to send with invalid session %p\n" 7434msgid "Trying to send with invalid session %p\n"
7426msgstr "Intentando enviar con una sesión no válida %p\n" 7435msgstr "Intentando enviar con una sesión no válida %p\n"
7427 7436
7428#: src/transport/plugin_transport_tcp.c:1520 7437#: src/transport/plugin_transport_tcp.c:1521
7429#: src/transport/plugin_transport_udp.c:1488 7438#: src/transport/plugin_transport_udp.c:1488
7430msgid "# requests to create session with invalid address" 7439msgid "# requests to create session with invalid address"
7431msgstr "" 7440msgstr ""
@@ -8377,118 +8386,118 @@ msgstr "señal (%d, %p) devolvió %d.\n"
8377msgid "b" 8386msgid "b"
8378msgstr "b" 8387msgstr "b"
8379 8388
8380#: src/util/strings.c:452 8389#: src/util/strings.c:444
8381#, c-format 8390#, c-format
8382msgid "Character sets requested were `%s'->`%s'\n" 8391msgid "Character sets requested were `%s'->`%s'\n"
8383msgstr "Los conjuntos de caracteres pedidos fueron «%s»->«%s»\n" 8392msgstr "Los conjuntos de caracteres pedidos fueron «%s»->«%s»\n"
8384 8393
8385#: src/util/strings.c:580 8394#: src/util/strings.c:572
8386msgid "Failed to expand `$HOME': environment variable `HOME' not set" 8395msgid "Failed to expand `$HOME': environment variable `HOME' not set"
8387msgstr "" 8396msgstr ""
8388"Se produjo un fallo al expandir «$HOME»: variable de entorno «HOME» no " 8397"Se produjo un fallo al expandir «$HOME»: variable de entorno «HOME» no "
8389"establecida" 8398"establecida"
8390 8399
8391#: src/util/strings.c:677 8400#: src/util/strings.c:669
8392msgid "µs" 8401msgid "µs"
8393msgstr "" 8402msgstr ""
8394 8403
8395#: src/util/strings.c:681 8404#: src/util/strings.c:673
8396msgid "forever" 8405msgid "forever"
8397msgstr "para siempre" 8406msgstr "para siempre"
8398 8407
8399#: src/util/strings.c:683 8408#: src/util/strings.c:675
8400msgid "0 ms" 8409msgid "0 ms"
8401msgstr "0 ms" 8410msgstr "0 ms"
8402 8411
8403#: src/util/strings.c:689 8412#: src/util/strings.c:681
8404msgid "ms" 8413msgid "ms"
8405msgstr "ms" 8414msgstr "ms"
8406 8415
8407#: src/util/strings.c:695 8416#: src/util/strings.c:687
8408msgid "s" 8417msgid "s"
8409msgstr "s" 8418msgstr "s"
8410 8419
8411#: src/util/strings.c:701 8420#: src/util/strings.c:693
8412msgid "m" 8421msgid "m"
8413msgstr "m" 8422msgstr "m"
8414 8423
8415#: src/util/strings.c:707 8424#: src/util/strings.c:699
8416msgid "h" 8425msgid "h"
8417msgstr "h" 8426msgstr "h"
8418 8427
8419#: src/util/strings.c:714 8428#: src/util/strings.c:706
8420msgid "day" 8429msgid "day"
8421msgstr "día" 8430msgstr "día"
8422 8431
8423#: src/util/strings.c:716 8432#: src/util/strings.c:708
8424msgid "days" 8433msgid "days"
8425msgstr "días" 8434msgstr "días"
8426 8435
8427#: src/util/strings.c:745 8436#: src/util/strings.c:737
8428msgid "end of time" 8437msgid "end of time"
8429msgstr "fin del plazo" 8438msgstr "fin del plazo"
8430 8439
8431#: src/util/strings.c:1178 8440#: src/util/strings.c:1170
8432msgid "IPv6 address did not start with `['\n" 8441msgid "IPv6 address did not start with `['\n"
8433msgstr "La dirección IPv6 no empezaba con «[»\n" 8442msgstr "La dirección IPv6 no empezaba con «[»\n"
8434 8443
8435#: src/util/strings.c:1186 8444#: src/util/strings.c:1178
8436msgid "IPv6 address did contain ':' to separate port number\n" 8445msgid "IPv6 address did contain ':' to separate port number\n"
8437msgstr "La dirección IPv6 contenía «:» para separar el número de puerto\n" 8446msgstr "La dirección IPv6 contenía «:» para separar el número de puerto\n"
8438 8447
8439#: src/util/strings.c:1192 8448#: src/util/strings.c:1184
8440msgid "IPv6 address did contain ']' before ':' to separate port number\n" 8449msgid "IPv6 address did contain ']' before ':' to separate port number\n"
8441msgstr "" 8450msgstr ""
8442"La dirección IPv6 contenía «]» antes de «:» para separar el número de " 8451"La dirección IPv6 contenía «]» antes de «:» para separar el número de "
8443"puerto\n" 8452"puerto\n"
8444 8453
8445#: src/util/strings.c:1199 8454#: src/util/strings.c:1191
8446msgid "IPv6 address did contain a valid port number after the last ':'\n" 8455msgid "IPv6 address did contain a valid port number after the last ':'\n"
8447msgstr "" 8456msgstr ""
8448"La dirección IPv6 contenía un número de puerto válido después del último " 8457"La dirección IPv6 contenía un número de puerto válido después del último "
8449"«:»\n" 8458"«:»\n"
8450 8459
8451#: src/util/strings.c:1208 8460#: src/util/strings.c:1200
8452#, c-format 8461#, c-format
8453msgid "Invalid IPv6 address `%s': %s\n" 8462msgid "Invalid IPv6 address `%s': %s\n"
8454msgstr "Dirección IPv6 «%s» no válida: %s\n" 8463msgstr "Dirección IPv6 «%s» no válida: %s\n"
8455 8464
8456#: src/util/strings.c:1414 src/util/strings.c:1430 8465#: src/util/strings.c:1406 src/util/strings.c:1422
8457msgid "Port not in range\n" 8466msgid "Port not in range\n"
8458msgstr "" 8467msgstr ""
8459 8468
8460#: src/util/strings.c:1439 8469#: src/util/strings.c:1431
8461#, fuzzy, c-format 8470#, fuzzy, c-format
8462msgid "Malformed port policy `%s'\n" 8471msgid "Malformed port policy `%s'\n"
8463msgstr "Se produjo un fallo al iniciar el servicio «%s»\n" 8472msgstr "Se produjo un fallo al iniciar el servicio «%s»\n"
8464 8473
8465#: src/util/strings.c:1522 src/util/strings.c:1553 src/util/strings.c:1601 8474#: src/util/strings.c:1514 src/util/strings.c:1545 src/util/strings.c:1593
8466#: src/util/strings.c:1622 8475#: src/util/strings.c:1614
8467#, c-format 8476#, c-format
8468msgid "Invalid format for IP: `%s'\n" 8477msgid "Invalid format for IP: `%s'\n"
8469msgstr "Formato no válido para la IP: «%s»\n" 8478msgstr "Formato no válido para la IP: «%s»\n"
8470 8479
8471#: src/util/strings.c:1579 8480#: src/util/strings.c:1571
8472#, c-format 8481#, c-format
8473msgid "Invalid network notation ('/%d' is not legal in IPv4 CIDR)." 8482msgid "Invalid network notation ('/%d' is not legal in IPv4 CIDR)."
8474msgstr "Notación de red no válida («/%d» no es válido en IPv4 CIDR)." 8483msgstr "Notación de red no válida («/%d» no es válido en IPv4 CIDR)."
8475 8484
8476#: src/util/strings.c:1631 8485#: src/util/strings.c:1623
8477#, fuzzy, c-format 8486#, fuzzy, c-format
8478msgid "Invalid format: `%s'\n" 8487msgid "Invalid format: `%s'\n"
8479msgstr "Formato de tiempo no válido «%s»\n" 8488msgstr "Formato de tiempo no válido «%s»\n"
8480 8489
8481#: src/util/strings.c:1683 8490#: src/util/strings.c:1675
8482#, c-format 8491#, c-format
8483msgid "Invalid network notation (does not end with ';': `%s')\n" 8492msgid "Invalid network notation (does not end with ';': `%s')\n"
8484msgstr "Notación de red no válida (no termina con «;»: «%s»)\n" 8493msgstr "Notación de red no válida (no termina con «;»: «%s»)\n"
8485 8494
8486#: src/util/strings.c:1733 8495#: src/util/strings.c:1725
8487#, c-format 8496#, c-format
8488msgid "Wrong format `%s' for netmask\n" 8497msgid "Wrong format `%s' for netmask\n"
8489msgstr "Formato «%s» erroneo para máscara de red\n" 8498msgstr "Formato «%s» erroneo para máscara de red\n"
8490 8499
8491#: src/util/strings.c:1764 8500#: src/util/strings.c:1756
8492#, c-format 8501#, c-format
8493msgid "Wrong format `%s' for network\n" 8502msgid "Wrong format `%s' for network\n"
8494msgstr "Formato «%s» erroneo para red\n" 8503msgstr "Formato «%s» erroneo para red\n"
diff --git a/po/sv.po b/po/sv.po
index a5806b593..286a17b9b 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -7,7 +7,7 @@ msgid ""
7msgstr "" 7msgstr ""
8"Project-Id-Version: GNUnet 0.7.0b\n" 8"Project-Id-Version: GNUnet 0.7.0b\n"
9"Report-Msgid-Bugs-To: gnunet-developers@mail.gnu.org\n" 9"Report-Msgid-Bugs-To: gnunet-developers@mail.gnu.org\n"
10"POT-Creation-Date: 2013-12-24 21:07+0100\n" 10"POT-Creation-Date: 2014-01-05 13:20+0100\n"
11"PO-Revision-Date: 2006-01-21 17:16+0100\n" 11"PO-Revision-Date: 2006-01-21 17:16+0100\n"
12"Last-Translator: Daniel Nylander <po@danielnylander.se>\n" 12"Last-Translator: Daniel Nylander <po@danielnylander.se>\n"
13"Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n" 13"Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
@@ -388,17 +388,17 @@ msgid ""
388"%llu\n" 388"%llu\n"
389msgstr "" 389msgstr ""
390 390
391#: src/ats/gnunet-service-ats_addresses.c:2180 391#: src/ats/gnunet-service-ats_addresses.c:2184
392#, c-format 392#, c-format
393msgid "Initializing solver `%s '`%s'\n" 393msgid "Initializing solver `%s '`%s'\n"
394msgstr "" 394msgstr ""
395 395
396#: src/ats/gnunet-service-ats_addresses.c:2183 396#: src/ats/gnunet-service-ats_addresses.c:2187
397#, fuzzy, c-format 397#, fuzzy, c-format
398msgid "Failed to initialize solver `%s'!\n" 398msgid "Failed to initialize solver `%s'!\n"
399msgstr "Kunde inte initiera SQLite.\n" 399msgstr "Kunde inte initiera SQLite.\n"
400 400
401#: src/ats/gnunet-service-ats_addresses.c:2206 401#: src/ats/gnunet-service-ats_addresses.c:2210
402#, fuzzy 402#, fuzzy
403msgid "Failed to initialize solver!\n" 403msgid "Failed to initialize solver!\n"
404msgstr "Kunde inte initiera SQLite.\n" 404msgstr "Kunde inte initiera SQLite.\n"
@@ -4722,45 +4722,49 @@ msgstr "Kunde inte spara konfigurationsfil \"%s\":"
4722msgid "Failed to create directory `%s' for storing egos\n" 4722msgid "Failed to create directory `%s' for storing egos\n"
4723msgstr "Misslyckades att läsa kompislista från \"%s\"\n" 4723msgstr "Misslyckades att läsa kompislista från \"%s\"\n"
4724 4724
4725#: src/mesh/gnunet-mesh.c:300 4725#: src/mesh/gnunet-mesh.c:342
4726#, fuzzy, c-format 4726#, fuzzy, c-format
4727msgid "Invalid target `%s'\n" 4727msgid "Invalid target `%s'\n"
4728msgstr "Ogiltigt argument: \"%s\"\n" 4728msgstr "Ogiltigt argument: \"%s\"\n"
4729 4729
4730#: src/mesh/gnunet-mesh.c:434 4730#: src/mesh/gnunet-mesh.c:503
4731#, fuzzy, c-format 4731#, fuzzy, c-format
4732msgid "Invalid tunnel owner `%s'\n" 4732msgid "Invalid tunnel owner `%s'\n"
4733msgstr "Ogiltigt format för IP: \"%s\"\n" 4733msgstr "Ogiltigt format för IP: \"%s\"\n"
4734 4734
4735#: src/mesh/gnunet-mesh.c:499 4735#: src/mesh/gnunet-mesh.c:568
4736msgid "You must NOT give a TARGET when using options\n" 4736msgid "You must NOT give a TARGET when using options\n"
4737msgstr "" 4737msgstr ""
4738 4738
4739#: src/mesh/gnunet-mesh.c:576 4739#: src/mesh/gnunet-mesh.c:645
4740#, fuzzy 4740#, fuzzy
4741msgid "provide information about a particular channel" 4741msgid "provide information about a particular channel"
4742msgstr "Skriv ut information om GNUnets motparter." 4742msgstr "Skriv ut information om GNUnets motparter."
4743 4743
4744#: src/mesh/gnunet-mesh.c:579 4744#: src/mesh/gnunet-mesh.c:648
4745#, fuzzy 4745#, fuzzy
4746msgid "provide information about a particular connection" 4746msgid "provide information about a particular connection"
4747msgstr "Skriv ut information om GNUnets motparter." 4747msgstr "Skriv ut information om GNUnets motparter."
4748 4748
4749#: src/mesh/gnunet-mesh.c:582 4749#: src/mesh/gnunet-mesh.c:651
4750msgid "activate echo mode"
4751msgstr ""
4752
4753#: src/mesh/gnunet-mesh.c:654
4750#, fuzzy 4754#, fuzzy
4751msgid "provide information about all tunnels" 4755msgid "provide information about all tunnels"
4752msgstr "Skriv ut information om GNUnets motparter." 4756msgstr "Skriv ut information om GNUnets motparter."
4753 4757
4754#: src/mesh/gnunet-mesh.c:585 4758#: src/mesh/gnunet-mesh.c:657
4755#, fuzzy 4759#, fuzzy
4756msgid "provide information about all tunnels (continuously) NOT IMPLEMENTED" 4760msgid "provide information about all tunnels (continuously) NOT IMPLEMENTED"
4757msgstr "Skriv ut information om GNUnets motparter." 4761msgstr "Skriv ut information om GNUnets motparter."
4758 4762
4759#: src/mesh/gnunet-mesh.c:588 4763#: src/mesh/gnunet-mesh.c:660
4760msgid "port to listen to (default; 0)" 4764msgid "port to listen to (default; 0)"
4761msgstr "" 4765msgstr ""
4762 4766
4763#: src/mesh/gnunet-mesh.c:591 4767#: src/mesh/gnunet-mesh.c:663
4764#, fuzzy 4768#, fuzzy
4765msgid "provide information about a particular tunnel" 4769msgid "provide information about a particular tunnel"
4766msgstr "Skriv ut information om GNUnets motparter." 4770msgstr "Skriv ut information om GNUnets motparter."
@@ -6008,7 +6012,7 @@ msgstr "Misslyckades att ansluta till gnunetd.\n"
6008msgid "Failed to send a message to the scalarproduct service\n" 6012msgid "Failed to send a message to the scalarproduct service\n"
6009msgstr "Misslyckades att ansluta till gnunetd.\n" 6013msgstr "Misslyckades att ansluta till gnunetd.\n"
6010 6014
6011#: src/set/gnunet-service-set.c:1403 6015#: src/set/gnunet-service-set.c:1416
6012#, fuzzy 6016#, fuzzy
6013msgid "Could not connect to mesh service\n" 6017msgid "Could not connect to mesh service\n"
6014msgstr "Kunde inte ansluta till gnunetd.\n" 6018msgstr "Kunde inte ansluta till gnunetd.\n"
@@ -6146,6 +6150,16 @@ msgid ""
6146"deployments" 6150"deployments"
6147msgstr "" 6151msgstr ""
6148 6152
6153#: src/testbed/gnunet-daemon-testbed-underlay.c:300 src/testing/testing.c:293
6154#: src/util/gnunet-ecc.c:217
6155#, c-format
6156msgid "Incorrect hostkey file format: %s\n"
6157msgstr ""
6158
6159#: src/testbed/gnunet-daemon-testbed-underlay.c:553
6160msgid "Daemon to restrict underlay network in testbed deployments"
6161msgstr ""
6162
6149#: src/testbed/gnunet-service-testbed_cpustatus.c:727 6163#: src/testbed/gnunet-service-testbed_cpustatus.c:727
6150#, c-format 6164#, c-format
6151msgid "" 6165msgid ""
@@ -6363,11 +6377,6 @@ msgstr ""
6363msgid "Hostkeys file not found: %s\n" 6377msgid "Hostkeys file not found: %s\n"
6364msgstr "" 6378msgstr ""
6365 6379
6366#: src/testing/testing.c:293 src/util/gnunet-ecc.c:217
6367#, c-format
6368msgid "Incorrect hostkey file format: %s\n"
6369msgstr ""
6370
6371#: src/testing/testing.c:716 6380#: src/testing/testing.c:716
6372#, fuzzy, c-format 6381#, fuzzy, c-format
6373msgid "Key number %u does not exist\n" 6382msgid "Key number %u does not exist\n"
@@ -7245,44 +7254,44 @@ msgid "Unexpected address length: %u bytes\n"
7245msgstr "" 7254msgstr ""
7246 7255
7247#: src/transport/plugin_transport_tcp.c:799 7256#: src/transport/plugin_transport_tcp.c:799
7248#: src/transport/plugin_transport_tcp.c:979 7257#: src/transport/plugin_transport_tcp.c:980
7249#: src/transport/plugin_transport_tcp.c:2120 7258#: src/transport/plugin_transport_tcp.c:2120
7250#: src/transport/plugin_transport_tcp.c:2723 7259#: src/transport/plugin_transport_tcp.c:2723
7251#, fuzzy 7260#, fuzzy
7252msgid "# TCP sessions active" 7261msgid "# TCP sessions active"
7253msgstr "# sessionsnycklar accepterade" 7262msgstr "# sessionsnycklar accepterade"
7254 7263
7255#: src/transport/plugin_transport_tcp.c:835 7264#: src/transport/plugin_transport_tcp.c:836
7256#: src/transport/plugin_transport_tcp.c:972 7265#: src/transport/plugin_transport_tcp.c:973
7257#: src/transport/plugin_transport_tcp.c:1061 7266#: src/transport/plugin_transport_tcp.c:1062
7258#: src/transport/plugin_transport_tcp.c:1111 7267#: src/transport/plugin_transport_tcp.c:1112
7259#: src/transport/plugin_transport_tcp.c:1290 7268#: src/transport/plugin_transport_tcp.c:1291
7260#: src/transport/plugin_transport_tcp.c:1309 7269#: src/transport/plugin_transport_tcp.c:1310
7261#, fuzzy 7270#, fuzzy
7262msgid "# bytes currently in TCP buffers" 7271msgid "# bytes currently in TCP buffers"
7263msgstr "# byte skickades via TCP" 7272msgstr "# byte skickades via TCP"
7264 7273
7265#: src/transport/plugin_transport_tcp.c:839 7274#: src/transport/plugin_transport_tcp.c:840
7266#, fuzzy 7275#, fuzzy
7267msgid "# bytes discarded by TCP (disconnect)" 7276msgid "# bytes discarded by TCP (disconnect)"
7268msgstr "# byte kastade via TCP (utgående)" 7277msgstr "# byte kastade via TCP (utgående)"
7269 7278
7270#: src/transport/plugin_transport_tcp.c:1065 7279#: src/transport/plugin_transport_tcp.c:1066
7271#, fuzzy 7280#, fuzzy
7272msgid "# bytes discarded by TCP (timeout)" 7281msgid "# bytes discarded by TCP (timeout)"
7273msgstr "# byte kastade via TCP (utgående)" 7282msgstr "# byte kastade via TCP (utgående)"
7274 7283
7275#: src/transport/plugin_transport_tcp.c:1114 7284#: src/transport/plugin_transport_tcp.c:1115
7276#, fuzzy 7285#, fuzzy
7277msgid "# bytes transmitted via TCP" 7286msgid "# bytes transmitted via TCP"
7278msgstr "# byte skickade av typen %d" 7287msgstr "# byte skickade av typen %d"
7279 7288
7280#: src/transport/plugin_transport_tcp.c:1263 7289#: src/transport/plugin_transport_tcp.c:1264
7281#, c-format 7290#, c-format
7282msgid "Trying to send with invalid session %p\n" 7291msgid "Trying to send with invalid session %p\n"
7283msgstr "" 7292msgstr ""
7284 7293
7285#: src/transport/plugin_transport_tcp.c:1520 7294#: src/transport/plugin_transport_tcp.c:1521
7286#: src/transport/plugin_transport_udp.c:1488 7295#: src/transport/plugin_transport_udp.c:1488
7287msgid "# requests to create session with invalid address" 7296msgid "# requests to create session with invalid address"
7288msgstr "" 7297msgstr ""
@@ -8203,114 +8212,114 @@ msgstr "Anrop till \"%s\" returnerade %d.\n"
8203msgid "b" 8212msgid "b"
8204msgstr "b" 8213msgstr "b"
8205 8214
8206#: src/util/strings.c:452 8215#: src/util/strings.c:444
8207#, c-format 8216#, c-format
8208msgid "Character sets requested were `%s'->`%s'\n" 8217msgid "Character sets requested were `%s'->`%s'\n"
8209msgstr "" 8218msgstr ""
8210 8219
8211#: src/util/strings.c:580 8220#: src/util/strings.c:572
8212msgid "Failed to expand `$HOME': environment variable `HOME' not set" 8221msgid "Failed to expand `$HOME': environment variable `HOME' not set"
8213msgstr "" 8222msgstr ""
8214 8223
8215#: src/util/strings.c:677 8224#: src/util/strings.c:669
8216msgid "µs" 8225msgid "µs"
8217msgstr "" 8226msgstr ""
8218 8227
8219#: src/util/strings.c:681 8228#: src/util/strings.c:673
8220msgid "forever" 8229msgid "forever"
8221msgstr "" 8230msgstr ""
8222 8231
8223#: src/util/strings.c:683 8232#: src/util/strings.c:675
8224msgid "0 ms" 8233msgid "0 ms"
8225msgstr "" 8234msgstr ""
8226 8235
8227#: src/util/strings.c:689 8236#: src/util/strings.c:681
8228msgid "ms" 8237msgid "ms"
8229msgstr "ms" 8238msgstr "ms"
8230 8239
8231#: src/util/strings.c:695 8240#: src/util/strings.c:687
8232msgid "s" 8241msgid "s"
8233msgstr "s" 8242msgstr "s"
8234 8243
8235#: src/util/strings.c:701 8244#: src/util/strings.c:693
8236msgid "m" 8245msgid "m"
8237msgstr "m" 8246msgstr "m"
8238 8247
8239#: src/util/strings.c:707 8248#: src/util/strings.c:699
8240msgid "h" 8249msgid "h"
8241msgstr "h" 8250msgstr "h"
8242 8251
8243#: src/util/strings.c:714 8252#: src/util/strings.c:706
8244#, fuzzy 8253#, fuzzy
8245msgid "day" 8254msgid "day"
8246msgstr " dagar" 8255msgstr " dagar"
8247 8256
8248#: src/util/strings.c:716 8257#: src/util/strings.c:708
8249#, fuzzy 8258#, fuzzy
8250msgid "days" 8259msgid "days"
8251msgstr " dagar" 8260msgstr " dagar"
8252 8261
8253#: src/util/strings.c:745 8262#: src/util/strings.c:737
8254msgid "end of time" 8263msgid "end of time"
8255msgstr "" 8264msgstr ""
8256 8265
8257#: src/util/strings.c:1178 8266#: src/util/strings.c:1170
8258msgid "IPv6 address did not start with `['\n" 8267msgid "IPv6 address did not start with `['\n"
8259msgstr "" 8268msgstr ""
8260 8269
8261#: src/util/strings.c:1186 8270#: src/util/strings.c:1178
8262msgid "IPv6 address did contain ':' to separate port number\n" 8271msgid "IPv6 address did contain ':' to separate port number\n"
8263msgstr "" 8272msgstr ""
8264 8273
8265#: src/util/strings.c:1192 8274#: src/util/strings.c:1184
8266msgid "IPv6 address did contain ']' before ':' to separate port number\n" 8275msgid "IPv6 address did contain ']' before ':' to separate port number\n"
8267msgstr "" 8276msgstr ""
8268 8277
8269#: src/util/strings.c:1199 8278#: src/util/strings.c:1191
8270msgid "IPv6 address did contain a valid port number after the last ':'\n" 8279msgid "IPv6 address did contain a valid port number after the last ':'\n"
8271msgstr "" 8280msgstr ""
8272 8281
8273#: src/util/strings.c:1208 8282#: src/util/strings.c:1200
8274#, fuzzy, c-format 8283#, fuzzy, c-format
8275msgid "Invalid IPv6 address `%s': %s\n" 8284msgid "Invalid IPv6 address `%s': %s\n"
8276msgstr "Ogiltigt svar på \"%s\".\n" 8285msgstr "Ogiltigt svar på \"%s\".\n"
8277 8286
8278#: src/util/strings.c:1414 src/util/strings.c:1430 8287#: src/util/strings.c:1406 src/util/strings.c:1422
8279msgid "Port not in range\n" 8288msgid "Port not in range\n"
8280msgstr "" 8289msgstr ""
8281 8290
8282#: src/util/strings.c:1439 8291#: src/util/strings.c:1431
8283#, fuzzy, c-format 8292#, fuzzy, c-format
8284msgid "Malformed port policy `%s'\n" 8293msgid "Malformed port policy `%s'\n"
8285msgstr "Misslyckades att starta samling.\n" 8294msgstr "Misslyckades att starta samling.\n"
8286 8295
8287#: src/util/strings.c:1522 src/util/strings.c:1553 src/util/strings.c:1601 8296#: src/util/strings.c:1514 src/util/strings.c:1545 src/util/strings.c:1593
8288#: src/util/strings.c:1622 8297#: src/util/strings.c:1614
8289#, c-format 8298#, c-format
8290msgid "Invalid format for IP: `%s'\n" 8299msgid "Invalid format for IP: `%s'\n"
8291msgstr "Ogiltigt format för IP: \"%s\"\n" 8300msgstr "Ogiltigt format för IP: \"%s\"\n"
8292 8301
8293#: src/util/strings.c:1579 8302#: src/util/strings.c:1571
8294#, c-format 8303#, c-format
8295msgid "Invalid network notation ('/%d' is not legal in IPv4 CIDR)." 8304msgid "Invalid network notation ('/%d' is not legal in IPv4 CIDR)."
8296msgstr "Ogiltig nätverksnotation (\"/%d\" är inte giltig i IPv4 CIDR)." 8305msgstr "Ogiltig nätverksnotation (\"/%d\" är inte giltig i IPv4 CIDR)."
8297 8306
8298#: src/util/strings.c:1631 8307#: src/util/strings.c:1623
8299#, fuzzy, c-format 8308#, fuzzy, c-format
8300msgid "Invalid format: `%s'\n" 8309msgid "Invalid format: `%s'\n"
8301msgstr "Ogiltigt format för IP: \"%s\"\n" 8310msgstr "Ogiltigt format för IP: \"%s\"\n"
8302 8311
8303#: src/util/strings.c:1683 8312#: src/util/strings.c:1675
8304#, c-format 8313#, c-format
8305msgid "Invalid network notation (does not end with ';': `%s')\n" 8314msgid "Invalid network notation (does not end with ';': `%s')\n"
8306msgstr "Ogiltig nätverksnotation (slutar inte med \";\": \"%s\")\n" 8315msgstr "Ogiltig nätverksnotation (slutar inte med \";\": \"%s\")\n"
8307 8316
8308#: src/util/strings.c:1733 8317#: src/util/strings.c:1725
8309#, fuzzy, c-format 8318#, fuzzy, c-format
8310msgid "Wrong format `%s' for netmask\n" 8319msgid "Wrong format `%s' for netmask\n"
8311msgstr "Fel format \"%s\" för nätmask: %s\n" 8320msgstr "Fel format \"%s\" för nätmask: %s\n"
8312 8321
8313#: src/util/strings.c:1764 8322#: src/util/strings.c:1756
8314#, fuzzy, c-format 8323#, fuzzy, c-format
8315msgid "Wrong format `%s' for network\n" 8324msgid "Wrong format `%s' for network\n"
8316msgstr "Fel format \"%s\" för nätverk: %s\n" 8325msgstr "Fel format \"%s\" för nätverk: %s\n"
diff --git a/po/vi.po b/po/vi.po
index d9958a433..5176d83aa 100644
--- a/po/vi.po
+++ b/po/vi.po
@@ -8,7 +8,7 @@ msgid ""
8msgstr "" 8msgstr ""
9"Project-Id-Version: gnunet 0.8.0a\n" 9"Project-Id-Version: gnunet 0.8.0a\n"
10"Report-Msgid-Bugs-To: gnunet-developers@mail.gnu.org\n" 10"Report-Msgid-Bugs-To: gnunet-developers@mail.gnu.org\n"
11"POT-Creation-Date: 2013-12-24 21:07+0100\n" 11"POT-Creation-Date: 2014-01-05 13:20+0100\n"
12"PO-Revision-Date: 2008-09-10 22:05+0930\n" 12"PO-Revision-Date: 2008-09-10 22:05+0930\n"
13"Last-Translator: Clytie Siddall <clytie@riverland.net.au>\n" 13"Last-Translator: Clytie Siddall <clytie@riverland.net.au>\n"
14"Language-Team: Vietnamese <vi-VN@googlegroups.com>\n" 14"Language-Team: Vietnamese <vi-VN@googlegroups.com>\n"
@@ -394,17 +394,17 @@ msgid ""
394"%llu\n" 394"%llu\n"
395msgstr "" 395msgstr ""
396 396
397#: src/ats/gnunet-service-ats_addresses.c:2180 397#: src/ats/gnunet-service-ats_addresses.c:2184
398#, c-format 398#, c-format
399msgid "Initializing solver `%s '`%s'\n" 399msgid "Initializing solver `%s '`%s'\n"
400msgstr "" 400msgstr ""
401 401
402#: src/ats/gnunet-service-ats_addresses.c:2183 402#: src/ats/gnunet-service-ats_addresses.c:2187
403#, fuzzy, c-format 403#, fuzzy, c-format
404msgid "Failed to initialize solver `%s'!\n" 404msgid "Failed to initialize solver `%s'!\n"
405msgstr "Không thể sơ khởi SQLite: %s.\n" 405msgstr "Không thể sơ khởi SQLite: %s.\n"
406 406
407#: src/ats/gnunet-service-ats_addresses.c:2206 407#: src/ats/gnunet-service-ats_addresses.c:2210
408#, fuzzy 408#, fuzzy
409msgid "Failed to initialize solver!\n" 409msgid "Failed to initialize solver!\n"
410msgstr "Không thể sơ khởi SQLite: %s.\n" 410msgstr "Không thể sơ khởi SQLite: %s.\n"
@@ -4786,45 +4786,49 @@ msgstr "Không thể lưu tập tin cấu hình « %s »:"
4786msgid "Failed to create directory `%s' for storing egos\n" 4786msgid "Failed to create directory `%s' for storing egos\n"
4787msgstr "Lỗi đọc danh sách bạn bè từ « %s »\n" 4787msgstr "Lỗi đọc danh sách bạn bè từ « %s »\n"
4788 4788
4789#: src/mesh/gnunet-mesh.c:300 4789#: src/mesh/gnunet-mesh.c:342
4790#, fuzzy, c-format 4790#, fuzzy, c-format
4791msgid "Invalid target `%s'\n" 4791msgid "Invalid target `%s'\n"
4792msgstr "Đối số không hợp lệ cho « %s ».\n" 4792msgstr "Đối số không hợp lệ cho « %s ».\n"
4793 4793
4794#: src/mesh/gnunet-mesh.c:434 4794#: src/mesh/gnunet-mesh.c:503
4795#, fuzzy, c-format 4795#, fuzzy, c-format
4796msgid "Invalid tunnel owner `%s'\n" 4796msgid "Invalid tunnel owner `%s'\n"
4797msgstr "Địa chỉ IP định dạng sai: %s\n" 4797msgstr "Địa chỉ IP định dạng sai: %s\n"
4798 4798
4799#: src/mesh/gnunet-mesh.c:499 4799#: src/mesh/gnunet-mesh.c:568
4800msgid "You must NOT give a TARGET when using options\n" 4800msgid "You must NOT give a TARGET when using options\n"
4801msgstr "" 4801msgstr ""
4802 4802
4803#: src/mesh/gnunet-mesh.c:576 4803#: src/mesh/gnunet-mesh.c:645
4804#, fuzzy 4804#, fuzzy
4805msgid "provide information about a particular channel" 4805msgid "provide information about a particular channel"
4806msgstr "In ra thông tin về các đồng đẳng GNUnet." 4806msgstr "In ra thông tin về các đồng đẳng GNUnet."
4807 4807
4808#: src/mesh/gnunet-mesh.c:579 4808#: src/mesh/gnunet-mesh.c:648
4809#, fuzzy 4809#, fuzzy
4810msgid "provide information about a particular connection" 4810msgid "provide information about a particular connection"
4811msgstr "In ra thông tin về các đồng đẳng GNUnet." 4811msgstr "In ra thông tin về các đồng đẳng GNUnet."
4812 4812
4813#: src/mesh/gnunet-mesh.c:582 4813#: src/mesh/gnunet-mesh.c:651
4814msgid "activate echo mode"
4815msgstr ""
4816
4817#: src/mesh/gnunet-mesh.c:654
4814#, fuzzy 4818#, fuzzy
4815msgid "provide information about all tunnels" 4819msgid "provide information about all tunnels"
4816msgstr "In ra thông tin về các đồng đẳng GNUnet." 4820msgstr "In ra thông tin về các đồng đẳng GNUnet."
4817 4821
4818#: src/mesh/gnunet-mesh.c:585 4822#: src/mesh/gnunet-mesh.c:657
4819#, fuzzy 4823#, fuzzy
4820msgid "provide information about all tunnels (continuously) NOT IMPLEMENTED" 4824msgid "provide information about all tunnels (continuously) NOT IMPLEMENTED"
4821msgstr "In ra thông tin về các đồng đẳng GNUnet." 4825msgstr "In ra thông tin về các đồng đẳng GNUnet."
4822 4826
4823#: src/mesh/gnunet-mesh.c:588 4827#: src/mesh/gnunet-mesh.c:660
4824msgid "port to listen to (default; 0)" 4828msgid "port to listen to (default; 0)"
4825msgstr "" 4829msgstr ""
4826 4830
4827#: src/mesh/gnunet-mesh.c:591 4831#: src/mesh/gnunet-mesh.c:663
4828#, fuzzy 4832#, fuzzy
4829msgid "provide information about a particular tunnel" 4833msgid "provide information about a particular tunnel"
4830msgstr "In ra thông tin về các đồng đẳng GNUnet." 4834msgstr "In ra thông tin về các đồng đẳng GNUnet."
@@ -6071,7 +6075,7 @@ msgstr "Lỗi kết nối đến gnunetd.\n"
6071msgid "Failed to send a message to the scalarproduct service\n" 6075msgid "Failed to send a message to the scalarproduct service\n"
6072msgstr "Lỗi kết nối đến gnunetd.\n" 6076msgstr "Lỗi kết nối đến gnunetd.\n"
6073 6077
6074#: src/set/gnunet-service-set.c:1403 6078#: src/set/gnunet-service-set.c:1416
6075#, fuzzy 6079#, fuzzy
6076msgid "Could not connect to mesh service\n" 6080msgid "Could not connect to mesh service\n"
6077msgstr "Không thể kết nối tới %s:%u: %s\n" 6081msgstr "Không thể kết nối tới %s:%u: %s\n"
@@ -6209,6 +6213,16 @@ msgid ""
6209"deployments" 6213"deployments"
6210msgstr "" 6214msgstr ""
6211 6215
6216#: src/testbed/gnunet-daemon-testbed-underlay.c:300 src/testing/testing.c:293
6217#: src/util/gnunet-ecc.c:217
6218#, c-format
6219msgid "Incorrect hostkey file format: %s\n"
6220msgstr ""
6221
6222#: src/testbed/gnunet-daemon-testbed-underlay.c:553
6223msgid "Daemon to restrict underlay network in testbed deployments"
6224msgstr ""
6225
6212#: src/testbed/gnunet-service-testbed_cpustatus.c:727 6226#: src/testbed/gnunet-service-testbed_cpustatus.c:727
6213#, c-format 6227#, c-format
6214msgid "" 6228msgid ""
@@ -6426,11 +6440,6 @@ msgstr ""
6426msgid "Hostkeys file not found: %s\n" 6440msgid "Hostkeys file not found: %s\n"
6427msgstr "" 6441msgstr ""
6428 6442
6429#: src/testing/testing.c:293 src/util/gnunet-ecc.c:217
6430#, c-format
6431msgid "Incorrect hostkey file format: %s\n"
6432msgstr ""
6433
6434#: src/testing/testing.c:716 6443#: src/testing/testing.c:716
6435#, fuzzy, c-format 6444#, fuzzy, c-format
6436msgid "Key number %u does not exist\n" 6445msgid "Key number %u does not exist\n"
@@ -7308,44 +7317,44 @@ msgid "Unexpected address length: %u bytes\n"
7308msgstr "Gặp sự kiện bất thường: %d\n" 7317msgstr "Gặp sự kiện bất thường: %d\n"
7309 7318
7310#: src/transport/plugin_transport_tcp.c:799 7319#: src/transport/plugin_transport_tcp.c:799
7311#: src/transport/plugin_transport_tcp.c:979 7320#: src/transport/plugin_transport_tcp.c:980
7312#: src/transport/plugin_transport_tcp.c:2120 7321#: src/transport/plugin_transport_tcp.c:2120
7313#: src/transport/plugin_transport_tcp.c:2723 7322#: src/transport/plugin_transport_tcp.c:2723
7314#, fuzzy 7323#, fuzzy
7315msgid "# TCP sessions active" 7324msgid "# TCP sessions active"
7316msgstr "# các khoá phiên chạy được chấp nhận" 7325msgstr "# các khoá phiên chạy được chấp nhận"
7317 7326
7318#: src/transport/plugin_transport_tcp.c:835 7327#: src/transport/plugin_transport_tcp.c:836
7319#: src/transport/plugin_transport_tcp.c:972 7328#: src/transport/plugin_transport_tcp.c:973
7320#: src/transport/plugin_transport_tcp.c:1061 7329#: src/transport/plugin_transport_tcp.c:1062
7321#: src/transport/plugin_transport_tcp.c:1111 7330#: src/transport/plugin_transport_tcp.c:1112
7322#: src/transport/plugin_transport_tcp.c:1290 7331#: src/transport/plugin_transport_tcp.c:1291
7323#: src/transport/plugin_transport_tcp.c:1309 7332#: src/transport/plugin_transport_tcp.c:1310
7324#, fuzzy 7333#, fuzzy
7325msgid "# bytes currently in TCP buffers" 7334msgid "# bytes currently in TCP buffers"
7326msgstr "# các byte đã gừi qua TCP" 7335msgstr "# các byte đã gừi qua TCP"
7327 7336
7328#: src/transport/plugin_transport_tcp.c:839 7337#: src/transport/plugin_transport_tcp.c:840
7329#, fuzzy 7338#, fuzzy
7330msgid "# bytes discarded by TCP (disconnect)" 7339msgid "# bytes discarded by TCP (disconnect)"
7331msgstr "# các byte loại đi bởi TCP (đi ra)" 7340msgstr "# các byte loại đi bởi TCP (đi ra)"
7332 7341
7333#: src/transport/plugin_transport_tcp.c:1065 7342#: src/transport/plugin_transport_tcp.c:1066
7334#, fuzzy 7343#, fuzzy
7335msgid "# bytes discarded by TCP (timeout)" 7344msgid "# bytes discarded by TCP (timeout)"
7336msgstr "# các byte loại đi bởi TCP (đi ra)" 7345msgstr "# các byte loại đi bởi TCP (đi ra)"
7337 7346
7338#: src/transport/plugin_transport_tcp.c:1114 7347#: src/transport/plugin_transport_tcp.c:1115
7339#, fuzzy 7348#, fuzzy
7340msgid "# bytes transmitted via TCP" 7349msgid "# bytes transmitted via TCP"
7341msgstr "# các byte được gửi" 7350msgstr "# các byte được gửi"
7342 7351
7343#: src/transport/plugin_transport_tcp.c:1263 7352#: src/transport/plugin_transport_tcp.c:1264
7344#, c-format 7353#, c-format
7345msgid "Trying to send with invalid session %p\n" 7354msgid "Trying to send with invalid session %p\n"
7346msgstr "" 7355msgstr ""
7347 7356
7348#: src/transport/plugin_transport_tcp.c:1520 7357#: src/transport/plugin_transport_tcp.c:1521
7349#: src/transport/plugin_transport_udp.c:1488 7358#: src/transport/plugin_transport_udp.c:1488
7350msgid "# requests to create session with invalid address" 7359msgid "# requests to create session with invalid address"
7351msgstr "" 7360msgstr ""
@@ -8265,115 +8274,115 @@ msgstr ""
8265msgid "b" 8274msgid "b"
8266msgstr "b" 8275msgstr "b"
8267 8276
8268#: src/util/strings.c:452 8277#: src/util/strings.c:444
8269#, c-format 8278#, c-format
8270msgid "Character sets requested were `%s'->`%s'\n" 8279msgid "Character sets requested were `%s'->`%s'\n"
8271msgstr "" 8280msgstr ""
8272 8281
8273#: src/util/strings.c:580 8282#: src/util/strings.c:572
8274msgid "Failed to expand `$HOME': environment variable `HOME' not set" 8283msgid "Failed to expand `$HOME': environment variable `HOME' not set"
8275msgstr "" 8284msgstr ""
8276"Lỗi mở rộng biến môi trường « $HOME »: chưa đặt biến môi trường « HOME »" 8285"Lỗi mở rộng biến môi trường « $HOME »: chưa đặt biến môi trường « HOME »"
8277 8286
8278#: src/util/strings.c:677 8287#: src/util/strings.c:669
8279msgid "µs" 8288msgid "µs"
8280msgstr "" 8289msgstr ""
8281 8290
8282#: src/util/strings.c:681 8291#: src/util/strings.c:673
8283msgid "forever" 8292msgid "forever"
8284msgstr "" 8293msgstr ""
8285 8294
8286#: src/util/strings.c:683 8295#: src/util/strings.c:675
8287msgid "0 ms" 8296msgid "0 ms"
8288msgstr "" 8297msgstr ""
8289 8298
8290#: src/util/strings.c:689 8299#: src/util/strings.c:681
8291msgid "ms" 8300msgid "ms"
8292msgstr "mg" 8301msgstr "mg"
8293 8302
8294#: src/util/strings.c:695 8303#: src/util/strings.c:687
8295msgid "s" 8304msgid "s"
8296msgstr "g" 8305msgstr "g"
8297 8306
8298#: src/util/strings.c:701 8307#: src/util/strings.c:693
8299msgid "m" 8308msgid "m"
8300msgstr "p" 8309msgstr "p"
8301 8310
8302#: src/util/strings.c:707 8311#: src/util/strings.c:699
8303msgid "h" 8312msgid "h"
8304msgstr "g" 8313msgstr "g"
8305 8314
8306#: src/util/strings.c:714 8315#: src/util/strings.c:706
8307#, fuzzy 8316#, fuzzy
8308msgid "day" 8317msgid "day"
8309msgstr " ngày" 8318msgstr " ngày"
8310 8319
8311#: src/util/strings.c:716 8320#: src/util/strings.c:708
8312#, fuzzy 8321#, fuzzy
8313msgid "days" 8322msgid "days"
8314msgstr " ngày" 8323msgstr " ngày"
8315 8324
8316#: src/util/strings.c:745 8325#: src/util/strings.c:737
8317msgid "end of time" 8326msgid "end of time"
8318msgstr "" 8327msgstr ""
8319 8328
8320#: src/util/strings.c:1178 8329#: src/util/strings.c:1170
8321msgid "IPv6 address did not start with `['\n" 8330msgid "IPv6 address did not start with `['\n"
8322msgstr "" 8331msgstr ""
8323 8332
8324#: src/util/strings.c:1186 8333#: src/util/strings.c:1178
8325msgid "IPv6 address did contain ':' to separate port number\n" 8334msgid "IPv6 address did contain ':' to separate port number\n"
8326msgstr "" 8335msgstr ""
8327 8336
8328#: src/util/strings.c:1192 8337#: src/util/strings.c:1184
8329msgid "IPv6 address did contain ']' before ':' to separate port number\n" 8338msgid "IPv6 address did contain ']' before ':' to separate port number\n"
8330msgstr "" 8339msgstr ""
8331 8340
8332#: src/util/strings.c:1199 8341#: src/util/strings.c:1191
8333msgid "IPv6 address did contain a valid port number after the last ':'\n" 8342msgid "IPv6 address did contain a valid port number after the last ':'\n"
8334msgstr "" 8343msgstr ""
8335 8344
8336#: src/util/strings.c:1208 8345#: src/util/strings.c:1200
8337#, fuzzy, c-format 8346#, fuzzy, c-format
8338msgid "Invalid IPv6 address `%s': %s\n" 8347msgid "Invalid IPv6 address `%s': %s\n"
8339msgstr "Mức ưu tiên tiến trình không hợp lê « %s ».\n" 8348msgstr "Mức ưu tiên tiến trình không hợp lê « %s ».\n"
8340 8349
8341#: src/util/strings.c:1414 src/util/strings.c:1430 8350#: src/util/strings.c:1406 src/util/strings.c:1422
8342msgid "Port not in range\n" 8351msgid "Port not in range\n"
8343msgstr "" 8352msgstr ""
8344 8353
8345#: src/util/strings.c:1439 8354#: src/util/strings.c:1431
8346#, fuzzy, c-format 8355#, fuzzy, c-format
8347msgid "Malformed port policy `%s'\n" 8356msgid "Malformed port policy `%s'\n"
8348msgstr "Lỗi bắt đầu thu thập.\n" 8357msgstr "Lỗi bắt đầu thu thập.\n"
8349 8358
8350#: src/util/strings.c:1522 src/util/strings.c:1553 src/util/strings.c:1601 8359#: src/util/strings.c:1514 src/util/strings.c:1545 src/util/strings.c:1593
8351#: src/util/strings.c:1622 8360#: src/util/strings.c:1614
8352#, c-format 8361#, c-format
8353msgid "Invalid format for IP: `%s'\n" 8362msgid "Invalid format for IP: `%s'\n"
8354msgstr "Địa chỉ IP định dạng sai: %s\n" 8363msgstr "Địa chỉ IP định dạng sai: %s\n"
8355 8364
8356#: src/util/strings.c:1579 8365#: src/util/strings.c:1571
8357#, c-format 8366#, c-format
8358msgid "Invalid network notation ('/%d' is not legal in IPv4 CIDR)." 8367msgid "Invalid network notation ('/%d' is not legal in IPv4 CIDR)."
8359msgstr "Ký hiệu mạng sai (« /%d » không hợp lệ trong CIDR IPv4)." 8368msgstr "Ký hiệu mạng sai (« /%d » không hợp lệ trong CIDR IPv4)."
8360 8369
8361#: src/util/strings.c:1631 8370#: src/util/strings.c:1623
8362#, fuzzy, c-format 8371#, fuzzy, c-format
8363msgid "Invalid format: `%s'\n" 8372msgid "Invalid format: `%s'\n"
8364msgstr "Địa chỉ IP định dạng sai: %s\n" 8373msgstr "Địa chỉ IP định dạng sai: %s\n"
8365 8374
8366#: src/util/strings.c:1683 8375#: src/util/strings.c:1675
8367#, c-format 8376#, c-format
8368msgid "Invalid network notation (does not end with ';': `%s')\n" 8377msgid "Invalid network notation (does not end with ';': `%s')\n"
8369msgstr "Ký hiệu mạng sai (không kết thúc với « ; »: « %s »)\n" 8378msgstr "Ký hiệu mạng sai (không kết thúc với « ; »: « %s »)\n"
8370 8379
8371#: src/util/strings.c:1733 8380#: src/util/strings.c:1725
8372#, fuzzy, c-format 8381#, fuzzy, c-format
8373msgid "Wrong format `%s' for netmask\n" 8382msgid "Wrong format `%s' for netmask\n"
8374msgstr "Mặt nạ mạng có định dạng sai « %s »: %s\n" 8383msgstr "Mặt nạ mạng có định dạng sai « %s »: %s\n"
8375 8384
8376#: src/util/strings.c:1764 8385#: src/util/strings.c:1756
8377#, fuzzy, c-format 8386#, fuzzy, c-format
8378msgid "Wrong format `%s' for network\n" 8387msgid "Wrong format `%s' for network\n"
8379msgstr "Mạng có định dạng sai « %s »: %s\n" 8388msgstr "Mạng có định dạng sai « %s »: %s\n"
diff --git a/po/zh_CN.po b/po/zh_CN.po
index 0ba9bfdf8..966abf80b 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -7,7 +7,7 @@ msgid ""
7msgstr "" 7msgstr ""
8"Project-Id-Version: gnunet-0.8.1\n" 8"Project-Id-Version: gnunet-0.8.1\n"
9"Report-Msgid-Bugs-To: gnunet-developers@mail.gnu.org\n" 9"Report-Msgid-Bugs-To: gnunet-developers@mail.gnu.org\n"
10"POT-Creation-Date: 2013-12-24 21:07+0100\n" 10"POT-Creation-Date: 2014-01-05 13:20+0100\n"
11"PO-Revision-Date: 2011-07-09 12:12+0800\n" 11"PO-Revision-Date: 2011-07-09 12:12+0800\n"
12"Last-Translator: Wylmer Wang <wantinghard@gmail.com>\n" 12"Last-Translator: Wylmer Wang <wantinghard@gmail.com>\n"
13"Language-Team: Chinese (simplified) <i18n-zh@googlegroups.com>\n" 13"Language-Team: Chinese (simplified) <i18n-zh@googlegroups.com>\n"
@@ -387,17 +387,17 @@ msgid ""
387"%llu\n" 387"%llu\n"
388msgstr "" 388msgstr ""
389 389
390#: src/ats/gnunet-service-ats_addresses.c:2180 390#: src/ats/gnunet-service-ats_addresses.c:2184
391#, c-format 391#, c-format
392msgid "Initializing solver `%s '`%s'\n" 392msgid "Initializing solver `%s '`%s'\n"
393msgstr "" 393msgstr ""
394 394
395#: src/ats/gnunet-service-ats_addresses.c:2183 395#: src/ats/gnunet-service-ats_addresses.c:2187
396#, fuzzy, c-format 396#, fuzzy, c-format
397msgid "Failed to initialize solver `%s'!\n" 397msgid "Failed to initialize solver `%s'!\n"
398msgstr "无法初始化 SQLite:%s。\n" 398msgstr "无法初始化 SQLite:%s。\n"
399 399
400#: src/ats/gnunet-service-ats_addresses.c:2206 400#: src/ats/gnunet-service-ats_addresses.c:2210
401#, fuzzy 401#, fuzzy
402msgid "Failed to initialize solver!\n" 402msgid "Failed to initialize solver!\n"
403msgstr "无法初始化 SQLite:%s。\n" 403msgstr "无法初始化 SQLite:%s。\n"
@@ -4564,44 +4564,48 @@ msgstr "解析配置文件“%s”失败\n"
4564msgid "Failed to create directory `%s' for storing egos\n" 4564msgid "Failed to create directory `%s' for storing egos\n"
4565msgstr "解析配置文件“%s”失败\n" 4565msgstr "解析配置文件“%s”失败\n"
4566 4566
4567#: src/mesh/gnunet-mesh.c:300 4567#: src/mesh/gnunet-mesh.c:342
4568#, fuzzy, c-format 4568#, fuzzy, c-format
4569msgid "Invalid target `%s'\n" 4569msgid "Invalid target `%s'\n"
4570msgstr "“%s”的参数无效。\n" 4570msgstr "“%s”的参数无效。\n"
4571 4571
4572#: src/mesh/gnunet-mesh.c:434 4572#: src/mesh/gnunet-mesh.c:503
4573#, fuzzy, c-format 4573#, fuzzy, c-format
4574msgid "Invalid tunnel owner `%s'\n" 4574msgid "Invalid tunnel owner `%s'\n"
4575msgstr "IP 格式无效:“%s”\n" 4575msgstr "IP 格式无效:“%s”\n"
4576 4576
4577#: src/mesh/gnunet-mesh.c:499 4577#: src/mesh/gnunet-mesh.c:568
4578msgid "You must NOT give a TARGET when using options\n" 4578msgid "You must NOT give a TARGET when using options\n"
4579msgstr "" 4579msgstr ""
4580 4580
4581#: src/mesh/gnunet-mesh.c:576 4581#: src/mesh/gnunet-mesh.c:645
4582#, fuzzy 4582#, fuzzy
4583msgid "provide information about a particular channel" 4583msgid "provide information about a particular channel"
4584msgstr "无法获取有关用户“%s”的信息:%s\n" 4584msgstr "无法获取有关用户“%s”的信息:%s\n"
4585 4585
4586#: src/mesh/gnunet-mesh.c:579 4586#: src/mesh/gnunet-mesh.c:648
4587#, fuzzy 4587#, fuzzy
4588msgid "provide information about a particular connection" 4588msgid "provide information about a particular connection"
4589msgstr "无法获取有关用户“%s”的信息:%s\n" 4589msgstr "无法获取有关用户“%s”的信息:%s\n"
4590 4590
4591#: src/mesh/gnunet-mesh.c:582 4591#: src/mesh/gnunet-mesh.c:651
4592msgid "activate echo mode"
4593msgstr ""
4594
4595#: src/mesh/gnunet-mesh.c:654
4592#, fuzzy 4596#, fuzzy
4593msgid "provide information about all tunnels" 4597msgid "provide information about all tunnels"
4594msgstr "无法获取有关用户“%s”的信息:%s\n" 4598msgstr "无法获取有关用户“%s”的信息:%s\n"
4595 4599
4596#: src/mesh/gnunet-mesh.c:585 4600#: src/mesh/gnunet-mesh.c:657
4597msgid "provide information about all tunnels (continuously) NOT IMPLEMENTED" 4601msgid "provide information about all tunnels (continuously) NOT IMPLEMENTED"
4598msgstr "" 4602msgstr ""
4599 4603
4600#: src/mesh/gnunet-mesh.c:588 4604#: src/mesh/gnunet-mesh.c:660
4601msgid "port to listen to (default; 0)" 4605msgid "port to listen to (default; 0)"
4602msgstr "" 4606msgstr ""
4603 4607
4604#: src/mesh/gnunet-mesh.c:591 4608#: src/mesh/gnunet-mesh.c:663
4605#, fuzzy 4609#, fuzzy
4606msgid "provide information about a particular tunnel" 4610msgid "provide information about a particular tunnel"
4607msgstr "无法获取有关用户“%s”的信息:%s\n" 4611msgstr "无法获取有关用户“%s”的信息:%s\n"
@@ -5821,7 +5825,7 @@ msgstr "初始化“%s”服务失败。\n"
5821msgid "Failed to send a message to the scalarproduct service\n" 5825msgid "Failed to send a message to the scalarproduct service\n"
5822msgstr "初始化“%s”服务失败。\n" 5826msgstr "初始化“%s”服务失败。\n"
5823 5827
5824#: src/set/gnunet-service-set.c:1403 5828#: src/set/gnunet-service-set.c:1416
5825#, fuzzy 5829#, fuzzy
5826msgid "Could not connect to mesh service\n" 5830msgid "Could not connect to mesh service\n"
5827msgstr "无法连接到 %s:%u:%s\n" 5831msgstr "无法连接到 %s:%u:%s\n"
@@ -5959,6 +5963,16 @@ msgid ""
5959"deployments" 5963"deployments"
5960msgstr "" 5964msgstr ""
5961 5965
5966#: src/testbed/gnunet-daemon-testbed-underlay.c:300 src/testing/testing.c:293
5967#: src/util/gnunet-ecc.c:217
5968#, c-format
5969msgid "Incorrect hostkey file format: %s\n"
5970msgstr ""
5971
5972#: src/testbed/gnunet-daemon-testbed-underlay.c:553
5973msgid "Daemon to restrict underlay network in testbed deployments"
5974msgstr ""
5975
5962#: src/testbed/gnunet-service-testbed_cpustatus.c:727 5976#: src/testbed/gnunet-service-testbed_cpustatus.c:727
5963#, c-format 5977#, c-format
5964msgid "" 5978msgid ""
@@ -6175,11 +6189,6 @@ msgstr ""
6175msgid "Hostkeys file not found: %s\n" 6189msgid "Hostkeys file not found: %s\n"
6176msgstr "" 6190msgstr ""
6177 6191
6178#: src/testing/testing.c:293 src/util/gnunet-ecc.c:217
6179#, c-format
6180msgid "Incorrect hostkey file format: %s\n"
6181msgstr ""
6182
6183#: src/testing/testing.c:716 6192#: src/testing/testing.c:716
6184#, c-format 6193#, c-format
6185msgid "Key number %u does not exist\n" 6194msgid "Key number %u does not exist\n"
@@ -7007,39 +7016,39 @@ msgid "Unexpected address length: %u bytes\n"
7007msgstr "" 7016msgstr ""
7008 7017
7009#: src/transport/plugin_transport_tcp.c:799 7018#: src/transport/plugin_transport_tcp.c:799
7010#: src/transport/plugin_transport_tcp.c:979 7019#: src/transport/plugin_transport_tcp.c:980
7011#: src/transport/plugin_transport_tcp.c:2120 7020#: src/transport/plugin_transport_tcp.c:2120
7012#: src/transport/plugin_transport_tcp.c:2723 7021#: src/transport/plugin_transport_tcp.c:2723
7013msgid "# TCP sessions active" 7022msgid "# TCP sessions active"
7014msgstr "" 7023msgstr ""
7015 7024
7016#: src/transport/plugin_transport_tcp.c:835 7025#: src/transport/plugin_transport_tcp.c:836
7017#: src/transport/plugin_transport_tcp.c:972 7026#: src/transport/plugin_transport_tcp.c:973
7018#: src/transport/plugin_transport_tcp.c:1061 7027#: src/transport/plugin_transport_tcp.c:1062
7019#: src/transport/plugin_transport_tcp.c:1111 7028#: src/transport/plugin_transport_tcp.c:1112
7020#: src/transport/plugin_transport_tcp.c:1290 7029#: src/transport/plugin_transport_tcp.c:1291
7021#: src/transport/plugin_transport_tcp.c:1309 7030#: src/transport/plugin_transport_tcp.c:1310
7022msgid "# bytes currently in TCP buffers" 7031msgid "# bytes currently in TCP buffers"
7023msgstr "" 7032msgstr ""
7024 7033
7025#: src/transport/plugin_transport_tcp.c:839 7034#: src/transport/plugin_transport_tcp.c:840
7026msgid "# bytes discarded by TCP (disconnect)" 7035msgid "# bytes discarded by TCP (disconnect)"
7027msgstr "" 7036msgstr ""
7028 7037
7029#: src/transport/plugin_transport_tcp.c:1065 7038#: src/transport/plugin_transport_tcp.c:1066
7030msgid "# bytes discarded by TCP (timeout)" 7039msgid "# bytes discarded by TCP (timeout)"
7031msgstr "" 7040msgstr ""
7032 7041
7033#: src/transport/plugin_transport_tcp.c:1114 7042#: src/transport/plugin_transport_tcp.c:1115
7034msgid "# bytes transmitted via TCP" 7043msgid "# bytes transmitted via TCP"
7035msgstr "" 7044msgstr ""
7036 7045
7037#: src/transport/plugin_transport_tcp.c:1263 7046#: src/transport/plugin_transport_tcp.c:1264
7038#, c-format 7047#, c-format
7039msgid "Trying to send with invalid session %p\n" 7048msgid "Trying to send with invalid session %p\n"
7040msgstr "" 7049msgstr ""
7041 7050
7042#: src/transport/plugin_transport_tcp.c:1520 7051#: src/transport/plugin_transport_tcp.c:1521
7043#: src/transport/plugin_transport_udp.c:1488 7052#: src/transport/plugin_transport_udp.c:1488
7044msgid "# requests to create session with invalid address" 7053msgid "# requests to create session with invalid address"
7045msgstr "" 7054msgstr ""
@@ -7938,114 +7947,114 @@ msgstr ""
7938msgid "b" 7947msgid "b"
7939msgstr "b" 7948msgstr "b"
7940 7949
7941#: src/util/strings.c:452 7950#: src/util/strings.c:444
7942#, c-format 7951#, c-format
7943msgid "Character sets requested were `%s'->`%s'\n" 7952msgid "Character sets requested were `%s'->`%s'\n"
7944msgstr "" 7953msgstr ""
7945 7954
7946#: src/util/strings.c:580 7955#: src/util/strings.c:572
7947msgid "Failed to expand `$HOME': environment variable `HOME' not set" 7956msgid "Failed to expand `$HOME': environment variable `HOME' not set"
7948msgstr "扩展“$HOME”失败:没有设置环境变量“HOME”" 7957msgstr "扩展“$HOME”失败:没有设置环境变量“HOME”"
7949 7958
7950#: src/util/strings.c:677 7959#: src/util/strings.c:669
7951msgid "µs" 7960msgid "µs"
7952msgstr "" 7961msgstr ""
7953 7962
7954#: src/util/strings.c:681 7963#: src/util/strings.c:673
7955msgid "forever" 7964msgid "forever"
7956msgstr "" 7965msgstr ""
7957 7966
7958#: src/util/strings.c:683 7967#: src/util/strings.c:675
7959msgid "0 ms" 7968msgid "0 ms"
7960msgstr "" 7969msgstr ""
7961 7970
7962#: src/util/strings.c:689 7971#: src/util/strings.c:681
7963msgid "ms" 7972msgid "ms"
7964msgstr "毫秒" 7973msgstr "毫秒"
7965 7974
7966#: src/util/strings.c:695 7975#: src/util/strings.c:687
7967msgid "s" 7976msgid "s"
7968msgstr "秒" 7977msgstr "秒"
7969 7978
7970#: src/util/strings.c:701 7979#: src/util/strings.c:693
7971msgid "m" 7980msgid "m"
7972msgstr "分" 7981msgstr "分"
7973 7982
7974#: src/util/strings.c:707 7983#: src/util/strings.c:699
7975msgid "h" 7984msgid "h"
7976msgstr "时" 7985msgstr "时"
7977 7986
7978#: src/util/strings.c:714 7987#: src/util/strings.c:706
7979#, fuzzy 7988#, fuzzy
7980msgid "day" 7989msgid "day"
7981msgstr " 天" 7990msgstr " 天"
7982 7991
7983#: src/util/strings.c:716 7992#: src/util/strings.c:708
7984#, fuzzy 7993#, fuzzy
7985msgid "days" 7994msgid "days"
7986msgstr " 天" 7995msgstr " 天"
7987 7996
7988#: src/util/strings.c:745 7997#: src/util/strings.c:737
7989msgid "end of time" 7998msgid "end of time"
7990msgstr "" 7999msgstr ""
7991 8000
7992#: src/util/strings.c:1178 8001#: src/util/strings.c:1170
7993msgid "IPv6 address did not start with `['\n" 8002msgid "IPv6 address did not start with `['\n"
7994msgstr "" 8003msgstr ""
7995 8004
7996#: src/util/strings.c:1186 8005#: src/util/strings.c:1178
7997msgid "IPv6 address did contain ':' to separate port number\n" 8006msgid "IPv6 address did contain ':' to separate port number\n"
7998msgstr "" 8007msgstr ""
7999 8008
8000#: src/util/strings.c:1192 8009#: src/util/strings.c:1184
8001msgid "IPv6 address did contain ']' before ':' to separate port number\n" 8010msgid "IPv6 address did contain ']' before ':' to separate port number\n"
8002msgstr "" 8011msgstr ""
8003 8012
8004#: src/util/strings.c:1199 8013#: src/util/strings.c:1191
8005msgid "IPv6 address did contain a valid port number after the last ':'\n" 8014msgid "IPv6 address did contain a valid port number after the last ':'\n"
8006msgstr "" 8015msgstr ""
8007 8016
8008#: src/util/strings.c:1208 8017#: src/util/strings.c:1200
8009#, fuzzy, c-format 8018#, fuzzy, c-format
8010msgid "Invalid IPv6 address `%s': %s\n" 8019msgid "Invalid IPv6 address `%s': %s\n"
8011msgstr "无效的进程优先级“%s”\n" 8020msgstr "无效的进程优先级“%s”\n"
8012 8021
8013#: src/util/strings.c:1414 src/util/strings.c:1430 8022#: src/util/strings.c:1406 src/util/strings.c:1422
8014msgid "Port not in range\n" 8023msgid "Port not in range\n"
8015msgstr "" 8024msgstr ""
8016 8025
8017#: src/util/strings.c:1439 8026#: src/util/strings.c:1431
8018#, fuzzy, c-format 8027#, fuzzy, c-format
8019msgid "Malformed port policy `%s'\n" 8028msgid "Malformed port policy `%s'\n"
8020msgstr "解析配置文件“%s”失败\n" 8029msgstr "解析配置文件“%s”失败\n"
8021 8030
8022#: src/util/strings.c:1522 src/util/strings.c:1553 src/util/strings.c:1601 8031#: src/util/strings.c:1514 src/util/strings.c:1545 src/util/strings.c:1593
8023#: src/util/strings.c:1622 8032#: src/util/strings.c:1614
8024#, c-format 8033#, c-format
8025msgid "Invalid format for IP: `%s'\n" 8034msgid "Invalid format for IP: `%s'\n"
8026msgstr "IP 格式无效:“%s”\n" 8035msgstr "IP 格式无效:“%s”\n"
8027 8036
8028#: src/util/strings.c:1579 8037#: src/util/strings.c:1571
8029#, c-format 8038#, c-format
8030msgid "Invalid network notation ('/%d' is not legal in IPv4 CIDR)." 8039msgid "Invalid network notation ('/%d' is not legal in IPv4 CIDR)."
8031msgstr "网络表示法无效(“/%d” 在 IPv4 CIDR 中是非法的)。" 8040msgstr "网络表示法无效(“/%d” 在 IPv4 CIDR 中是非法的)。"
8032 8041
8033#: src/util/strings.c:1631 8042#: src/util/strings.c:1623
8034#, fuzzy, c-format 8043#, fuzzy, c-format
8035msgid "Invalid format: `%s'\n" 8044msgid "Invalid format: `%s'\n"
8036msgstr "IP 格式无效:“%s”\n" 8045msgstr "IP 格式无效:“%s”\n"
8037 8046
8038#: src/util/strings.c:1683 8047#: src/util/strings.c:1675
8039#, c-format 8048#, c-format
8040msgid "Invalid network notation (does not end with ';': `%s')\n" 8049msgid "Invalid network notation (does not end with ';': `%s')\n"
8041msgstr "无效的网络表示法(没有以“;”结尾:“%s”)\n" 8050msgstr "无效的网络表示法(没有以“;”结尾:“%s”)\n"
8042 8051
8043#: src/util/strings.c:1733 8052#: src/util/strings.c:1725
8044#, c-format 8053#, c-format
8045msgid "Wrong format `%s' for netmask\n" 8054msgid "Wrong format `%s' for netmask\n"
8046msgstr "网络掩码的格式“%s”错误\n" 8055msgstr "网络掩码的格式“%s”错误\n"
8047 8056
8048#: src/util/strings.c:1764 8057#: src/util/strings.c:1756
8049#, c-format 8058#, c-format
8050msgid "Wrong format `%s' for network\n" 8059msgid "Wrong format `%s' for network\n"
8051msgstr "网络的格式“%s”错误\n" 8060msgstr "网络的格式“%s”错误\n"
diff --git a/src/consensus/consensus.h b/src/consensus/consensus.h
index f1049e1cd..a752988fd 100644
--- a/src/consensus/consensus.h
+++ b/src/consensus/consensus.h
@@ -56,12 +56,15 @@ struct GNUNET_CONSENSUS_ConcludeMessage
56 */ 56 */
57 struct GNUNET_MessageHeader header; 57 struct GNUNET_MessageHeader header;
58 58
59 // uint32_t reserved GNUNET_PACKED; // FIXME... 59 /**
60 * Padding, must be zero.
61 */
62 uint32_t reserved GNUNET_PACKED;
60 63
61 /** 64 /**
62 * Timeout for conclude 65 * Deadline for conclude
63 */ 66 */
64 struct GNUNET_TIME_RelativeNBO timeout; 67 struct GNUNET_TIME_AbsoluteNBO deadline;
65}; 68};
66 69
67 70
diff --git a/src/consensus/consensus_api.c b/src/consensus/consensus_api.c
index 0a2a7d7ac..14a1bf54e 100644
--- a/src/consensus/consensus_api.c
+++ b/src/consensus/consensus_api.c
@@ -259,14 +259,14 @@ GNUNET_CONSENSUS_insert (struct GNUNET_CONSENSUS_Handle *consensus,
259 * inserted by the client. 259 * inserted by the client.
260 * 260 *
261 * @param consensus consensus session 261 * @param consensus consensus session
262 * @param timeout timeout after which the conculde callback 262 * @param deadline deadline after which the conculde callback
263 * must be called 263 * must be called
264 * @param conclude called when the conclusion was successful 264 * @param conclude called when the conclusion was successful
265 * @param conclude_cls closure for the conclude callback 265 * @param conclude_cls closure for the conclude callback
266 */ 266 */
267void 267void
268GNUNET_CONSENSUS_conclude (struct GNUNET_CONSENSUS_Handle *consensus, 268GNUNET_CONSENSUS_conclude (struct GNUNET_CONSENSUS_Handle *consensus,
269 struct GNUNET_TIME_Relative timeout, 269 struct GNUNET_TIME_Absolute deadline,
270 GNUNET_CONSENSUS_ConcludeCallback conclude, 270 GNUNET_CONSENSUS_ConcludeCallback conclude,
271 void *conclude_cls) 271 void *conclude_cls)
272{ 272{
@@ -280,7 +280,7 @@ GNUNET_CONSENSUS_conclude (struct GNUNET_CONSENSUS_Handle *consensus,
280 consensus->conclude_cb = conclude; 280 consensus->conclude_cb = conclude;
281 281
282 ev = GNUNET_MQ_msg (conclude_msg, GNUNET_MESSAGE_TYPE_CONSENSUS_CLIENT_CONCLUDE); 282 ev = GNUNET_MQ_msg (conclude_msg, GNUNET_MESSAGE_TYPE_CONSENSUS_CLIENT_CONCLUDE);
283 conclude_msg->timeout = GNUNET_TIME_relative_hton (timeout); 283 conclude_msg->deadline = GNUNET_TIME_absolute_hton (deadline);
284 284
285 GNUNET_MQ_send (consensus->mq, ev); 285 GNUNET_MQ_send (consensus->mq, ev);
286} 286}
diff --git a/src/consensus/gnunet-consensus-profiler.c b/src/consensus/gnunet-consensus-profiler.c
index 6b01f9d8e..272a675db 100644
--- a/src/consensus/gnunet-consensus-profiler.c
+++ b/src/consensus/gnunet-consensus-profiler.c
@@ -172,7 +172,7 @@ do_consensus ()
172 172
173 for (i = 0; i < num_peers; i++) 173 for (i = 0; i < num_peers; i++)
174 GNUNET_CONSENSUS_conclude (consensus_handles[i], 174 GNUNET_CONSENSUS_conclude (consensus_handles[i],
175 conclude_timeout, 175 GNUNET_TIME_relative_to_absolute (conclude_timeout),
176 conclude_cb, &consensus_handles[i]); 176 conclude_cb, &consensus_handles[i]);
177} 177}
178 178
diff --git a/src/consensus/gnunet-service-consensus.c b/src/consensus/gnunet-service-consensus.c
index 914943f11..688190c14 100644
--- a/src/consensus/gnunet-service-consensus.c
+++ b/src/consensus/gnunet-service-consensus.c
@@ -146,7 +146,7 @@ struct ConsensusSession
146 * with a fraction of the conclude timeout. 146 * with a fraction of the conclude timeout.
147 * Only valid once the current round is not CONSENSUS_ROUND_BEGIN. 147 * Only valid once the current round is not CONSENSUS_ROUND_BEGIN.
148 */ 148 */
149 struct GNUNET_TIME_Relative conclude_timeout; 149 struct GNUNET_TIME_Absolute conclude_deadline;
150 150
151 /** 151 /**
152 * Timeout task identifier for the current round. 152 * Timeout task identifier for the current round.
@@ -1194,7 +1194,7 @@ client_conclude (void *cls,
1194 } 1194 }
1195 else 1195 else
1196 { 1196 {
1197 session->conclude_timeout = GNUNET_TIME_relative_ntoh (cmsg->timeout); 1197 session->conclude_deadline = GNUNET_TIME_absolute_ntoh (cmsg->deadline);
1198 /* the 'begin' round is over, start with the next, actual round */ 1198 /* the 'begin' round is over, start with the next, actual round */
1199 round_over (session, NULL); 1199 round_over (session, NULL);
1200 } 1200 }
diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h
index e593826b7..e4423f145 100644
--- a/src/include/gnunet_common.h
+++ b/src/include/gnunet_common.h
@@ -682,6 +682,17 @@ GNUNET_ntoh_double (double d);
682 682
683/** 683/**
684 * @ingroup memory 684 * @ingroup memory
685 * Allocate a size @a n array with structs or unions of the given @a type.
686 * Wrapper around #GNUNET_malloc that returns a pointer
687 * to the newly created objects of the correct type.
688 *
689 * @param n number of elements in the array
690 * @param type name of the struct or union, i.e. pass 'struct Foo'.
691 */
692#define GNUNET_new_array(n, type) (type *) GNUNET_malloc ((n) * sizeof (type))
693
694/**
695 * @ingroup memory
685 * Wrapper around malloc. Allocates size bytes of memory. 696 * Wrapper around malloc. Allocates size bytes of memory.
686 * The memory will be zero'ed out. 697 * The memory will be zero'ed out.
687 * 698 *
diff --git a/src/include/gnunet_consensus_service.h b/src/include/gnunet_consensus_service.h
index 6d8d23a17..3b08b2dee 100644
--- a/src/include/gnunet_consensus_service.h
+++ b/src/include/gnunet_consensus_service.h
@@ -73,7 +73,7 @@ struct GNUNET_CONSENSUS_Handle;
73 * @param session_id session identifier 73 * @param session_id session identifier
74 * Allows a group of peers to have more than consensus session. 74 * Allows a group of peers to have more than consensus session.
75 * @param new_element_cb callback, called when a new element is added to the set by 75 * @param new_element_cb callback, called when a new element is added to the set by
76 * another peer 76 * another peer. Also called when an error occurs.
77 * @param new_element_cls closure for new_element 77 * @param new_element_cls closure for new_element
78 * @return handle to use, NULL on error 78 * @return handle to use, NULL on error
79 */ 79 */
@@ -135,14 +135,14 @@ typedef void (*GNUNET_CONSENSUS_ConcludeCallback) (void *cls);
135 * try to conclude the consensus within a given time window. 135 * try to conclude the consensus within a given time window.
136 * 136 *
137 * @param consensus consensus session 137 * @param consensus consensus session
138 * @param timeout timeout after which the conculde callback 138 * @param deadline deadline after which the conculde callback
139 * must be called 139 * whill be called
140 * @param conclude called when the conclusion was successful 140 * @param conclude called when the conclusion was successful
141 * @param conclude_cls closure for the conclude callback 141 * @param conclude_cls closure for the conclude callback
142 */ 142 */
143void 143void
144GNUNET_CONSENSUS_conclude (struct GNUNET_CONSENSUS_Handle *consensus, 144GNUNET_CONSENSUS_conclude (struct GNUNET_CONSENSUS_Handle *consensus,
145 struct GNUNET_TIME_Relative timeout, 145 struct GNUNET_TIME_Absolute deadline,
146 GNUNET_CONSENSUS_ConcludeCallback conclude, 146 GNUNET_CONSENSUS_ConcludeCallback conclude,
147 void *conclude_cls); 147 void *conclude_cls);
148 148
diff --git a/src/include/gnunet_secretsharing_service.h b/src/include/gnunet_secretsharing_service.h
index 7eb372ef5..8569e15ea 100644
--- a/src/include/gnunet_secretsharing_service.h
+++ b/src/include/gnunet_secretsharing_service.h
@@ -46,6 +46,8 @@ extern "C"
46 * Number of bits for secretsharing keys. 46 * Number of bits for secretsharing keys.
47 * Must be smaller than the Pallier key size used internally 47 * Must be smaller than the Pallier key size used internally
48 * by the secretsharing service. 48 * by the secretsharing service.
49 * When changing this value, other internal parameters must also
50 * be adjusted.
49 */ 51 */
50#define GNUNET_SECRETSHARING_KEY_BITS 1024 52#define GNUNET_SECRETSHARING_KEY_BITS 1024
51 53
@@ -58,8 +60,8 @@ struct GNUNET_SECRETSHARING_Session;
58 60
59/** 61/**
60 * Share of a secret shared with a group of peers. 62 * Share of a secret shared with a group of peers.
61 * Contains both the share and information about the peers that have 63 * Contains the secret share itself, the public key, the list of peers, and the
62 * the other parts of the share. 64 * exponential commitments to the secret shares of the other peers.
63 */ 65 */
64struct GNUNET_SECRETSHARING_Share; 66struct GNUNET_SECRETSHARING_Share;
65 67
@@ -84,7 +86,8 @@ struct GNUNET_SECRETSHARING_PublicKey
84 */ 86 */
85struct GNUNET_SECRETSHARING_Ciphertext 87struct GNUNET_SECRETSHARING_Ciphertext
86{ 88{
87 uint32_t bits[2 * GNUNET_SECRETSHARING_KEY_BITS / 8 / sizeof (uint32_t)]; 89 uint32_t c1_bits[GNUNET_SECRETSHARING_KEY_BITS / 8 / sizeof (uint32_t)];
90 uint32_t c2_bits[GNUNET_SECRETSHARING_KEY_BITS / 8 / sizeof (uint32_t)];
88}; 91};
89 92
90 93
@@ -97,7 +100,7 @@ struct GNUNET_SECRETSHARING_Message
97 /** 100 /**
98 * Value of the message. 101 * Value of the message.
99 */ 102 */
100 gcry_mpi_t value; 103 uint32_t bits[GNUNET_SECRETSHARING_KEY_BITS / 8 / sizeof (uint32_t)];
101}; 104};
102 105
103 106
@@ -206,15 +209,19 @@ GNUNET_SECRETSHARING_encrypt (struct GNUNET_SECRETSHARING_PublicKey *public_key,
206 * When the operation is canceled, the decrypt_cb is not called anymore, but the calling 209 * When the operation is canceled, the decrypt_cb is not called anymore, but the calling
207 * peer may already have irrevocably contributed his share for the decryption of the value. 210 * peer may already have irrevocably contributed his share for the decryption of the value.
208 * 211 *
212 * @param cfg configuration to use
209 * @param share our secret share to use for decryption 213 * @param share our secret share to use for decryption
210 * @param ciphertext ciphertext to publish in order to decrypt it (if enough peers agree) 214 * @param ciphertext ciphertext to publish in order to decrypt it (if enough peers agree)
211 * @param decrypt_cb callback called once the decryption succeeded 215 * @param decrypt_cb callback called once the decryption succeeded
216 * @param deadline By when should the decryption be finished?
212 * @param decrypt_cb_cls closure for @a decrypt_cb 217 * @param decrypt_cb_cls closure for @a decrypt_cb
213 * @return handle to cancel the operation 218 * @return handle to cancel the operation
214 */ 219 */
215struct GNUNET_SECRETSHARING_DecryptionHandle * 220struct GNUNET_SECRETSHARING_DecryptionHandle *
216GNUNET_SECRETSHARING_decrypt (struct GNUNET_SECRETSHARING_Share *share, 221GNUNET_SECRETSHARING_decrypt (struct GNUNET_CONFIGURATION_Handle *cfg,
222 struct GNUNET_SECRETSHARING_Share *share,
217 struct GNUNET_SECRETSHARING_Ciphertext *ciphertext, 223 struct GNUNET_SECRETSHARING_Ciphertext *ciphertext,
224 struct GNUNET_TIME_Absolute deadline,
218 GNUNET_SECRETSHARING_DecryptCallback decrypt_cb, 225 GNUNET_SECRETSHARING_DecryptCallback decrypt_cb,
219 void *decrypt_cb_cls); 226 void *decrypt_cb_cls);
220 227
@@ -234,41 +241,32 @@ GNUNET_SECRETSHARING_decrypt_cancel (struct GNUNET_SECRETSHARING_DecryptionHandl
234/** 241/**
235 * Read a share from its binary representation. 242 * Read a share from its binary representation.
236 * 243 *
237 * @param data binary representation of the share 244 * @param data Binary representation of the share.
238 * @param len length of @a data 245 * @param len Length of @a data.
239 * @return the share, or NULL on error 246 * @param[out] readlen Number of bytes read,
247 * ignored if NULL.
248 * @return The share, or NULL on error.
240 */ 249 */
241struct GNUNET_SECRETSHARING_Share * 250struct GNUNET_SECRETSHARING_Share *
242GNUNET_SECRETSHARING_share_read (void *data, size_t len); 251GNUNET_SECRETSHARING_share_read (const void *data, size_t len, size_t *readlen);
243 252
244 253
245/** 254/**
246 * Convert a share to its binary representation. Use 255 * Convert a share to its binary representation.
247 * #GNUNET_SECRETSHARING_share_size to get the necessary size for the binary 256 * Can be called with a NULL @a buf to get the size of the share.
248 * representation.
249 * 257 *
250 * @param share share to write 258 * @param share Share to write.
251 * @param buf buffer to write to 259 * @param buf Buffer to write to.
252 * @param buflen number of writable bytes in @a buffer 260 * @param buflen Number of writable bytes in @a buf.
253 * @param[out] writelen pointer to store number of bytes written, 261 * @param[out] writelen Pointer to store number of bytes written,
254 * ignored if NULL 262 * ignored if NULL.
255 * @return GNUNET_YES on success, GNUNET_NO on failure 263 * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure.
256 */ 264 */
257int 265int
258GNUNET_SECRETSHARING_share_write (struct GNUNET_SECRETSHARING_Share *share, 266GNUNET_SECRETSHARING_share_write (const struct GNUNET_SECRETSHARING_Share *share,
259 void *buf, size_t buflen, size_t *writelen); 267 void *buf, size_t buflen, size_t *writelen);
260 268
261 269
262/**
263 * Get the number of bytes necessary to represent the given share.
264 *
265 * @param share share
266 * @return number of bytes necessary to represent @a share
267 */
268size_t
269GNUNET_SECRETSHARING_share_size (struct GNUNET_SECRETSHARING_Share *share);
270
271
272 270
273#if 0 /* keep Emacsens' auto-indent happy */ 271#if 0 /* keep Emacsens' auto-indent happy */
274{ 272{
diff --git a/src/include/gnunet_signatures.h b/src/include/gnunet_signatures.h
index f8839c1aa..05d758cdb 100644
--- a/src/include/gnunet_signatures.h
+++ b/src/include/gnunet_signatures.h
@@ -151,6 +151,21 @@ extern "C"
151 */ 151 */
152#define GNUNET_SIGNATURE_PURPOSE_MESH_KX 21 152#define GNUNET_SIGNATURE_PURPOSE_MESH_KX 21
153 153
154/**
155 * Signature for the first round of distributed key generation.
156 */
157#define GNUNET_SIGNATURE_PURPOSE_SECRETSHARING_DKG1 22
158
159/**
160 * Signature for the second round of distributed key generation.
161 */
162#define GNUNET_SIGNATURE_PURPOSE_SECRETSHARING_DKG2 23
163
164/**
165 * Signature for cooperatice decryption.
166 */
167#define GNUNET_SIGNATURE_PURPOSE_SECRETSHARING_DECRYPTION 23
168
154 169
155#if 0 /* keep Emacsens' auto-indent happy */ 170#if 0 /* keep Emacsens' auto-indent happy */
156{ 171{
diff --git a/src/secretsharing/Makefile.am b/src/secretsharing/Makefile.am
index 0473820b2..f2e14a60c 100644
--- a/src/secretsharing/Makefile.am
+++ b/src/secretsharing/Makefile.am
@@ -38,7 +38,9 @@ gnunet_secretsharing_profiler_DEPENDENCIES = \
38 38
39gnunet_service_secretsharing_SOURCES = \ 39gnunet_service_secretsharing_SOURCES = \
40 gnunet-service-secretsharing.c \ 40 gnunet-service-secretsharing.c \
41 secretsharing_common.c \
41 secretsharing_protocol.h 42 secretsharing_protocol.h
43gnunet_service_secretsharing_CFLAGS = $(AM_CFLAGS)
42gnunet_service_secretsharing_LDADD = \ 44gnunet_service_secretsharing_LDADD = \
43 $(top_builddir)/src/util/libgnunetutil.la \ 45 $(top_builddir)/src/util/libgnunetutil.la \
44 $(top_builddir)/src/consensus/libgnunetconsensus.la \ 46 $(top_builddir)/src/consensus/libgnunetconsensus.la \
@@ -49,6 +51,7 @@ gnunet_service_secretsharing_DEPENDENCIES = \
49 51
50libgnunetsecretsharing_la_SOURCES = \ 52libgnunetsecretsharing_la_SOURCES = \
51 secretsharing_api.c \ 53 secretsharing_api.c \
54 secretsharing_common.c \
52 secretsharing.h 55 secretsharing.h
53libgnunetsecretsharing_la_LIBADD = \ 56libgnunetsecretsharing_la_LIBADD = \
54 $(top_builddir)/src/util/libgnunetutil.la \ 57 $(top_builddir)/src/util/libgnunetutil.la \
@@ -57,7 +60,8 @@ libgnunetsecretsharing_la_LDFLAGS = \
57 $(GN_LIB_LDFLAGS) 60 $(GN_LIB_LDFLAGS)
58 61
59check_PROGRAMS = \ 62check_PROGRAMS = \
60 test_secretsharing_api 63 test_secretsharing_api \
64 test_secretsharing_sig
61 65
62if ENABLE_TEST_RUN 66if ENABLE_TEST_RUN
63TESTS = $(check_PROGRAMS) 67TESTS = $(check_PROGRAMS)
@@ -70,6 +74,12 @@ test_secretsharing_api_LDADD = \
70 $(top_builddir)/src/testing/libgnunettesting.la \ 74 $(top_builddir)/src/testing/libgnunettesting.la \
71 $(top_builddir)/src/secretsharing/libgnunetsecretsharing.la 75 $(top_builddir)/src/secretsharing/libgnunetsecretsharing.la
72 76
77test_secretsharing_sig_SOURCES = \
78 test_secretsharing_sig.c \
79 secretsharing_protocol.h
80test_secretsharing_sig_LDADD = \
81 $(top_builddir)/src/util/libgnunetutil.la
82
73EXTRA_DIST = \ 83EXTRA_DIST = \
74 test_secretsharing.conf 84 test_secretsharing.conf
75 85
diff --git a/src/secretsharing/gnunet-secretsharing-profiler.c b/src/secretsharing/gnunet-secretsharing-profiler.c
index a9bce4a14..01eb49a2d 100755
--- a/src/secretsharing/gnunet-secretsharing-profiler.c
+++ b/src/secretsharing/gnunet-secretsharing-profiler.c
@@ -1,5 +1,319 @@
1/*
2 This file is part of GNUnet
3 (C) 2014 Christian Grothoff (and other contributing authors)
4
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
19 */
20
21/**
22 * @file secretsharing/gnunet-secretsharing-profiler.c
23 * @brief profiling tool for distributed key generation and decryption
24 * @author Florian Dold
25 */
26#include "platform.h"
27#include "gnunet_util_lib.h"
28#include "gnunet_secretsharing_service.h"
29#include "gnunet_testbed_service.h"
30
31static unsigned int num_peers = 3;
32
33static unsigned int threshold = 2;
34
35static struct GNUNET_TIME_Relative timeout;
36
37static struct GNUNET_SECRETSHARING_Session **session_handles;
38
39static struct GNUNET_TESTBED_Operation **testbed_operations;
40
41static unsigned int num_connected_handles;
42
43static struct GNUNET_TESTBED_Peer **peers;
44
45static struct GNUNET_PeerIdentity *peer_ids;
46
47static unsigned int num_retrieved_peer_ids;
48
49static struct GNUNET_HashCode session_id;
50
51static int verbose;
52
53
54/**
55 * Signature of the event handler function called by the
56 * respective event controller.
57 *
58 * @param cls closure
59 * @param event information about the event
60 */
61static void
62controller_cb (void *cls,
63 const struct GNUNET_TESTBED_EventInformation *event)
64{
65 GNUNET_assert (0);
66}
67
68
69/**
70 * Callback to be called when a service connect operation is completed
71 *
72 * @param cls the callback closure from functions generating an operation
73 * @param op the operation that has been finished
74 * @param ca_result the service handle returned from GNUNET_TESTBED_ConnectAdapter()
75 * @param emsg error message in case the operation has failed; will be NULL if
76 * operation has executed successfully.
77 */
78static void
79connect_complete (void *cls,
80 struct GNUNET_TESTBED_Operation *op,
81 void *ca_result,
82 const char *emsg)
83{
84
85 if (NULL != emsg)
86 {
87 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
88 "testbed connect emsg: %s\n",
89 emsg);
90 GNUNET_assert (0);
91 }
92
93 num_connected_handles++;
94
95 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
96 "connect complete\n");
97
98 if (num_connected_handles == num_peers)
99 {
100 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
101 "all peers connected\n");
102 }
103}
104
105
106static void
107secret_ready_cb (void *cls,
108 const struct GNUNET_SECRETSHARING_Share *my_share,
109 const struct GNUNET_SECRETSHARING_PublicKey *public_key,
110 unsigned int num_ready_peers,
111 const struct GNUNET_PeerIdentity *ready_peers)
112{
113 struct GNUNET_SECRETSHARING_Session **sp = cls;
114 unsigned int n = sp - session_handles;
115 if (NULL == my_share || NULL == public_key)
116 {
117 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "key generation failed for peer #%u\n", n);
118 return;
119 }
120 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "secret ready for peer #%u\n", n);
121 // FIXME: end profiler or try decryption if all secrets are ready
122}
123
124
125/**
126 * Adapter function called to establish a connection to
127 * a service.
128 *
129 * @param cls closure
130 * @param cfg configuration of the peer to connect to; will be available until
131 * GNUNET_TESTBED_operation_done() is called on the operation returned
132 * from GNUNET_TESTBED_service_connect()
133 * @return service handle to return in 'op_result', NULL on error
134 */
135static void *
136connect_adapter (void *cls,
137 const struct GNUNET_CONFIGURATION_Handle *cfg)
138{
139 struct GNUNET_SECRETSHARING_Session **sp = cls;
140
141 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
142 "connect adapter, %d peers\n",
143 num_peers);
144 *sp = GNUNET_SECRETSHARING_create_session (cfg,
145 num_peers,
146 peer_ids,
147 &session_id,
148 GNUNET_TIME_relative_to_absolute (timeout),
149 threshold,
150 &secret_ready_cb, sp);
151 return *sp;
152}
153
154
155/**
156 * Adapter function called to destroy a connection to
157 * a service.
158 *
159 * @param cls closure
160 * @param op_result service handle returned from the connect adapter
161 */
162static void
163disconnect_adapter(void *cls, void *op_result)
164{
165 /* FIXME: what to do here? */
166}
167
168
169/**
170 * Callback to be called when the requested peer information is available
171 *
172 * @param cb_cls the closure from GNUNET_TETSBED_peer_get_information()
173 * @param op the operation this callback corresponds to
174 * @param pinfo the result; will be NULL if the operation has failed
175 * @param emsg error message if the operation has failed; will be NULL if the
176 * operation is successfull
177 */
178static void
179peer_info_cb (void *cb_cls,
180 struct GNUNET_TESTBED_Operation *op,
181 const struct GNUNET_TESTBED_PeerInformation *pinfo,
182 const char *emsg)
183{
184 struct GNUNET_PeerIdentity *p;
185 int i;
186
187 GNUNET_assert (NULL == emsg);
188
189 p = (struct GNUNET_PeerIdentity *) cb_cls;
190
191 if (pinfo->pit == GNUNET_TESTBED_PIT_IDENTITY)
192 {
193 *p = *pinfo->result.id;
194 num_retrieved_peer_ids++;
195 if (num_retrieved_peer_ids == num_peers)
196 for (i = 0; i < num_peers; i++)
197 testbed_operations[i] =
198 GNUNET_TESTBED_service_connect (NULL, peers[i], "secretsharing", connect_complete, NULL,
199 connect_adapter, disconnect_adapter, &session_handles[i]);
200 }
201 else
202 {
203 GNUNET_assert (0);
204 }
205
206 GNUNET_TESTBED_operation_done (op);
207}
208
209
210/**
211 * Signature of a main function for a testcase.
212 *
213 * @param cls closure
214 * @param h the run handle
215 * @param num_peers number of peers in 'peers'
216 * @param started_peers handle to peers run in the testbed. NULL upon timeout (see
217 * GNUNET_TESTBED_test_run()).
218 * @param links_succeeded the number of overlay link connection attempts that
219 * succeeded
220 * @param links_failed the number of overlay link connection attempts that
221 * failed
222 */
223static void
224test_master (void *cls,
225 struct GNUNET_TESTBED_RunHandle *h,
226 unsigned int num_peers,
227 struct GNUNET_TESTBED_Peer **started_peers,
228 unsigned int links_succeeded,
229 unsigned int links_failed)
230{
231 int i;
232
233 GNUNET_log_setup ("gnunet-secretsharing-profiler", "INFO", NULL);
234
235 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "test master\n");
236
237 peers = started_peers;
238
239 peer_ids = GNUNET_malloc (num_peers * sizeof (struct GNUNET_PeerIdentity));
240
241 session_handles = GNUNET_malloc (num_peers * sizeof (struct GNUNET_SECRETSHARING_Session *));
242 testbed_operations = GNUNET_malloc (num_peers * sizeof (struct GNUNET_TESTBED_Operation *));
243
244 for (i = 0; i < num_peers; i++)
245 GNUNET_TESTBED_peer_get_information (peers[i],
246 GNUNET_TESTBED_PIT_IDENTITY,
247 peer_info_cb,
248 &peer_ids[i]);
249}
250
251
252static void
253run (void *cls, char *const *args, const char *cfgfile,
254 const struct GNUNET_CONFIGURATION_Handle *cfg)
255{
256 static char *session_str = "gnunet-secretsharing/test";
257 char *topology;
258 int topology_cmp_result;
259
260 if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (cfg, "testbed", "OVERLAY_TOPOLOGY", &topology))
261 {
262 fprintf (stderr,
263 "'OVERLAY_TOPOLOGY' not found in 'testbed' config section, "
264 "seems like you passed the wrong configuration file\n");
265 return;
266 }
267
268 topology_cmp_result = strcasecmp (topology, "NONE");
269 GNUNET_free (topology);
270
271 if (0 == topology_cmp_result)
272 {
273 fprintf (stderr,
274 "'OVERLAY_TOPOLOGY' set to 'NONE', "
275 "seems like you passed the wrong configuration file\n");
276 return;
277 }
278
279 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
280 "running gnunet-secretsharing-profiler\n");
281
282 GNUNET_CRYPTO_hash (session_str, strlen (session_str), &session_id);
283
284 (void) GNUNET_TESTBED_test_run ("gnunet-secretsharing-profiler",
285 cfgfile,
286 num_peers,
287 0,
288 controller_cb,
289 NULL,
290 test_master,
291 NULL);
292}
293
294
1int 295int
2main () 296main (int argc, char **argv)
3{ 297{
298 static const struct GNUNET_GETOPT_CommandLineOption options[] = {
299 { 'n', "num-peers", NULL,
300 gettext_noop ("number of peers in consensus"),
301 GNUNET_YES, &GNUNET_GETOPT_set_uint, &num_peers },
302 { 't', "timeout", NULL,
303 gettext_noop ("dkg timeout"),
304 GNUNET_YES, &GNUNET_GETOPT_set_relative_time, &timeout },
305 { 'k', "threshold", NULL,
306 gettext_noop ("threshold"),
307 GNUNET_YES, &GNUNET_GETOPT_set_uint, &threshold },
308 { 'V', "verbose", NULL,
309 gettext_noop ("be more verbose (print received values)"),
310 GNUNET_NO, &GNUNET_GETOPT_set_one, &verbose },
311 GNUNET_GETOPT_OPTION_END
312 };
313 timeout = GNUNET_TIME_UNIT_SECONDS;
314 GNUNET_PROGRAM_run2 (argc, argv, "gnunet-secretsharing-profiler",
315 "help",
316 options, &run, NULL, GNUNET_YES);
4 return 0; 317 return 0;
5} 318}
319
diff --git a/src/secretsharing/gnunet-service-secretsharing.c b/src/secretsharing/gnunet-service-secretsharing.c
index 3af899352..6c91343d5 100644
--- a/src/secretsharing/gnunet-service-secretsharing.c
+++ b/src/secretsharing/gnunet-service-secretsharing.c
@@ -26,6 +26,7 @@
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_util_lib.h" 27#include "gnunet_util_lib.h"
28#include "gnunet_time_lib.h" 28#include "gnunet_time_lib.h"
29#include "gnunet_signatures.h"
29#include "gnunet_consensus_service.h" 30#include "gnunet_consensus_service.h"
30#include "secretsharing.h" 31#include "secretsharing.h"
31#include "secretsharing_protocol.h" 32#include "secretsharing_protocol.h"
@@ -69,10 +70,39 @@ struct KeygenPeerInfo
69 gcry_mpi_t public_key_share; 70 gcry_mpi_t public_key_share;
70 71
71 /** 72 /**
72 * GNUNET_YES if the peer has been disqualified, 73 * Did we successfully receive the round1 element
73 * GNUNET_NO otherwise. 74 * of the peer?
74 */ 75 */
75 int disqualified; 76 int round1_valid;
77
78 /**
79 * Did we successfully receive the round1 element
80 * of the peer?
81 */
82 int round2_valid;
83};
84
85
86struct DecryptPeerInfo
87{
88 /**
89 * Identity of the peer.
90 */
91 struct GNUNET_PeerIdentity peer;
92
93 /**
94 * Original index in the key generation round.
95 * Necessary for computing the lagrange coefficients.
96 */
97 unsigned int real_index;
98
99 /**
100 * Set to the partial decryption of
101 * this peer, or NULL if we did not
102 * receive a partial decryption from this
103 * peer or the zero knowledge proof failed.
104 */
105 gcry_mpi_t partial_decryption;
76}; 106};
77 107
78 108
@@ -120,6 +150,8 @@ struct KeygenSession
120 150
121 /** 151 /**
122 * Minimum number of shares required to restore the secret. 152 * Minimum number of shares required to restore the secret.
153 * Also the number of coefficients for the polynomial representing
154 * the sharing. Obviously, the polynomial then has degree threshold-1.
123 */ 155 */
124 unsigned int threshold; 156 unsigned int threshold;
125 157
@@ -135,6 +167,7 @@ struct KeygenSession
135 167
136 /** 168 /**
137 * Information about all participating peers. 169 * Information about all participating peers.
170 * Array of size 'num_peers'.
138 */ 171 */
139 struct KeygenPeerInfo *info; 172 struct KeygenPeerInfo *info;
140 173
@@ -158,9 +191,18 @@ struct KeygenSession
158 */ 191 */
159 gcry_mpi_t paillier_mu; 192 gcry_mpi_t paillier_mu;
160 193
194 /**
195 * When would we like the key to be established?
196 */
161 struct GNUNET_TIME_Absolute deadline; 197 struct GNUNET_TIME_Absolute deadline;
162 198
163 /** 199 /**
200 * When does the DKG start? Necessary to compute fractions of the
201 * operation's desired time interval.
202 */
203 struct GNUNET_TIME_Absolute start_time;
204
205 /**
164 * Index of the local peer in the ordered list 206 * Index of the local peer in the ordered list
165 * of peers in the session. 207 * of peers in the session.
166 */ 208 */
@@ -170,23 +212,63 @@ struct KeygenSession
170 212
171struct DecryptSession 213struct DecryptSession
172{ 214{
215 /**
216 * Decrypt sessions are stored in a linked list.
217 */
173 struct DecryptSession *next; 218 struct DecryptSession *next;
219
220 /**
221 * Decrypt sessions are stored in a linked list.
222 */
174 struct DecryptSession *prev; 223 struct DecryptSession *prev;
175 224
225 /**
226 * Handle to the consensus over partial decryptions.
227 */
176 struct GNUNET_CONSENSUS_Handle *consensus; 228 struct GNUNET_CONSENSUS_Handle *consensus;
177 229
230 /**
231 * Client connected to us.
232 */
178 struct GNUNET_SERVER_Client *client; 233 struct GNUNET_SERVER_Client *client;
234
235 /**
236 * Message queue for 'client'.
237 */
238 struct GNUNET_MQ_Handle *client_mq;
239
240 /**
241 * When would we like the ciphertext to be
242 * decrypted?
243 */
244 struct GNUNET_TIME_Absolute deadline;
245
246 /**
247 * Ciphertext we want to decrypt.
248 */
249 struct GNUNET_SECRETSHARING_Ciphertext ciphertext;
250
251 /**
252 * Share of the local peer.
253 */
254 struct GNUNET_SECRETSHARING_Share *share;
255
256 /**
257 * State information about other peers.
258 */
259 struct DecryptPeerInfo *info;
179}; 260};
180 261
262
181/** 263/**
182 * Decrypt sessions are held in a linked list. 264 * Decrypt sessions are held in a linked list.
183 */ 265 */
184//static struct DecryptSession *decrypt_sessions_head; 266static struct DecryptSession *decrypt_sessions_head;
185 267
186/** 268/**
187 * Decrypt sessions are held in a linked list. 269 * Decrypt sessions are held in a linked list.
188 */ 270 */
189//static struct DecryptSession *decrypt_sessions_tail; 271static struct DecryptSession *decrypt_sessions_tail;
190 272
191/** 273/**
192 * Decrypt sessions are held in a linked list. 274 * Decrypt sessions are held in a linked list.
@@ -222,6 +304,11 @@ static gcry_mpi_t elgamal_g;
222static struct GNUNET_PeerIdentity my_peer; 304static struct GNUNET_PeerIdentity my_peer;
223 305
224/** 306/**
307 * Peer that runs this service.
308 */
309static struct GNUNET_CRYPTO_EddsaPrivateKey *my_peer_private_key;
310
311/**
225 * Configuration of this service. 312 * Configuration of this service.
226 */ 313 */
227static const struct GNUNET_CONFIGURATION_Handle *cfg; 314static const struct GNUNET_CONFIGURATION_Handle *cfg;
@@ -231,20 +318,79 @@ static const struct GNUNET_CONFIGURATION_Handle *cfg;
231 */ 318 */
232static struct GNUNET_SERVER_Handle *srv; 319static struct GNUNET_SERVER_Handle *srv;
233 320
321/**
322 * Print a field element in a fixed-size buffer.
323 */
324static void
325print_field_element (void *buf, gcry_mpi_t x)
326{
327 GNUNET_assert (0);
328}
329
330
331static struct KeygenPeerInfo *
332get_keygen_peer_info (const struct KeygenSession *ks,
333 const struct GNUNET_PeerIdentity *peer)
334{
335 unsigned int i;
336 for (i = 0; i < ks->num_peers; i++)
337 if (0 == memcmp (peer, &ks->info[i].peer, sizeof (struct GNUNET_PeerIdentity)))
338 return &ks->info[i];
339 return NULL;
340}
341
342
343static struct DecryptPeerInfo *
344get_decrypt_peer_info (const struct DecryptSession *ds,
345 const struct GNUNET_PeerIdentity *peer)
346{
347 unsigned int i;
348 for (i = 0; i < ds->share->num_peers; i++)
349 if (0 == memcmp (peer, &ds->info[i].peer, sizeof (struct GNUNET_PeerIdentity)))
350 return &ds->info[i];
351 return NULL;
352}
353
354
355static struct GNUNET_TIME_Absolute
356time_between (struct GNUNET_TIME_Absolute start,
357 struct GNUNET_TIME_Absolute end,
358 int num, int denum)
359{
360 struct GNUNET_TIME_Absolute result;
361 uint64_t diff;
362
363 GNUNET_assert (start.abs_value_us <= end.abs_value_us);
364 diff = end.abs_value_us - start.abs_value_us;
365 result.abs_value_us = start.abs_value_us + ((diff * num) / denum);
366
367 return result;
368}
369
234 370
235/** 371/**
236 * Although GNUNET_CRYPTO_hash_cmp exisits, it does not have 372 * Compare two peer identities. Indended to be used with qsort or bsearch.
237 * the correct signature to be used with e.g. qsort.
238 * We use this function instead.
239 * 373 *
240 * @param h1 some hash code 374 * @param p1 some peer identity
241 * @param h2 some hash code 375 * @param p2 some peer identity
242 * @return 1 if h1 > h2, -1 if h1 < h2 and 0 if h1 == h2. 376 * @return 1 if p1 > p2, -1 if p1 < p2 and 0 if p1 == p2.
243 */ 377 */
244static int 378static int
245hash_cmp (const void *h1, const void *h2) 379peer_id_cmp (const void *p1, const void *p2)
380{
381 return memcmp (p1, p2, sizeof (struct GNUNET_PeerIdentity));
382}
383
384
385int
386peer_find (const struct GNUNET_PeerIdentity *haystack, unsigned int n,
387 const struct GNUNET_PeerIdentity *needle)
246{ 388{
247 return GNUNET_CRYPTO_hash_cmp ((struct GNUNET_HashCode *) h1, (struct GNUNET_HashCode *) h2); 389 unsigned int i;
390 for (i = 0; i < n; i++)
391 if (0 == memcmp (&haystack[i], needle, sizeof (struct GNUNET_PeerIdentity)))
392 return i;
393 return -1;
248} 394}
249 395
250 396
@@ -266,45 +412,84 @@ normalize_peers (struct GNUNET_PeerIdentity *listed,
266{ 412{
267 unsigned int local_peer_in_list; 413 unsigned int local_peer_in_list;
268 unsigned int n; 414 unsigned int n;
269 unsigned int i;
270 struct GNUNET_PeerIdentity *normalized; 415 struct GNUNET_PeerIdentity *normalized;
271 416
272 local_peer_in_list = GNUNET_NO; 417 local_peer_in_list = GNUNET_YES;
273 for (i = 0; i < num_listed; i++) 418 n = num_listed;
419 if (peer_find (listed, num_listed, &my_peer) < 0)
274 { 420 {
275 if (0 == memcmp (&listed[i], &my_peer, sizeof (struct GNUNET_PeerIdentity))) 421 local_peer_in_list = GNUNET_NO;
276 { 422 n += 1;
277 local_peer_in_list = GNUNET_YES;
278 break;
279 }
280 } 423 }
281 424
282 n = num_listed; 425 normalized = GNUNET_new_array (n, struct GNUNET_PeerIdentity);
283 if (GNUNET_NO == local_peer_in_list)
284 n++;
285
286 normalized = GNUNET_malloc (n * sizeof (struct GNUNET_PeerIdentity));
287 426
288 if (GNUNET_NO == local_peer_in_list) 427 if (GNUNET_NO == local_peer_in_list)
289 normalized[n - 1] = my_peer; 428 normalized[n - 1] = my_peer;
290 429
291 memcpy (normalized, listed, num_listed * sizeof (struct GNUNET_PeerIdentity)); 430 memcpy (normalized, listed, num_listed * sizeof (struct GNUNET_PeerIdentity));
292 qsort (normalized, n, sizeof (struct GNUNET_PeerIdentity), &hash_cmp); 431 qsort (normalized, n, sizeof (struct GNUNET_PeerIdentity), &peer_id_cmp);
293 432
294 if (NULL != my_peer_idx) 433 if (NULL != my_peer_idx)
434 *my_peer_idx = peer_find (normalized, n, &my_peer);
435 if (NULL != num_normalized)
436 *num_normalized = n;
437
438 return normalized;
439}
440
441
442/**
443 * Get a the j-th lagrage coefficient for a set of indices.
444 *
445 * @param[out] coeff the lagrange coefficient
446 * @param j lagrage coefficient we want to compute
447 * @param indices indices
448 * @param num number of indices in @a indices
449 */
450static void
451compute_lagrange_coefficient (gcry_mpi_t coeff, unsigned int j,
452 unsigned int *indices,
453 unsigned int num)
454{
455 int i;
456 /* numerator */
457 gcry_mpi_t n;
458 /* denominator */
459 gcry_mpi_t d;
460 /* temp value for l-j */
461 gcry_mpi_t tmp;
462
463 GNUNET_assert (0 != coeff);
464
465 GNUNET_assert (0 != (n = gcry_mpi_new (0)));
466 GNUNET_assert (0 != (d = gcry_mpi_new (0)));
467 GNUNET_assert (0 != (tmp = gcry_mpi_new (0)));
468
469 gcry_mpi_set_ui (n, 1);
470 gcry_mpi_set_ui (d, 1);
471
472 gcry_mpi_set_ui (coeff, 0);
473 for (i = 0; i < num; i++)
295 { 474 {
296 for (i = 0; i < num_listed; i++) 475 int l = indices[i];
297 { 476 if (l == j)
298 if (0 == memcmp (&normalized[i], &my_peer, sizeof (struct GNUNET_PeerIdentity))) 477 continue;
299 { 478 gcry_mpi_mul_ui (n, n, l);
300 *my_peer_idx = i; 479 // d <- d * (l-j)
301 break; 480 gcry_mpi_set_ui (tmp, l);
302 } 481 gcry_mpi_sub_ui (tmp, tmp, j);
303 } 482 gcry_mpi_mul (d, d, tmp);
304 } 483 }
305 484
306 *num_normalized = n; 485 // now we do the actual division, with everything mod q, as we
307 return normalized; 486 // are not operating on elemets from <g>, but on exponents
487 GNUNET_assert (0 == gcry_mpi_invm (d, d, elgamal_q));
488 gcry_mpi_mulm (coeff, n, d, elgamal_q);
489
490 gcry_mpi_release (n);
491 gcry_mpi_release (d);
492 gcry_mpi_release (tmp);
308} 493}
309 494
310 495
@@ -433,44 +618,76 @@ generate_presecret_polynomial (struct KeygenSession *ks)
433 for (i = 0; i < ks->threshold; i++) 618 for (i = 0; i < ks->threshold; i++)
434 { 619 {
435 ks->presecret_polynomial[i] = gcry_mpi_new (PAILLIER_BITS); 620 ks->presecret_polynomial[i] = gcry_mpi_new (PAILLIER_BITS);
621 GNUNET_assert (0 != ks->presecret_polynomial[i]);
436 gcry_mpi_randomize (ks->presecret_polynomial[i], PAILLIER_BITS, 622 gcry_mpi_randomize (ks->presecret_polynomial[i], PAILLIER_BITS,
437 GCRY_WEAK_RANDOM); 623 GCRY_WEAK_RANDOM);
438 } 624 }
439} 625}
440 626
441 627
628/**
629 * Consensus element handler for round one.
630 *
631 * @param cls closure (keygen session)
632 * @param element the element from consensus
633 */
442static void 634static void
443keygen_round1_new_element (void *cls, 635keygen_round1_new_element (void *cls,
444 const struct GNUNET_SET_Element *element) 636 const struct GNUNET_SET_Element *element)
445{ 637{
446 const struct GNUNET_SECRETSHARING_KeygenCommitData *d; 638 const struct GNUNET_SECRETSHARING_KeygenCommitData *d;
447 struct KeygenSession *ks = cls; 639 struct KeygenSession *ks = cls;
448 unsigned int i; 640 struct KeygenPeerInfo *info;
641
642 if (NULL == element)
643 {
644 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "round1 consensus failed\n");
645 return;
646 }
449 647
450 if (element->size != sizeof (struct GNUNET_SECRETSHARING_KeygenCommitData)) 648 if (element->size != sizeof (struct GNUNET_SECRETSHARING_KeygenCommitData))
451 { 649 {
452 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "keygen commit data with wrong size in consensus\n"); 650 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
651 "keygen commit data with wrong size (%u) in consensus, "
652 " %u expected\n",
653 element->size, sizeof (struct GNUNET_SECRETSHARING_KeygenCommitData));
453 return; 654 return;
454 } 655 }
455 656
657 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "got round1 element\n");
658
456 d = element->data; 659 d = element->data;
457 660
458 for (i = 0; i < ks->num_peers; i++) 661 info = get_keygen_peer_info (ks, &d->peer);
662
663 if (NULL == info)
459 { 664 {
460 if (0 == memcmp (&d->peer, &ks->info[i].peer, sizeof (struct GNUNET_PeerIdentity))) 665 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "keygen commit data with wrong peer identity (%s) in consensus\n",
461 { 666 GNUNET_i2s (&d->peer));
462 // TODO: check signature 667 return;
463 GNUNET_assert (0 == gcry_mpi_scan (&ks->info[i].paillier_g, GCRYMPI_FMT_USG, 668 }
464 &d->pubkey.g, sizeof d->pubkey.g, NULL)); 669
465 GNUNET_assert (0 == gcry_mpi_scan (&ks->info[i].paillier_n, GCRYMPI_FMT_USG, 670 if (d->purpose.size !=
466 &d->pubkey.n, sizeof d->pubkey.n, NULL)); 671 htons (element->size - offsetof (struct GNUNET_SECRETSHARING_KeygenCommitData, purpose)))
467 GNUNET_assert (0 == gcry_mpi_scan (&ks->info[i].presecret_commitment, GCRYMPI_FMT_USG, 672 {
468 &d->commitment, sizeof d->commitment, NULL)); 673 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "keygen commit data with wrong signature purpose size in consensus\n");
469 return; 674 return;
470 }
471 } 675 }
472 676
473 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "keygen commit data with wrong peer identity in consensus\n"); 677 if (GNUNET_OK != GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_PURPOSE_SECRETSHARING_DKG1,
678 &d->purpose, &d->signature, &d->peer.public_key))
679 {
680 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "keygen commit data with invalid signature in consensus\n");
681 return;
682 }
683
684 GNUNET_assert (0 == gcry_mpi_scan (&info->paillier_g, GCRYMPI_FMT_USG,
685 &d->pubkey.g, sizeof d->pubkey.g, NULL));
686 GNUNET_assert (0 == gcry_mpi_scan (&info->paillier_n, GCRYMPI_FMT_USG,
687 &d->pubkey.n, sizeof d->pubkey.n, NULL));
688 GNUNET_assert (0 == gcry_mpi_scan (&info->presecret_commitment, GCRYMPI_FMT_USG,
689 &d->commitment, sizeof d->commitment, NULL));
690 info->round1_valid = GNUNET_YES;
474} 691}
475 692
476 693
@@ -505,30 +722,60 @@ keygen_round2_conclude (void *cls)
505 struct KeygenSession *ks = cls; 722 struct KeygenSession *ks = cls;
506 struct GNUNET_SECRETSHARING_SecretReadyMessage *m; 723 struct GNUNET_SECRETSHARING_SecretReadyMessage *m;
507 struct GNUNET_MQ_Envelope *ev; 724 struct GNUNET_MQ_Envelope *ev;
725 size_t share_size;
508 unsigned int i; 726 unsigned int i;
727 unsigned int j;
728 struct GNUNET_SECRETSHARING_Share *share;
509 gcry_mpi_t s; 729 gcry_mpi_t s;
510 gcry_mpi_t h; 730 gcry_mpi_t h;
511 731
732 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "round2 conclude\n");
733
512 GNUNET_assert (0 != (s = gcry_mpi_new (PAILLIER_BITS))); 734 GNUNET_assert (0 != (s = gcry_mpi_new (PAILLIER_BITS)));
513 GNUNET_assert (0 != (h = gcry_mpi_new (PAILLIER_BITS))); 735 GNUNET_assert (0 != (h = gcry_mpi_new (PAILLIER_BITS)));
514 736
515 // multiplicative identity 737 // multiplicative identity
516 gcry_mpi_set_ui (s, 1); 738 gcry_mpi_set_ui (s, 1);
517 739
740 share = GNUNET_new (struct GNUNET_SECRETSHARING_Share);
741
742 share->num_peers = 0;
743
744 for (i = 0; i < ks->num_peers; i++)
745 if (GNUNET_YES == ks->info[i].round2_valid)
746 share->num_peers++;
747
748 share->peers = GNUNET_new_array (share->num_peers, struct GNUNET_PeerIdentity);
749 share->hom_share_commitments =
750 GNUNET_new_array (share->num_peers, struct GNUNET_SECRETSHARING_FieldElement);
751 share->original_indices = GNUNET_new_array (share->num_peers, uint16_t);
752
753 j = 0;
518 for (i = 0; i < ks->num_peers; i++) 754 for (i = 0; i < ks->num_peers; i++)
519 { 755 {
520 if (GNUNET_NO == ks->info[i].disqualified) 756 if (GNUNET_YES == ks->info[i].round2_valid)
521 { 757 {
522 gcry_mpi_addm (s, s, ks->info[i].decrypted_preshare, elgamal_p); 758 gcry_mpi_addm (s, s, ks->info[i].decrypted_preshare, elgamal_p);
523 gcry_mpi_mulm (h, h, ks->info[i].public_key_share, elgamal_p); 759 gcry_mpi_mulm (h, h, ks->info[i].public_key_share, elgamal_p);
524 // m->num_secret_peers++; // FIXME: m not initialized here! 760 share->peers[i] = ks->info[i].peer;
761 share->original_indices[i] = j++;
525 } 762 }
526 } 763 }
527 764
528 ev = GNUNET_MQ_msg (m, GNUNET_MESSAGE_TYPE_SECRETSHARING_CLIENT_SECRET_READY); 765 gcry_mpi_print (GCRYMPI_FMT_USG, (void *) &share->my_share, PAILLIER_BITS / 8, NULL, s);
766 gcry_mpi_print (GCRYMPI_FMT_USG, (void *) &share->public_key, PAILLIER_BITS / 8, NULL, s);
767
768 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "keygen successful with %u peers\n", share->num_peers);
769
770 m = GNUNET_malloc (sizeof (struct GNUNET_SECRETSHARING_SecretReadyMessage) +
771 ks->num_peers * sizeof (struct GNUNET_PeerIdentity));
772
773 GNUNET_assert (GNUNET_OK == GNUNET_SECRETSHARING_share_write (share, NULL, 0, &share_size));
529 774
530 gcry_mpi_print (GCRYMPI_FMT_USG, (void *) &m->secret, PAILLIER_BITS / 8, NULL, s); 775 ev = GNUNET_MQ_msg_extra (m, share_size,
531 gcry_mpi_print (GCRYMPI_FMT_USG, (void *) &m->public_key, PAILLIER_BITS / 8, NULL, s); 776 GNUNET_MESSAGE_TYPE_SECRETSHARING_CLIENT_SECRET_READY);
777
778 GNUNET_assert (GNUNET_OK == GNUNET_SECRETSHARING_share_write (share, &m[1], share_size, NULL));
532 779
533 GNUNET_MQ_send (ks->client_mq, ev); 780 GNUNET_MQ_send (ks->client_mq, ev);
534} 781}
@@ -548,17 +795,14 @@ static void
548insert_round2_element (struct KeygenSession *ks) 795insert_round2_element (struct KeygenSession *ks)
549{ 796{
550 struct GNUNET_SET_Element *element; 797 struct GNUNET_SET_Element *element;
551 struct GNUNET_SECRETSHARING_KeygenRevealData *msg; 798 struct GNUNET_SECRETSHARING_KeygenRevealData *d;
552 unsigned char *pos; 799 unsigned char *pos;
553 unsigned char *last_pos; 800 unsigned char *last_pos;
554 size_t element_size; 801 size_t element_size;
555 unsigned int i; 802 unsigned int i;
556 gcry_mpi_t c;
557 gcry_mpi_t idx; 803 gcry_mpi_t idx;
558 gcry_mpi_t v; 804 gcry_mpi_t v;
559 805
560 GNUNET_assert (0 != (c = gcry_mpi_new (PAILLIER_BITS)));
561 // FIXME: c is never used...
562 GNUNET_assert (0 != (v = gcry_mpi_new (PAILLIER_BITS))); 806 GNUNET_assert (0 != (v = gcry_mpi_new (PAILLIER_BITS)));
563 GNUNET_assert (0 != (idx = gcry_mpi_new (PAILLIER_BITS))); 807 GNUNET_assert (0 != (idx = gcry_mpi_new (PAILLIER_BITS)));
564 808
@@ -567,13 +811,17 @@ insert_round2_element (struct KeygenSession *ks)
567 1 * PAILLIER_BITS / 8 * ks->threshold); 811 1 * PAILLIER_BITS / 8 * ks->threshold);
568 812
569 element = GNUNET_malloc (sizeof (struct GNUNET_SET_Element) + element_size); 813 element = GNUNET_malloc (sizeof (struct GNUNET_SET_Element) + element_size);
814 element->size = element_size;
815 element->data = (void *) &element[1];
570 816
571 msg = (void *) element->data; 817 d = (void *) element->data;
572 pos = (void *) &msg[1]; 818 d->peer = my_peer;
819
820 pos = (void *) &d[1];
573 last_pos = pos + element_size; 821 last_pos = pos + element_size;
574 822
575 // exponentiated pre-shares 823 // exponentiated pre-shares
576 for (i = 0; i <= ks->threshold; i++) 824 for (i = 0; i < ks->num_peers; i++)
577 { 825 {
578 ptrdiff_t remaining = last_pos - pos; 826 ptrdiff_t remaining = last_pos - pos;
579 GNUNET_assert (remaining > 0); 827 GNUNET_assert (remaining > 0);
@@ -586,112 +834,168 @@ insert_round2_element (struct KeygenSession *ks)
586 pos += PAILLIER_BITS / 8; 834 pos += PAILLIER_BITS / 8;
587 } 835 }
588 836
589 // exponentiated coefficients 837 // encrypted pre-shares
590 for (i = 0; i < ks->num_peers; i++) 838 for (i = 0; i < ks->num_peers; i++)
591 { 839 {
592 ptrdiff_t remaining = last_pos - pos; 840 ptrdiff_t remaining = last_pos - pos;
593 GNUNET_assert (remaining > 0); 841 GNUNET_assert (remaining > 0);
594 gcry_mpi_powm (v, elgamal_g, ks->presecret_polynomial[0], elgamal_p); 842 if (GNUNET_NO == ks->info[i].round1_valid)
843 gcry_mpi_set_ui (v, 0);
844 else
845 paillier_encrypt (v, ks->presecret_polynomial[0],
846 ks->info[i].paillier_g, ks->info[i].paillier_g);
595 gcry_mpi_print (GCRYMPI_FMT_USG, pos, (size_t) remaining, NULL, v); 847 gcry_mpi_print (GCRYMPI_FMT_USG, pos, (size_t) remaining, NULL, v);
596 pos += PAILLIER_BITS / 8; 848 pos += PAILLIER_BITS / 8;
597 } 849 }
598 850
599 // encrypted pre-shares 851 // exponentiated coefficients
600 for (i = 0; i < ks->threshold; i++) 852 for (i = 0; i < ks->threshold; i++)
601 { 853 {
602 ptrdiff_t remaining = last_pos - pos; 854 ptrdiff_t remaining = last_pos - pos;
603 GNUNET_assert (remaining > 0); 855 GNUNET_assert (remaining > 0);
604 if (GNUNET_YES == ks->info[i].disqualified) 856 gcry_mpi_powm (v, elgamal_g, ks->presecret_polynomial[i], elgamal_p);
605 gcry_mpi_set_ui (v, 0);
606 else
607 paillier_encrypt (v, ks->presecret_polynomial[0],
608 ks->info[i].paillier_g, ks->info[i].paillier_g);
609 gcry_mpi_print (GCRYMPI_FMT_USG, pos, (size_t) remaining, NULL, v); 857 gcry_mpi_print (GCRYMPI_FMT_USG, pos, (size_t) remaining, NULL, v);
610 pos += PAILLIER_BITS / 8; 858 pos += PAILLIER_BITS / 8;
611 } 859 }
612 860
861 d->purpose.size = htons (element_size - offsetof (struct GNUNET_SECRETSHARING_KeygenRevealData, purpose));
862 d->purpose.purpose = htons (GNUNET_SIGNATURE_PURPOSE_SECRETSHARING_DKG2);
863 GNUNET_CRYPTO_eddsa_sign (my_peer_private_key, &d->purpose, &d->signature);
864
613 GNUNET_CONSENSUS_insert (ks->consensus, element, NULL, NULL); 865 GNUNET_CONSENSUS_insert (ks->consensus, element, NULL, NULL);
614 GNUNET_free (element); /* FIXME: maybe stack-allocate instead? */ 866 GNUNET_free (element); /* FIXME: maybe stack-allocate instead? */
615 867
616 gcry_mpi_release (c);
617 gcry_mpi_release (v); 868 gcry_mpi_release (v);
618 gcry_mpi_release (idx); 869 gcry_mpi_release (idx);
619} 870}
620 871
621 872
622static struct KeygenPeerInfo *
623get_keygen_peer_info (const struct KeygenSession *ks,
624 struct GNUNET_PeerIdentity *peer)
625{
626 unsigned int i;
627 for (i = 0; i < ks->num_peers; i++)
628 if (0 == memcmp (peer, &ks->info[i].peer, sizeof (struct GNUNET_PeerIdentity)))
629 return &ks->info[i];
630 return NULL;
631}
632
633
634static void 873static void
635keygen_round2_new_element (void *cls, 874keygen_round2_new_element (void *cls,
636 const struct GNUNET_SET_Element *element) 875 const struct GNUNET_SET_Element *element)
637{ 876{
638 struct KeygenSession *ks = cls; 877 struct KeygenSession *ks = cls;
639 struct GNUNET_SECRETSHARING_KeygenRevealData *msg; 878 const struct GNUNET_SECRETSHARING_KeygenRevealData *d;
640 struct KeygenPeerInfo *info; 879 struct KeygenPeerInfo *info;
641 unsigned char *pos; 880 unsigned char *pos;
642 unsigned char *last_pos;
643 gcry_mpi_t c; 881 gcry_mpi_t c;
882 size_t expected_element_size;
644 883
645 msg = (void *) element->data; 884 if (NULL == element)
646 pos = (void *) &msg[1]; 885 {
647 // skip exp. pre-shares 886 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "round2 consensus failed\n");
648 pos += PAILLIER_BITS / 8 * ks->num_peers; 887 return;
649 // skip exp. coefficients 888 }
650 pos += PAILLIER_BITS / 8 * ks->threshold;
651 // skip to the value for our peer
652 pos += PAILLIER_BITS / 8 * ks->local_peer_idx;
653 889
654 last_pos = element->size + (unsigned char *) element->data; 890 expected_element_size = (sizeof (struct GNUNET_SECRETSHARING_KeygenRevealData) +
891 2 * PAILLIER_BITS / 8 * ks->num_peers +
892 1 * PAILLIER_BITS / 8 * ks->threshold);
655 893
656 if ((pos >= last_pos) || ((last_pos - pos) < (PAILLIER_BITS / 8))) 894 if (element->size != expected_element_size)
657 { 895 {
658 GNUNET_break_op (0); 896 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
897 "keygen round2 data with wrong size (%u) in consensus, "
898 " %u expected\n",
899 element->size, expected_element_size);
659 return; 900 return;
660 } 901 }
661 902
662 GNUNET_assert (0 == gcry_mpi_scan (&c, GCRYMPI_FMT_USG, 903 d = (const void *) element->data;
663 pos, PAILLIER_BITS / 8, NULL));
664 904
665 info = get_keygen_peer_info (ks, &msg->peer); 905 info = get_keygen_peer_info (ks, &d->peer);
666 906
667 if (NULL == info) 907 if (NULL == info)
668 { 908 {
669 GNUNET_break_op (0); 909 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "keygen commit data with wrong peer identity (%s) in consensus\n",
910 GNUNET_i2s (&d->peer));
911 return;
912 }
913
914 if (GNUNET_NO == info->round1_valid)
915 {
916 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
917 "ignoring round2 element from peer with invalid round1 element (%s)\n",
918 GNUNET_i2s (&d->peer));
670 return; 919 return;
671 } 920 }
672 921
922 if (GNUNET_YES == info->round2_valid)
923 {
924 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
925 "ignoring duplicate round2 element (%s)\n",
926 GNUNET_i2s (&d->peer));
927 return;
928 }
929
930 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "got round2 element\n");
931
932
933 pos = (void *) &d[1];
934 // skip exponentiated pre-shares
935 pos += PAILLIER_BITS / 8 * ks->num_peers;
936 // skip encrypted pre-shares
937 pos += PAILLIER_BITS / 8 * ks->num_peers;
938 // the first exponentiated coefficient is the public key share
939 GNUNET_assert (0 == gcry_mpi_scan (&info->public_key_share, GCRYMPI_FMT_USG,
940 pos, PAILLIER_BITS / 8, NULL));
941
942 pos = (void *) &d[1];
943 // skip exp. pre-shares
944 pos += PAILLIER_BITS / 8 * ks->num_peers;
945 // skip to the encrypted value for our peer
946 pos += PAILLIER_BITS / 8 * ks->local_peer_idx;
947
948 GNUNET_assert (0 == gcry_mpi_scan (&c, GCRYMPI_FMT_USG,
949 pos, PAILLIER_BITS / 8, NULL));
950
951 GNUNET_assert (0 != (info->decrypted_preshare = mpi_new (0)));
952
673 paillier_decrypt (info->decrypted_preshare, c, ks->paillier_lambda, ks->paillier_mu, 953 paillier_decrypt (info->decrypted_preshare, c, ks->paillier_lambda, ks->paillier_mu,
674 ks->info[ks->local_peer_idx].paillier_n); 954 ks->info[ks->local_peer_idx].paillier_n);
675 955
676 // TODO: validate signature and proofs 956 // TODO: validate zero knowledge proofs
957
958 if (d->purpose.size !=
959 htons (element->size - offsetof (struct GNUNET_SECRETSHARING_KeygenRevealData, purpose)))
960 {
961 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "keygen reveal data with wrong signature purpose size in consensus\n");
962 return;
963 }
677 964
965 if (GNUNET_OK != GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_PURPOSE_SECRETSHARING_DKG2,
966 &d->purpose, &d->signature, &d->peer.public_key))
967 {
968 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "keygen reveal data with invalid signature in consensus\n");
969 return;
970 }
971
972 info->round2_valid = GNUNET_YES;
678} 973}
679 974
680 975
976/**
977 * Called when the first consensus round has concluded.
978 * Will initiate the second round.
979 *
980 * @param cls closure
981 */
681static void 982static void
682keygen_round1_conclude (void *cls) 983keygen_round1_conclude (void *cls)
683{ 984{
684 struct KeygenSession *ks = cls; 985 struct KeygenSession *ks = cls;
685 986
686 // TODO: destroy old consensus 987 GNUNET_CONSENSUS_destroy (ks->consensus);
687 // TODO: mark peers without keys as disqualified
688 988
689 ks->consensus = GNUNET_CONSENSUS_create (cfg, ks->num_peers, ks->peers, &ks->session_id, 989 ks->consensus = GNUNET_CONSENSUS_create (cfg, ks->num_peers, ks->peers, &ks->session_id,
690 keygen_round2_new_element, ks); 990 keygen_round2_new_element, ks);
691 991
692 insert_round2_element (ks); 992 insert_round2_element (ks);
693 993
694 GNUNET_CONSENSUS_conclude (ks->consensus, GNUNET_TIME_UNIT_FOREVER_REL /* FIXME */, keygen_round2_conclude, ks); 994 GNUNET_CONSENSUS_conclude (ks->consensus,
995 /* last round, thus conclude at DKG deadline */
996 ks->deadline,
997 keygen_round2_conclude,
998 ks);
695} 999}
696 1000
697 1001
@@ -716,6 +1020,8 @@ insert_round1_element (struct KeygenSession *ks)
716 element->data = d; 1020 element->data = d;
717 element->size = sizeof *d; 1021 element->size = sizeof *d;
718 1022
1023 d->peer = my_peer;
1024
719 GNUNET_assert (0 != (v = gcry_mpi_new (PAILLIER_BITS))); 1025 GNUNET_assert (0 != (v = gcry_mpi_new (PAILLIER_BITS)));
720 1026
721 gcry_mpi_powm (v, elgamal_g, ks->presecret_polynomial[0], elgamal_p); 1027 gcry_mpi_powm (v, elgamal_g, ks->presecret_polynomial[0], elgamal_p);
@@ -734,9 +1040,9 @@ insert_round1_element (struct KeygenSession *ks)
734 (unsigned char *) d->pubkey.n, PAILLIER_BITS / 8, NULL, 1040 (unsigned char *) d->pubkey.n, PAILLIER_BITS / 8, NULL,
735 ks->info[ks->local_peer_idx].paillier_n)); 1041 ks->info[ks->local_peer_idx].paillier_n));
736 1042
737 // FIXME: sign stuff 1043 d->purpose.size = htons ((sizeof *d) - offsetof (struct GNUNET_SECRETSHARING_KeygenCommitData, purpose));
738 1044 d->purpose.purpose = htons (GNUNET_SIGNATURE_PURPOSE_SECRETSHARING_DKG1);
739 d->peer = my_peer; 1045 GNUNET_assert (GNUNET_OK == GNUNET_CRYPTO_eddsa_sign (my_peer_private_key, &d->purpose, &d->signature));
740 1046
741 GNUNET_CONSENSUS_insert (ks->consensus, element, NULL, NULL); 1047 GNUNET_CONSENSUS_insert (ks->consensus, element, NULL, NULL);
742} 1048}
@@ -758,13 +1064,19 @@ static void handle_client_keygen (void *cls,
758 const struct GNUNET_SECRETSHARING_CreateMessage *msg = 1064 const struct GNUNET_SECRETSHARING_CreateMessage *msg =
759 (const struct GNUNET_SECRETSHARING_CreateMessage *) message; 1065 (const struct GNUNET_SECRETSHARING_CreateMessage *) message;
760 struct KeygenSession *ks; 1066 struct KeygenSession *ks;
1067 unsigned int i;
761 1068
762 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "client requested key generation\n"); 1069 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "client requested key generation\n");
763 1070
764 ks = GNUNET_new (struct KeygenSession); 1071 ks = GNUNET_new (struct KeygenSession);
765 1072
1073 /* FIXME: check if client already has some session */
1074
766 GNUNET_CONTAINER_DLL_insert (keygen_sessions_head, keygen_sessions_tail, ks); 1075 GNUNET_CONTAINER_DLL_insert (keygen_sessions_head, keygen_sessions_tail, ks);
767 1076
1077 ks->client = client;
1078 ks->client_mq = GNUNET_MQ_queue_for_server_client (client);
1079
768 ks->deadline = GNUNET_TIME_absolute_ntoh (msg->deadline); 1080 ks->deadline = GNUNET_TIME_absolute_ntoh (msg->deadline);
769 ks->threshold = ntohs (msg->threshold); 1081 ks->threshold = ntohs (msg->threshold);
770 ks->num_peers = ntohs (msg->num_peers); 1082 ks->num_peers = ntohs (msg->num_peers);
@@ -772,11 +1084,21 @@ static void handle_client_keygen (void *cls,
772 ks->peers = normalize_peers ((struct GNUNET_PeerIdentity *) &msg[1], ks->num_peers, 1084 ks->peers = normalize_peers ((struct GNUNET_PeerIdentity *) &msg[1], ks->num_peers,
773 &ks->num_peers, &ks->local_peer_idx); 1085 &ks->num_peers, &ks->local_peer_idx);
774 1086
775 // TODO: initialize MPIs in peer structure
776 1087
1088 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "first round of consensus with %u peers\n", ks->num_peers);
777 ks->consensus = GNUNET_CONSENSUS_create (cfg, ks->num_peers, ks->peers, &msg->session_id, 1089 ks->consensus = GNUNET_CONSENSUS_create (cfg, ks->num_peers, ks->peers, &msg->session_id,
778 keygen_round1_new_element, ks); 1090 keygen_round1_new_element, ks);
779 1091
1092 ks->info = GNUNET_malloc (ks->num_peers * sizeof (struct KeygenPeerInfo));
1093
1094 for (i = 0; i < ks->num_peers; i++)
1095 ks->info[i].peer = ks->peers[i];
1096
1097 GNUNET_assert (0 != (ks->info[ks->local_peer_idx].paillier_g = mpi_new (0)));
1098 GNUNET_assert (0 != (ks->info[ks->local_peer_idx].paillier_n = mpi_new (0)));
1099 GNUNET_assert (0 != (ks->paillier_lambda = mpi_new (0)));
1100 GNUNET_assert (0 != (ks->paillier_mu = mpi_new (0)));
1101
780 paillier_create (ks->info[ks->local_peer_idx].paillier_g, 1102 paillier_create (ks->info[ks->local_peer_idx].paillier_g,
781 ks->info[ks->local_peer_idx].paillier_n, 1103 ks->info[ks->local_peer_idx].paillier_n,
782 ks->paillier_lambda, 1104 ks->paillier_lambda,
@@ -787,7 +1109,149 @@ static void handle_client_keygen (void *cls,
787 1109
788 insert_round1_element (ks); 1110 insert_round1_element (ks);
789 1111
790 GNUNET_CONSENSUS_conclude (ks->consensus, GNUNET_TIME_UNIT_FOREVER_REL /* FIXME */, keygen_round1_conclude, ks); 1112 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "starting conclude of round 1\n");
1113
1114 GNUNET_CONSENSUS_conclude (ks->consensus,
1115 /* half the overall time */
1116 time_between (ks->start_time, ks->deadline, 1, 2),
1117 keygen_round1_conclude,
1118 ks);
1119
1120 GNUNET_SERVER_receive_done (client, GNUNET_OK);
1121}
1122
1123
1124/**
1125 * Called when the partial decryption consensus concludes.
1126 */
1127static void
1128decrypt_conclude (void *cls)
1129{
1130 struct DecryptSession *ds = cls;
1131 struct GNUNET_SECRETSHARING_DecryptResponseMessage *msg;
1132 struct GNUNET_MQ_Envelope *ev;
1133 gcry_mpi_t lagrange;
1134 gcry_mpi_t m;
1135 gcry_mpi_t tmp;
1136 gcry_mpi_t c_2;
1137 unsigned int *indices;
1138 unsigned int num;
1139 unsigned int i;
1140 unsigned int j;
1141
1142 GNUNET_assert (0 != (lagrange = gcry_mpi_new (0)));
1143 GNUNET_assert (0 != (m = gcry_mpi_new (0)));
1144 GNUNET_assert (0 != (tmp = gcry_mpi_new (0)));
1145
1146 num = 0;
1147 for (i = 0; i < ds->share->num_peers; i++)
1148 if (NULL != ds->info[i].partial_decryption)
1149 num++;
1150
1151 indices = GNUNET_malloc (num * sizeof (unsigned int));
1152 j = 0;
1153 for (i = 0; i < ds->share->num_peers; i++)
1154 if (NULL != ds->info[i].partial_decryption)
1155 indices[j++] = ds->info[i].real_index;
1156
1157 gcry_mpi_set_ui (m, 1);
1158
1159 for (i = 0; i < num; i++)
1160 {
1161 compute_lagrange_coefficient (lagrange, indices[i], indices, num);
1162 // w_j^{\lambda_j}
1163 gcry_mpi_powm (tmp, ds->info[indices[i]].partial_decryption, lagrange, elgamal_p);
1164 gcry_mpi_mulm (m, m, tmp, elgamal_p);
1165 }
1166
1167 GNUNET_assert (0 == gcry_mpi_scan (&c_2, GCRYMPI_FMT_USG, ds->ciphertext.c2_bits,
1168 PAILLIER_BITS / 8, NULL));
1169
1170 // m <- c_2 / m
1171 gcry_mpi_invm (m, m, elgamal_p);
1172 gcry_mpi_mulm (m, c_2, m, elgamal_p);
1173
1174 ev = GNUNET_MQ_msg (msg, GNUNET_MESSAGE_TYPE_SECRETSHARING_CLIENT_DECRYPT_DONE);
1175 print_field_element (&msg->plaintext, m);
1176 msg->success = htonl (1);
1177 GNUNET_MQ_send (ds->client_mq, ev);
1178
1179 // FIXME: what if not enough peers participated?
1180}
1181
1182
1183/**
1184 * Called when a new partial decryption arrives.
1185 */
1186static void
1187decrypt_new_element (void *cls,
1188 const struct GNUNET_SET_Element *element)
1189{
1190 struct DecryptSession *session = cls;
1191 const struct GNUNET_SECRETSHARING_DecryptData *d;
1192 struct DecryptPeerInfo *info;
1193
1194 if (NULL == element)
1195 {
1196 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "decryption failed\n");
1197 /* FIXME: destroy */
1198 return;
1199 }
1200
1201 if (element->size != sizeof *d)
1202 {
1203 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "element of wrong size in decrypt consensus\n");
1204 return;
1205 }
1206
1207 d = element->data;
1208
1209 info = get_decrypt_peer_info (session, &d->peer);
1210
1211 if (NULL == info)
1212 {
1213 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "decrypt element from invalid peer (%s)\n",
1214 GNUNET_i2s (&d->peer));
1215 return;
1216 }
1217
1218 if (NULL != info->partial_decryption)
1219 {
1220 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "decrypt element duplicate\n",
1221 GNUNET_i2s (&d->peer));
1222 return;
1223 }
1224
1225 // FIXME: check NIZP first
1226
1227 GNUNET_assert (0 == gcry_mpi_scan (&info->partial_decryption,
1228 GCRYMPI_FMT_USG, &d->partial_decryption, PAILLIER_BITS / 8, NULL));
1229}
1230
1231static void
1232insert_decrypt_element (struct DecryptSession *ds)
1233{
1234 struct GNUNET_SECRETSHARING_DecryptData d;
1235 struct GNUNET_SET_Element element;
1236 gcry_mpi_t x;
1237 gcry_mpi_t s;
1238
1239 GNUNET_assert (0 == gcry_mpi_scan (&x, GCRYMPI_FMT_USG, ds->ciphertext.c1_bits, PAILLIER_BITS / 8, NULL));
1240 GNUNET_assert (0 == gcry_mpi_scan (&s, GCRYMPI_FMT_USG, &ds->share->my_share, PAILLIER_BITS / 8, NULL));
1241
1242 gcry_mpi_powm (x, x, s, elgamal_p);
1243
1244 element.data = (void *) &d;
1245 element.size = sizeof (struct GNUNET_SECRETSHARING_DecryptData);
1246
1247 d.peer = my_peer;
1248 d.purpose.size = htons (element.size - offsetof (struct GNUNET_SECRETSHARING_KeygenRevealData, purpose));
1249 d.purpose.purpose = htons (GNUNET_SIGNATURE_PURPOSE_SECRETSHARING_DECRYPTION);
1250 GNUNET_CRYPTO_eddsa_sign (my_peer_private_key, &d.purpose, &d.signature);
1251
1252 print_field_element (&d.partial_decryption, x);
1253
1254 GNUNET_CONSENSUS_insert (ds->consensus, &element, NULL, NULL);
791} 1255}
792 1256
793 1257
@@ -800,11 +1264,80 @@ static void handle_client_keygen (void *cls,
800 * @param message the actual message 1264 * @param message the actual message
801 */ 1265 */
802static void handle_client_decrypt (void *cls, 1266static void handle_client_decrypt (void *cls,
803 struct GNUNET_SERVER_Client *client, 1267 struct GNUNET_SERVER_Client *client,
804 const struct GNUNET_MessageHeader 1268 const struct GNUNET_MessageHeader
805 *message) 1269 *message)
806{ 1270{
807 GNUNET_assert (0); 1271 const struct GNUNET_SECRETSHARING_DecryptRequestMessage *msg =
1272 (const void *) message;
1273 struct DecryptSession *ds;
1274 struct GNUNET_HashCode session_id;
1275
1276 ds = GNUNET_new (struct DecryptSession);
1277 // FIXME: check if session already exists
1278 GNUNET_CONTAINER_DLL_insert (decrypt_sessions_head, decrypt_sessions_tail, ds);
1279 ds->client = client;
1280 ds->client_mq = GNUNET_MQ_queue_for_server_client (client);
1281 ds->deadline = GNUNET_TIME_absolute_ntoh (msg->deadline);
1282 ds->ciphertext = msg->ciphertext;
1283
1284 ds->share = GNUNET_SECRETSHARING_share_read (&msg[1], ntohs (msg->header.size) - sizeof *msg, NULL);
1285 // FIXME: probably should be break rather than assert
1286 GNUNET_assert (NULL != ds->share);
1287
1288 // FIXME: this is probably sufficient, but kdf/hash with all values would be nicer ...
1289 GNUNET_CRYPTO_hash (&msg->ciphertext, sizeof (struct GNUNET_SECRETSHARING_Ciphertext), &session_id);
1290
1291 ds->consensus = GNUNET_CONSENSUS_create (cfg,
1292 ds->share->num_peers,
1293 ds->share->peers,
1294 &session_id,
1295 decrypt_new_element,
1296 ds);
1297
1298 insert_decrypt_element (ds);
1299
1300 GNUNET_CONSENSUS_conclude (ds->consensus, ds->deadline, decrypt_conclude, ds);
1301}
1302
1303
1304static void
1305init_crypto_constants (void)
1306{
1307 /* 1024-bit safe prime */
1308 const char *elgamal_p_hex =
1309 "0x08a347d3d69e8b2dd7d1b12a08dfbccbebf4ca"
1310 "6f4269a0814e158a34312964d946b3ef22882317"
1311 "2bcf30fc08f772774cb404f9bc002a6f66b09a79"
1312 "d810d67c4f8cb3bedc6060e3c8ef874b1b64df71"
1313 "6c7d2b002da880e269438d5a776e6b5f253c8df5"
1314 "6a16b1c7ce58def07c03db48238aadfc52a354a2"
1315 "7ed285b0c1675cad3f3";
1316 /* 1023-bit Sophie Germain prime, q = (p-1)/2 */
1317 const char *elgamal_q_hex =
1318 "0x0451a3e9eb4f4596ebe8d895046fde65f5fa65"
1319 "37a134d040a70ac51a1894b26ca359f79144118b"
1320 "95e7987e047bb93ba65a027cde001537b3584d3c"
1321 "ec086b3e27c659df6e303071e477c3a58db26fb8"
1322 "b63e958016d4407134a1c6ad3bb735af929e46fa"
1323 "b50b58e3e72c6f783e01eda411c556fe2951aa51"
1324 "3f6942d860b3ae569f9";
1325 /* generator of the unique size q subgroup of Z_p^* */
1326 const char *elgamal_g_hex =
1327 "0x05c00c36d2e822950087ef09d8252994adc4e4"
1328 "8fe3ec70269f035b46063aff0c99b633fd64df43"
1329 "02442e1914c829a41505a275438871f365e91c12"
1330 "3d5303ef9e90f4b8cb89bf86cc9b513e74a72634"
1331 "9cfd9f953674fab5d511e1c078fc72d72b34086f"
1332 "c82b4b951989eb85325cb203ff98df76bc366bba"
1333 "1d7024c3650f60d0da";
1334
1335 GNUNET_assert (0 == gcry_mpi_scan (&elgamal_q, GCRYMPI_FMT_HEX,
1336 elgamal_q_hex, 0, NULL));
1337 GNUNET_assert (0 == gcry_mpi_scan (&elgamal_p, GCRYMPI_FMT_HEX,
1338 elgamal_p_hex, 0, NULL));
1339 GNUNET_assert (0 == gcry_mpi_scan (&elgamal_g, GCRYMPI_FMT_HEX,
1340 elgamal_g_hex, 0, NULL));
808} 1341}
809 1342
810 1343
@@ -826,6 +1359,15 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
826 }; 1359 };
827 cfg = c; 1360 cfg = c;
828 srv = server; 1361 srv = server;
1362 my_peer_private_key = GNUNET_CRYPTO_eddsa_key_create_from_configuration (c);
1363 if (NULL == my_peer_private_key)
1364 {
1365 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "could not access host private key\n");
1366 GNUNET_break (0);
1367 GNUNET_SCHEDULER_shutdown ();
1368 return;
1369 }
1370 init_crypto_constants ();
829 if (GNUNET_OK != GNUNET_CRYPTO_get_peer_identity (cfg, &my_peer)) 1371 if (GNUNET_OK != GNUNET_CRYPTO_get_peer_identity (cfg, &my_peer))
830 { 1372 {
831 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "could not retrieve host identity\n"); 1373 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "could not retrieve host identity\n");
diff --git a/src/secretsharing/secretsharing.h b/src/secretsharing/secretsharing.h
index 0af21028d..232721410 100644
--- a/src/secretsharing/secretsharing.h
+++ b/src/secretsharing/secretsharing.h
@@ -27,13 +27,22 @@
27#define SECRETSHARING_H 27#define SECRETSHARING_H
28 28
29#include "platform.h" 29#include "platform.h"
30#include "gnunet_common.h" 30#include "gnunet_util_lib.h"
31#include "gnunet_time_lib.h" 31#include "gnunet_time_lib.h"
32#include "gnunet_common.h"
32#include "gnunet_secretsharing_service.h" 33#include "gnunet_secretsharing_service.h"
33 34
34 35
35GNUNET_NETWORK_STRUCT_BEGIN 36GNUNET_NETWORK_STRUCT_BEGIN
36 37
38struct GNUNET_SECRETSHARING_FieldElement
39{
40 /**
41 * Value of an element in <elgamal_g>.
42 */
43 unsigned char bits[GNUNET_SECRETSHARING_KEY_BITS / 8];
44};
45
37 46
38struct GNUNET_SECRETSHARING_CreateMessage 47struct GNUNET_SECRETSHARING_CreateMessage
39{ 48{
@@ -67,31 +76,46 @@ struct GNUNET_SECRETSHARING_CreateMessage
67}; 76};
68 77
69 78
70struct GNUNET_SECRETSHARING_SecretReadyMessage 79
80struct GNUNET_SECRETSHARING_ShareHeaderNBO
71{ 81{
72 /** 82 /**
73 * Type: GNUNET_MESSAGE_TYPE_SECRETSHARING_CLIENT_SECRET_READY 83 * Threshold for the key this share belongs to.
74 */ 84 */
75 struct GNUNET_MessageHeader header; 85 uint16_t threshold;
86
87 /**
88 * Peers that have the share.
89 */
90 uint16_t num_peers;
76 91
77 /** 92 /**
78 * Secret share in network byte order. 93 * Index of our peer in the list.
79 */ 94 */
80 unsigned char secret[GNUNET_SECRETSHARING_KEY_BITS / 8]; 95 uint16_t my_peer;
81 96
82 /** 97 /**
83 * Secret share in network byte order. 98 * Public key. Must correspond to the product of
99 * the homomorphic share commitments.
84 */ 100 */
85 struct GNUNET_SECRETSHARING_PublicKey public_key; 101 struct GNUNET_SECRETSHARING_PublicKey public_key;
86 102
87 /** 103 /**
88 * Number of peers at the end of this message. 104 * Share of 'my_peer'
89 * Includes peers that are part of the established
90 * threshold crypto system.
91 */ 105 */
92 uint16_t num_secret_peers GNUNET_PACKED; 106 struct GNUNET_SECRETSHARING_FieldElement my_share;
107};
108
109
110struct GNUNET_SECRETSHARING_SecretReadyMessage
111{
112 /**
113 * Type: GNUNET_MESSAGE_TYPE_SECRETSHARING_CLIENT_SECRET_READY
114 */
115 struct GNUNET_MessageHeader header;
116
117 /* rest: the serialized share */
93 118
94 /* struct GNUNET_PeerIdentity[num_peers]; */
95}; 119};
96 120
97 121
@@ -103,35 +127,88 @@ struct GNUNET_SECRETSHARING_DecryptRequestMessage
103 struct GNUNET_MessageHeader header; 127 struct GNUNET_MessageHeader header;
104 128
105 /** 129 /**
106 * Ciphertext to request decryption for. 130 * Until when should the decryption be finished?
107 */ 131 */
108 unsigned char ciphertext[GNUNET_SECRETSHARING_KEY_BITS / 8]; 132 struct GNUNET_TIME_AbsoluteNBO deadline;
109 133
110 /** 134 /**
111 * Number of peers at the end of this message. 135 * Ciphertext we want to decrypt.
112 * Includes peers that are part of the established
113 * threshold crypto system.
114 */ 136 */
115 uint16_t num_secret_peers GNUNET_PACKED; 137 struct GNUNET_SECRETSHARING_Ciphertext ciphertext;
116 138
117 /* struct GNUNET_PeerIdentity[num_peers]; */ 139 /* the share with payload */
118}; 140};
119 141
120 142
121struct GNUNET_SECRETSHARING_DecryptResponseMessage 143struct GNUNET_SECRETSHARING_DecryptResponseMessage
122{ 144{
123 /** 145 /**
124 * Type: GNUNET_MESSAGE_TYPE_SECRETSHARING_CLIENT_DECRYPT_RESPONSE 146 * Type: GNUNET_MESSAGE_TYPE_SECRETSHARING_CLIENT_DECRYPT_DONE
125 */ 147 */
126 struct GNUNET_MessageHeader header; 148 struct GNUNET_MessageHeader header;
127 149
128 /** 150 /**
129 * Ciphertext to request decryption for. 151 * Zero if decryption failed, non-zero if decryption succeeded.
152 * If the decryption failed, plaintext is also zero.
130 */ 153 */
131 unsigned char plaintext[GNUNET_SECRETSHARING_KEY_BITS / 8]; 154 uint32_t success;
155
156 /**
157 * Decrypted plaintext.
158 */
159 struct GNUNET_SECRETSHARING_FieldElement plaintext;
132}; 160};
133 161
134 162
135GNUNET_NETWORK_STRUCT_END 163GNUNET_NETWORK_STRUCT_END
136 164
165
166/**
167 * A share, with all values in in host byte order.
168 */
169struct GNUNET_SECRETSHARING_Share
170{
171 /**
172 * Threshold for the key this share belongs to.
173 */
174 uint16_t threshold;
175
176 /**
177 * Peers that have the share.
178 */
179 uint16_t num_peers;
180
181 /**
182 * Index of our peer in the list.
183 */
184 uint16_t my_peer;
185
186 /**
187 * Public key. Must correspond to the product of
188 * the homomorphic share commitments.
189 */
190 struct GNUNET_SECRETSHARING_PublicKey public_key;
191
192 /**
193 * Share of 'my_peer'
194 */
195 struct GNUNET_SECRETSHARING_FieldElement my_share;
196
197 /**
198 * Peer identities (includes 'my_peer')
199 */
200 struct GNUNET_PeerIdentity *peers;
201
202 /*
203 * Homomorphic commitments to each peer's share (includes 'my_peer')
204 */
205 struct GNUNET_SECRETSHARING_FieldElement *hom_share_commitments;
206
207 /*
208 * Original indices of peers from the DKG round.
209 */
210 uint16_t *original_indices;
211};
212
213
137#endif 214#endif
diff --git a/src/secretsharing/secretsharing_api.c b/src/secretsharing/secretsharing_api.c
index a44fa2a2f..d2b53acc7 100644
--- a/src/secretsharing/secretsharing_api.c
+++ b/src/secretsharing/secretsharing_api.c
@@ -31,8 +31,6 @@
31 31
32#define LOG(kind,...) GNUNET_log_from (kind, "secretsharing-api",__VA_ARGS__) 32#define LOG(kind,...) GNUNET_log_from (kind, "secretsharing-api",__VA_ARGS__)
33 33
34
35
36/** 34/**
37 * Session that will eventually establish a shared secred between 35 * Session that will eventually establish a shared secred between
38 * the involved peers and allow encryption and cooperative decryption. 36 * the involved peers and allow encryption and cooperative decryption.
@@ -61,6 +59,30 @@ struct GNUNET_SECRETSHARING_Session
61}; 59};
62 60
63 61
62struct GNUNET_SECRETSHARING_DecryptionHandle
63{
64 /**
65 * Client connected to the secretsharing service.
66 */
67 struct GNUNET_CLIENT_Connection *client;
68
69 /**
70 * Message queue for 'client'.
71 */
72 struct GNUNET_MQ_Handle *mq;
73
74 /**
75 * Called when the secret sharing is done.
76 */
77 GNUNET_SECRETSHARING_DecryptCallback decrypt_cb;
78
79 /**
80 * Closure for 'decrypt_cb'.
81 */
82 void *decrypt_cls;
83};
84
85
64static void 86static void
65handle_session_client_error (void *cls, enum GNUNET_MQ_Error error) 87handle_session_client_error (void *cls, enum GNUNET_MQ_Error error)
66{ 88{
@@ -69,16 +91,29 @@ handle_session_client_error (void *cls, enum GNUNET_MQ_Error error)
69 s->secret_ready_cb (s->secret_ready_cls, NULL, NULL, 0, NULL); 91 s->secret_ready_cb (s->secret_ready_cls, NULL, NULL, 0, NULL);
70} 92}
71 93
94
95static void
96handle_decrypt_client_error (void *cls, enum GNUNET_MQ_Error error)
97{
98 GNUNET_assert (0);
99}
100
72static void 101static void
73handle_secret_ready (void *cls, const struct GNUNET_MessageHeader *msg) 102handle_secret_ready (void *cls, const struct GNUNET_MessageHeader *msg)
74{ 103{
75 struct GNUNET_SECRETSHARING_Session *s = cls; 104 struct GNUNET_SECRETSHARING_Session *session = cls;
105 struct GNUNET_SECRETSHARING_Share *share;
76 const struct GNUNET_SECRETSHARING_SecretReadyMessage *m = (const void *) msg; 106 const struct GNUNET_SECRETSHARING_SecretReadyMessage *m = (const void *) msg;
107 size_t share_size;
108
109 share_size = ntohs (m->header.size) - sizeof *m;
110
111 share = GNUNET_SECRETSHARING_share_read (&m[1], share_size, NULL);
77 112
78 s->secret_ready_cb (s->secret_ready_cls, 113 session->secret_ready_cb (session->secret_ready_cls,
79 NULL, 114 share, /* FIXME */
80 &m->public_key, 115 &share->public_key,
81 ntohs (m->num_secret_peers), 116 share->num_peers,
82 (struct GNUNET_PeerIdentity *) &m[1]); 117 (struct GNUNET_PeerIdentity *) &m[1]);
83 118
84} 119}
@@ -113,14 +148,86 @@ GNUNET_SECRETSHARING_create_session (const struct GNUNET_CONFIGURATION_Handle *c
113 handle_session_client_error, s); 148 handle_session_client_error, s);
114 GNUNET_assert (NULL != s->mq); 149 GNUNET_assert (NULL != s->mq);
115 150
116 ev = GNUNET_MQ_msg (msg, GNUNET_MESSAGE_TYPE_SECRETSHARING_CLIENT_GENERATE); 151 ev = GNUNET_MQ_msg_extra (msg,
152 num_peers * sizeof (struct GNUNET_PeerIdentity),
153 GNUNET_MESSAGE_TYPE_SECRETSHARING_CLIENT_GENERATE);
154
117 msg->threshold = htons (threshold); 155 msg->threshold = htons (threshold);
156 msg->num_peers = htons (num_peers);
157 msg->session_id = *session_id;
158 msg->deadline = GNUNET_TIME_absolute_hton (deadline);
159 memcpy (&msg[1], peers, num_peers * sizeof (struct GNUNET_PeerIdentity));
160
118 GNUNET_MQ_send (s->mq, ev); 161 GNUNET_MQ_send (s->mq, ev);
119 162
120 LOG (GNUNET_ERROR_TYPE_DEBUG, "secretsharing session created\n"); 163 LOG (GNUNET_ERROR_TYPE_DEBUG, "secretsharing session created with %u peers\n",
164 num_peers);
121 return s; 165 return s;
166}
167
122 168
169static void
170handle_decrypt_done (void *cls, const struct GNUNET_MessageHeader *msg)
171{
172 GNUNET_assert (0);
123} 173}
124 174
125 175
176/**
177 * Publish the given ciphertext for decryption. Once a sufficient (>=k) number of peers has
178 * published the same value, it will be decrypted.
179 *
180 * When the operation is canceled, the decrypt_cb is not called anymore, but the calling
181 * peer may already have irrevocably contributed his share for the decryption of the value.
182 *
183 * @param share our secret share to use for decryption
184 * @param ciphertext ciphertext to publish in order to decrypt it (if enough peers agree)
185 * @param decrypt_cb callback called once the decryption succeeded
186 * @param decrypt_cb_cls closure for @a decrypt_cb
187 * @return handle to cancel the operation
188 */
189struct GNUNET_SECRETSHARING_DecryptionHandle *
190GNUNET_SECRETSHARING_decrypt (struct GNUNET_CONFIGURATION_Handle *cfg,
191 struct GNUNET_SECRETSHARING_Share *share,
192 struct GNUNET_SECRETSHARING_Ciphertext *ciphertext,
193 struct GNUNET_TIME_Absolute deadline,
194 GNUNET_SECRETSHARING_DecryptCallback decrypt_cb,
195 void *decrypt_cb_cls)
196{
197 struct GNUNET_SECRETSHARING_DecryptionHandle *s;
198 struct GNUNET_MQ_Envelope *ev;
199 struct GNUNET_SECRETSHARING_DecryptRequestMessage *msg;
200 static const struct GNUNET_MQ_MessageHandler mq_handlers[] = {
201 {handle_decrypt_done, GNUNET_MESSAGE_TYPE_SECRETSHARING_CLIENT_DECRYPT_DONE, 0},
202 GNUNET_MQ_HANDLERS_END
203 };
204 size_t share_size;
205
206
207 s = GNUNET_new (struct GNUNET_SECRETSHARING_DecryptionHandle);
208 s->client = GNUNET_CLIENT_connect ("secretsharing", cfg);
209 s->decrypt_cb = decrypt_cb;
210 s->decrypt_cls = decrypt_cb_cls;
211 GNUNET_assert (NULL != s->client);
212
213 s->mq = GNUNET_MQ_queue_for_connection_client (s->client, mq_handlers,
214 handle_decrypt_client_error, s);
215 GNUNET_assert (NULL != s->mq);
216
217 GNUNET_assert (GNUNET_OK == GNUNET_SECRETSHARING_share_write (share, NULL, 0, &share_size));
218
219 ev = GNUNET_MQ_msg_extra (msg,
220 share_size,
221 GNUNET_MESSAGE_TYPE_SECRETSHARING_CLIENT_DECRYPT);
222
223 GNUNET_assert (GNUNET_OK == GNUNET_SECRETSHARING_share_write (share, &msg[1], share_size, NULL));
224
225 msg->deadline = GNUNET_TIME_absolute_hton (deadline);
226
227 GNUNET_MQ_send (s->mq, ev);
228
229 LOG (GNUNET_ERROR_TYPE_DEBUG, "decrypt session created\n");
230 return s;
231}
232
126 233
diff --git a/src/secretsharing/secretsharing_protocol.h b/src/secretsharing/secretsharing_protocol.h
index 470002f10..3778ade41 100644
--- a/src/secretsharing/secretsharing_protocol.h
+++ b/src/secretsharing/secretsharing_protocol.h
@@ -31,6 +31,7 @@
31#include "platform.h" 31#include "platform.h"
32#include "gnunet_common.h" 32#include "gnunet_common.h"
33#include "gnunet_protocols.h" 33#include "gnunet_protocols.h"
34#include "secretsharing.h"
34 35
35/** 36/**
36 * Bit length used for the Paillier crypto system. 37 * Bit length used for the Paillier crypto system.
@@ -113,6 +114,50 @@ struct GNUNET_SECRETSHARING_KeygenRevealData
113 /* values follow */ 114 /* values follow */
114}; 115};
115 116
117
118/**
119 * Data of then element put in consensus
120 * for decrypting a value.
121 */
122struct GNUNET_SECRETSHARING_DecryptData
123{
124 /*
125 * Signature over rest of the message.
126 */
127 struct GNUNET_CRYPTO_EddsaSignature signature;
128 /*
129 * Signature purpose for signing the keygen commit data.
130 */
131 struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
132 /**
133 * Ciphertext we want to decrypt.
134 */
135 struct GNUNET_SECRETSHARING_Ciphertext ciphertext;
136 /**
137 * Peer that inserts this element.
138 */
139 struct GNUNET_PeerIdentity peer;
140 /**
141 * Partial decryption, computed as c_1^{s_i}
142 */
143 struct GNUNET_SECRETSHARING_FieldElement partial_decryption;
144 /**
145 * Commitment for the non-interactive zero knowledge proof.
146 * g^\beta, with \beta < q
147 */
148 struct GNUNET_SECRETSHARING_FieldElement nizk_commit1;
149 /**
150 * Commitment for the non-interactive zero knowledge proof.
151 * c_1^\beta, with \beta < q
152 */
153 struct GNUNET_SECRETSHARING_FieldElement nizk_commit2;
154 /**
155 * Reponse to the challenge computed from the protocol transcript.
156 * r = \beta + challenge \cdot share_i
157 */
158 struct GNUNET_SECRETSHARING_FieldElement nizk_response;
159};
160
116GNUNET_NETWORK_STRUCT_END 161GNUNET_NETWORK_STRUCT_END
117 162
118#endif 163#endif
diff --git a/src/secretsharing/test_secretsharing.conf b/src/secretsharing/test_secretsharing.conf
index e69de29bb..9cbb95608 100644
--- a/src/secretsharing/test_secretsharing.conf
+++ b/src/secretsharing/test_secretsharing.conf
@@ -0,0 +1,36 @@
1[secretsharing]
2AUTOSTART = YES
3PREFIX = valgrind
4
5[consensus]
6AUTOSTART = YES
7
8[transport]
9OPTIONS = -LERROR
10
11[arm]
12DEFAULTSERVICES = core consensus set secretsharing
13
14[set]
15OPTIONS = -L INFO
16#PREFIX = valgrind --leak-check=full
17
18[testbed]
19OVERLAY_TOPOLOGY = CLIQUE
20
21[hostlist]
22SERVERS =
23
24[nat]
25# Use addresses from the local network interfaces (inluding loopback, but also others)
26USE_LOCALADDR = YES
27
28# Disable IPv6 support
29DISABLEV6 = NO
30
31# Do we use addresses from localhost address ranges? (::1, 127.0.0.0/8)
32RETURN_LOCAL_ADDRESSES = YES
33
34[nse]
35AUTOSTART = NO
36
diff --git a/src/secretsharing/test_secretsharing_sig.c b/src/secretsharing/test_secretsharing_sig.c
new file mode 100644
index 000000000..da5f0a390
--- /dev/null
+++ b/src/secretsharing/test_secretsharing_sig.c
@@ -0,0 +1,45 @@
1/*
2 This file is part of GNUnet.
3 (C) 2013 Christian Grothoff (and other contributing authors)
4
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
19*/
20
21/**
22 * @file secretsharing/test_secretsharing_sig.c
23 * @brief ...
24 */
25#include "platform.h"
26#include "gnunet_util_lib.h"
27#include "gnunet_signatures.h"
28#include "secretsharing_protocol.h"
29
30
31int
32main (int argc, char **argv)
33{
34 struct GNUNET_SECRETSHARING_KeygenCommitData *d;
35 struct GNUNET_CRYPTO_EddsaPrivateKey *private_key;
36
37 private_key = GNUNET_CRYPTO_eddsa_key_create ();
38
39 d = GNUNET_malloc (sizeof *d);
40 d->purpose.size = htons ((sizeof *d) - offsetof (struct GNUNET_SECRETSHARING_KeygenCommitData, purpose));
41 d->purpose.purpose = htons (GNUNET_SIGNATURE_PURPOSE_SECRETSHARING_DKG1);
42 GNUNET_assert (GNUNET_OK == GNUNET_CRYPTO_eddsa_sign (private_key, &d->purpose, &d->signature));
43 return 0;
44}
45