Skip to content

Commit 034cbc4

Browse files
committed
ML-DSA-44: use typed encoding/format parameters
Replace generic &pyo3::Bound<'_, pyo3::PyAny> with concrete crate::serialization::Encoding/PrivateFormat/PublicFormat types in private_bytes() and public_bytes() methods, consistent with how other key backends are implemented. Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
1 parent 0c90a8d commit 034cbc4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/rust/src/backend/mldsa44.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ impl MlDsa44PrivateKey {
123123
fn private_bytes<'p>(
124124
slf: &pyo3::Bound<'p, Self>,
125125
py: pyo3::Python<'p>,
126-
encoding: &pyo3::Bound<'p, pyo3::PyAny>,
127-
format: &pyo3::Bound<'p, pyo3::PyAny>,
126+
encoding: crate::serialization::Encoding,
127+
format: crate::serialization::PrivateFormat,
128128
encryption_algorithm: &pyo3::Bound<'p, pyo3::PyAny>,
129129
) -> CryptographyResult<pyo3::Bound<'p, pyo3::types::PyBytes>> {
130130
utils::pkey_private_bytes(
@@ -202,8 +202,8 @@ impl MlDsa44PublicKey {
202202
fn public_bytes<'p>(
203203
slf: &pyo3::Bound<'p, Self>,
204204
py: pyo3::Python<'p>,
205-
encoding: &pyo3::Bound<'p, pyo3::PyAny>,
206-
format: &pyo3::Bound<'p, pyo3::PyAny>,
205+
encoding: crate::serialization::Encoding,
206+
format: crate::serialization::PublicFormat,
207207
) -> CryptographyResult<pyo3::Bound<'p, pyo3::types::PyBytes>> {
208208
utils::pkey_public_bytes(py, slf, &slf.borrow().pkey, encoding, format, true, true)
209209
}

0 commit comments

Comments
 (0)