Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,8 @@ num-bigint = "0.4"
num-traits = "0.2"
rand = "0.10"
p256 = { version = "0.14", features = ["arithmetic", "ecdh", "ecdsa"] }
p384 = { version = "0.13", features = ["ecdsa"] }
p384 = { version = "0.13", features = ["arithmetic", "ecdh", "ecdsa"] }
p521 = { version = "0.13", features = ["arithmetic", "ecdh", "ecdsa"] }
bp256 = { version = "0.14.0-rc.15", features = ["arithmetic"] }
bp384 = { version = "0.14.0-rc.15", features = ["arithmetic"] }
elliptic-curve = { version = "0.14", features = ["arithmetic"] }
4 changes: 4 additions & 0 deletions crates/dmrtd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,8 @@ num-bigint.workspace = true
num-traits.workspace = true
rand.workspace = true
p256.workspace = true
p384.workspace = true
p521.workspace = true
bp256.workspace = true
bp384.workspace = true
elliptic-curve.workspace = true
30 changes: 22 additions & 8 deletions crates/dmrtd/src/proto/domain_parameter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ pub static ICAO_DOMAIN_PARAMETERS: Lazy<HashMap<u32, DomainParameter>> = Lazy::n
name: "BrainpoolP256r1",
size: 256,
kind: DomainParameterType::Ecp,
is_supported: false,
is_supported: true,
},
DomainParameter {
id: 14,
Expand All @@ -135,14 +135,14 @@ pub static ICAO_DOMAIN_PARAMETERS: Lazy<HashMap<u32, DomainParameter>> = Lazy::n
name: "NIST P-384 (secp384r1)",
size: 384,
kind: DomainParameterType::Ecp,
is_supported: false,
is_supported: true,
},
DomainParameter {
id: 16,
name: "BrainpoolP384r1",
size: 384,
kind: DomainParameterType::Ecp,
is_supported: false,
is_supported: true,
},
DomainParameter {
id: 17,
Expand All @@ -156,7 +156,21 @@ pub static ICAO_DOMAIN_PARAMETERS: Lazy<HashMap<u32, DomainParameter>> = Lazy::n
name: "NIST P-521 (secp521r1)",
size: 521,
kind: DomainParameterType::Ecp,
is_supported: false,
is_supported: true,
},
DomainParameter {
id: 23,
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Outdated
name: "BrainpoolP256t1",
size: 256,
kind: DomainParameterType::Ecp,
is_supported: true,
},
DomainParameter {
id: 26,
name: "BrainpoolP384t1",
size: 384,
kind: DomainParameterType::Ecp,
is_supported: true,
},
];
entries.into_iter().map(|p| (p.id, p)).collect()
Expand All @@ -183,13 +197,13 @@ mod tests {
.map(|p| p.id)
.collect();
supported.sort_unstable();
// P-256 (12, ECDH) + RFC 5114 MODP/DH groups (0/1/2).
assert_eq!(supported, vec![0, 1, 2, 12]);
// P-256 (12, ECDH) + RFC 5114 MODP/DH groups (0/1/2) + Brainpool + NIST P-384/521.
assert_eq!(supported, vec![0, 1, 2, 12, 13, 15, 16, 18, 23, 26]);
}

#[test]
fn table_has_14_entries() {
assert_eq!(ICAO_DOMAIN_PARAMETERS.len(), 14);
fn table_has_16_entries() {
assert_eq!(ICAO_DOMAIN_PARAMETERS.len(), 16);
}

#[test]
Expand Down
Loading
Loading