forked from google/boringssl
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow libpki to verify quantum safe signatures (#113)
- Loading branch information
Showing
11 changed files
with
334 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
oqs_template/pki/signature_algorithm.cc/list_sig_oids.fragment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{% for sig in config['sigs'] %} | ||
const uint8_t kOid{{ sig['name']|capitalize }}[] = {% raw %}{{% endraw %}{{ sig['oid_encoded']|lower }}{% raw %}}{% endraw %}; | ||
{%- endfor %} | ||
|
25 changes: 25 additions & 0 deletions
25
oqs_template/pki/signature_algorithm.cc/pair_sigs_with_digests.fragment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{%- set Sha256Sigs = [] %} | ||
{%- set Sha384Sigs = [] %} | ||
{%- set Sha512Sigs = [] %} | ||
{%- for sig in config['sigs'] %} | ||
{%- if sig['claimed_security_level'] == '1' or sig['claimed_security_level'] == '2' %} | ||
{%- set _tmp = Sha256Sigs.append( sig['name'] ) %} | ||
{%- elif sig['claimed_security_level'] == '3' or sig['claimed_security_level'] == '4' %} | ||
{%- set _tmp = Sha384Sigs.append( sig['name'] ) %} | ||
{%- else %}{# claimed_security_level == '5' #} | ||
{%- set _tmp = Sha512Sigs.append( sig['name'] ) %} | ||
{%- endif %} | ||
{%- endfor %} | ||
{%- for sig in Sha256Sigs %} | ||
case SignatureAlgorithm::k{{ sig|capitalize }}: | ||
{%- endfor %} | ||
return DigestAlgorithm::Sha256; | ||
{% for sig in Sha384Sigs %} | ||
case SignatureAlgorithm::k{{ sig|capitalize }}: | ||
{%- endfor %} | ||
return DigestAlgorithm::Sha384; | ||
{% for sig in Sha512Sigs %} | ||
case SignatureAlgorithm::k{{ sig|capitalize }}: | ||
{%- endfor %} | ||
return DigestAlgorithm::Sha512; | ||
|
6 changes: 6 additions & 0 deletions
6
oqs_template/pki/signature_algorithm.cc/parse_sig_oids.fragment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{% for sig in config['sigs'] %} | ||
if (oid == der::Input(kOid{{ sig['name']|capitalize }})) { | ||
return SignatureAlgorithm::k{{ sig['name']|capitalize }}; | ||
} | ||
{%- endfor %} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{% for sig in config['sigs'] %} | ||
k{{ sig['name']|capitalize }}, | ||
{%- endfor %} | ||
|
4 changes: 4 additions & 0 deletions
4
oqs_template/pki/simple_path_builder_delegate.cc/list_sigs.fragment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{% for sig in config['sigs'] %} | ||
case SignatureAlgorithm::k{{ sig['name']|capitalize }}: | ||
{%- endfor %} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{% for sig in config['sigs'] %} | ||
case SignatureAlgorithm::k{{ sig['name']|capitalize }}: | ||
expected_pkey_id = EVP_PKEY_{{ sig['name']|upper }}; | ||
{%- if sig['claimed_security_level'] == '1' or sig['claimed_security_level'] == '2' %} | ||
digest = EVP_sha256(); | ||
{%- elif sig['claimed_security_level'] == '3' or sig['claimed_security_level'] == '4' %} | ||
digest = EVP_sha384(); | ||
{%- else %}{# claimed_security_level == '5' #} | ||
digest = EVP_sha512(); | ||
{%- endif %} | ||
cache_algorithm_name = "{{ sig['name']|capitalize }}"; | ||
break; | ||
{%- endfor %} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.