Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libdap-chain-crypto
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
cellframe
libdap-chain-crypto
Commits
b76eb017
Commit
b76eb017
authored
5 years ago
by
dmitriy.gerasimov
Browse files
Options
Downloads
Plain Diff
Merge branch 'feature-2513' into 'master'
added support DILITHIUM See merge request
!6
parents
3f9ca309
01090326
No related branches found
No related tags found
1 merge request
!6
added support DILITHIUM
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dap_chain_pkey.c
+4
-0
4 additions, 0 deletions
dap_chain_pkey.c
dap_chain_sign.c
+6
-1
6 additions, 1 deletion
dap_chain_sign.c
test/dap_chain_cert_save_tests.c
+1
-0
1 addition, 0 deletions
test/dap_chain_cert_save_tests.c
with
11 additions
and
1 deletion
dap_chain_pkey.c
+
4
−
0
View file @
b76eb017
...
...
@@ -69,6 +69,10 @@ int dap_chain_pkey_from_enc_key_output(dap_enc_key_t *a_key, void * a_output)
case
DAP_ENC_KEY_TYPE_SIG_PICNIC
:
l_output
->
header
.
type
.
type
=
PKEY_TYPE_SIGN_PICNIC
;
break
;
case
DAP_ENC_KEY_TYPE_SIG_DILITHIUM
:
l_output
->
header
.
type
.
type
=
PKEY_TYPE_SIGN_DILITHIUM
;
break
;
default:
log_it
(
L_WARNING
,
"No serialization preset"
);
return
-
1
;
...
...
This diff is collapsed.
Click to expand it.
dap_chain_sign.c
+
6
−
1
View file @
b76eb017
...
...
@@ -43,6 +43,7 @@ size_t dap_chain_sign_create_output_cals_size(dap_enc_key_t * a_key, size_t a_ou
case
DAP_ENC_KEY_TYPE_SIG_BLISS
:
l_sign_size
=
sizeof
(
s_sign_bliss_null
);
break
;
case
DAP_ENC_KEY_TYPE_SIG_PICNIC
:
l_sign_size
=
dap_enc_picnic_calc_signature_size
(
a_key
);
break
;
case
DAP_ENC_KEY_TYPE_SIG_TESLA
:
l_sign_size
=
dap_enc_tesla_calc_signature_size
();
break
;
case
DAP_ENC_KEY_TYPE_SIG_DILITHIUM
:
l_sign_size
=
dap_enc_dilithium_calc_signature_size
();
break
;
default
:
return
0
;
}
...
...
@@ -62,6 +63,7 @@ dap_chain_sign_type_t dap_chain_sign_type_from_key_type( dap_enc_key_type_t a_ke
case
DAP_ENC_KEY_TYPE_SIG_BLISS
:
l_sign_type
.
type
=
SIG_TYPE_BLISS
;
break
;
case
DAP_ENC_KEY_TYPE_SIG_PICNIC
:
l_sign_type
.
type
=
SIG_TYPE_PICNIC
;
break
;
case
DAP_ENC_KEY_TYPE_SIG_TESLA
:
l_sign_type
.
type
=
SIG_TYPE_TESLA
;
break
;
case
DAP_ENC_KEY_TYPE_SIG_DILITHIUM
:
l_sign_type
.
type
=
SIG_TYPE_DILITHIUM
;
break
;
}
return
l_sign_type
;
}
...
...
@@ -77,6 +79,7 @@ dap_enc_key_type_t dap_chain_sign_type_to_key_type(dap_chain_sign_type_t a_cha
case
SIG_TYPE_BLISS
:
return
DAP_ENC_KEY_TYPE_SIG_BLISS
;
case
SIG_TYPE_TESLA
:
return
DAP_ENC_KEY_TYPE_SIG_TESLA
;
case
SIG_TYPE_PICNIC
:
return
DAP_ENC_KEY_TYPE_SIG_PICNIC
;
case
SIG_TYPE_DILITHIUM
:
return
DAP_ENC_KEY_TYPE_SIG_DILITHIUM
;
default:
return
DAP_ENC_KEY_TYPE_NULL
;
}
}
...
...
@@ -136,7 +139,8 @@ static int dap_chain_sign_create_output(dap_enc_key_t *a_key, const void * a_dat
}
switch
(
a_key
->
type
)
{
case
DAP_ENC_KEY_TYPE_SIG_TESLA
:
case
DAP_ENC_KEY_TYPE_SIG_PICNIC
:
case
DAP_ENC_KEY_TYPE_SIG_PICNIC
:
case
DAP_ENC_KEY_TYPE_SIG_DILITHIUM
:
// For PICNIC a_output_size should decrease
*
a_output_size
=
a_key
->
enc_na
(
a_key
,
a_data
,
a_data_size
,
a_output
,
*
a_output_size
);
return
(
*
a_output_size
>
0
)
?
0
:
-
1
;
...
...
@@ -257,6 +261,7 @@ int dap_chain_sign_verify(dap_chain_sign_t * a_chain_sign, const void * a_data,
switch
(
l_key
->
type
)
{
case
DAP_ENC_KEY_TYPE_SIG_TESLA
:
case
DAP_ENC_KEY_TYPE_SIG_PICNIC
:
case
DAP_ENC_KEY_TYPE_SIG_DILITHIUM
:
if
(
l_key
->
dec_na
(
l_key
,
a_data
,
a_data_size
,
l_sign
,
l_sign_size
)
>
0
)
l_ret
=
0
;
else
...
...
This diff is collapsed.
Click to expand it.
test/dap_chain_cert_save_tests.c
+
1
−
0
View file @
b76eb017
...
...
@@ -60,6 +60,7 @@ void dap_chain_cert_save_tests_run(void)
test_cert_memory_file
(
DAP_ENC_KEY_TYPE_SIG_BLISS
);
test_cert_memory_file
(
DAP_ENC_KEY_TYPE_SIG_TESLA
);
test_cert_memory_file
(
DAP_ENC_KEY_TYPE_SIG_PICNIC
);
test_cert_memory_file
(
DAP_ENC_KEY_TYPE_SIG_DILITHIUM
);
cleanup_test_case
();
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment