Skip to content

Commit

Permalink
fix for gencertbuf script and add dilithium public key
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobBarthelmeh committed Dec 19, 2024
1 parent df3897d commit e66905a
Show file tree
Hide file tree
Showing 6 changed files with 628 additions and 13 deletions.
Binary file added certs/dilithium/bench_dilithium_level2_pubkey.der
Binary file not shown.
Binary file added certs/dilithium/bench_dilithium_level3_pubkey.der
Binary file not shown.
Binary file added certs/dilithium/bench_dilithium_level5_pubkey.der
Binary file not shown.
5 changes: 4 additions & 1 deletion certs/dilithium/include.am
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@
EXTRA_DIST += \
certs/dilithium/bench_dilithium_level2_key.der \
certs/dilithium/bench_dilithium_level3_key.der \
certs/dilithium/bench_dilithium_level5_key.der
certs/dilithium/bench_dilithium_level5_key.der \
certs/dilithium/bench_dilithium_level2_pubkey.der \
certs/dilithium/bench_dilithium_level3_pubkey.der \
certs/dilithium/bench_dilithium_level5_pubkey.der
18 changes: 12 additions & 6 deletions gencertbuf.pl
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@
["certs/dilithium/bench_dilithium_level2_key.der", "bench_dilithium_level2_key" ],
["certs/dilithium/bench_dilithium_level3_key.der", "bench_dilithium_level3_key" ],
["certs/dilithium/bench_dilithium_level5_key.der", "bench_dilithium_level5_key" ],
["certs/dilithium/bench_dilithium_level2_pubkey.der",
"bench_dilithium_level2_pubkey" ],
["certs/dilithium/bench_dilithium_level3_pubkey.der",
"bench_dilithium_level3_pubkey" ],
["certs/dilithium/bench_dilithium_level5_pubkey.der",
"bench_dilithium_level5_pubkey" ],
);

#Sphincs+ Post-Quantum Keys
Expand Down Expand Up @@ -229,7 +235,7 @@
print OUT_FILE "#endif /* USE_CERT_BUFFERS_4096 */\n\n";

# convert and print falcon keys
print OUT_FILE "#if defined(HAVE_PQC) && defined(HAVE_FALCON)\n\n";
print OUT_FILE "#if defined(HAVE_FALCON)\n\n";
for (my $i = 0; $i < $num_falcon; $i++) {

my $fname = $fileList_falcon[$i][0];
Expand All @@ -243,10 +249,10 @@
print OUT_FILE "static const int sizeof_$sname = sizeof($sname);\n\n";
}

print OUT_FILE "#endif /* HAVE_PQC && HAVE_FALCON */\n\n";
print OUT_FILE "#endif /* HAVE_FALCON */\n\n";

# convert and print dilithium keys
print OUT_FILE "#if defined (HAVE_PQC) && defined(HAVE_DILITHIUM)\n\n";
print OUT_FILE "#if defined(HAVE_DILITHIUM)\n\n";
for (my $i = 0; $i < $num_dilithium; $i++) {

my $fname = $fileList_dilithium[$i][0];
Expand All @@ -260,10 +266,10 @@
print OUT_FILE "static const int sizeof_$sname = sizeof($sname);\n\n";
}

print OUT_FILE "#endif /* HAVE_PQC && HAVE_DILITHIUM */\n\n";
print OUT_FILE "#endif /* HAVE_DILITHIUM */\n\n";

# convert and print sphincs keys
print OUT_FILE "#if defined(HAVE_PQC) && defined(HAVE_SPHINCS)\n\n";
print OUT_FILE "#if defined(HAVE_SPHINCS)\n\n";
for (my $i = 0; $i < $num_sphincs; $i++) {

my $fname = $fileList_sphincs[$i][0];
Expand All @@ -277,7 +283,7 @@
print OUT_FILE "static const int sizeof_$sname = sizeof($sname);\n\n";
}

print OUT_FILE "#endif /* HAVE_PQC && HAVE_SPHINCS */\n\n";
print OUT_FILE "#endif /* HAVE_SPHINCS */\n\n";

# convert and print 256-bit cert/keys
print OUT_FILE "#if defined(HAVE_ECC) && defined(USE_CERT_BUFFERS_256)\n\n";
Expand Down
Loading

0 comments on commit e66905a

Please sign in to comment.