Skip to content

Commit a4d3e70

Browse files
author
Willy Zhang
committed
[hsmtool] Add TODO for ML-DSA domain preparation
Adds a TODO to sign and verify commands to clarify whether domain preparation should be performed by the tool or offloaded to the HSM. Signed-off-by: Willy Zhang <[email protected]>
1 parent abc4a29 commit a4d3e70

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

sw/host/hsmtool/src/commands/mldsa/sign.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ impl Dispatch for Sign {
5252
let object = helper::find_one_object(session, &attrs)?;
5353

5454
let data = fs::read(&self.input)?;
55+
// TODO: decide whether domain preparation should be done in this program or if the HSM is expected to do it.
5556
let data = self.format.mldsa_prepare(self.domain, &data)?;
5657
let mechanism = self.format.mechanism(KeyType::MlDsa)?;
5758
let result = session.sign(&mechanism, object, &data)?;

sw/host/hsmtool/src/commands/mldsa/verify.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ impl Dispatch for Verify {
5252
let object = helper::find_one_object(session, &attrs)?;
5353

5454
let data = fs::read(&self.input)?;
55+
// TODO: decide whether domain preparation should be done in this program or if the HSM is expected to do it.
5556
let data = self.format.mldsa_prepare(self.domain, &data)?;
5657
let mechanism = self.format.mechanism(KeyType::MlDsa)?;
5758
let signature = if let Some(filename) = &self.signature {

0 commit comments

Comments
 (0)