Skip to content

Commit e4b5fd1

Browse files
committed
Remove SignedCurve25519 variant of DeviceKeyAlgorithm
1 parent daa9762 commit e4b5fd1

File tree

2 files changed

+4
-18
lines changed

2 files changed

+4
-18
lines changed

src/identifiers.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -163,17 +163,14 @@ impl DeviceKeyAlgorithm {
163163
#[derive(Debug)]
164164
pub enum DeviceKeyAlgorithmName {
165165
/// The Ed25519 signature algorithm.
166-
Ed25519,
166+
Ed25519 = 0,
167167

168168
/// The Curve25519 ECDH algorithm.
169-
Curve25519,
170-
171-
/// The Curve25519 ECDH algorithm, but the key also contains
172-
/// signatures.
173-
SignedCurve25519,
169+
Curve25519 = 1,
174170

171+
// SignedCurve25519 = 2 used to exist but was removed from Ruma
175172
/// An unknown device key algorithm.
176-
Unknown,
173+
Unknown = 3,
177174
}
178175

179176
impl TryFrom<DeviceKeyAlgorithmName> for ruma::DeviceKeyAlgorithm {
@@ -185,7 +182,6 @@ impl TryFrom<DeviceKeyAlgorithmName> for ruma::DeviceKeyAlgorithm {
185182
Ok(match value {
186183
Ed25519 => Self::Ed25519,
187184
Curve25519 => Self::Curve25519,
188-
SignedCurve25519 => Self::SignedCurve25519,
189185
Unknown => {
190186
return Err(JsError::new(
191187
"The `DeviceKeyAlgorithmName.Unknown` variant cannot be converted",
@@ -202,7 +198,6 @@ impl From<ruma::DeviceKeyAlgorithm> for DeviceKeyAlgorithmName {
202198
match value {
203199
Ed25519 => Self::Ed25519,
204200
Curve25519 => Self::Curve25519,
205-
SignedCurve25519 => Self::SignedCurve25519,
206201
_ => Self::Unknown,
207202
}
208203
}

tests/identifiers.test.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,6 @@ describe(DeviceKeyId.name, () => {
6161
deviceId: "foobar",
6262
},
6363

64-
{
65-
name: "signed curve25519",
66-
id: "signed_curve25519:foobar",
67-
algorithmName: DeviceKeyAlgorithmName.SignedCurve25519,
68-
algorithm: "signed_curve25519",
69-
deviceId: "foobar",
70-
},
71-
7264
{
7365
name: "unknown",
7466
id: "hello:foobar",
@@ -92,7 +84,6 @@ describe("DeviceKeyAlgorithmName", () => {
9284
test("has the correct variants", () => {
9385
expect(DeviceKeyAlgorithmName.Ed25519).toStrictEqual(0);
9486
expect(DeviceKeyAlgorithmName.Curve25519).toStrictEqual(1);
95-
expect(DeviceKeyAlgorithmName.SignedCurve25519).toStrictEqual(2);
9687
expect(DeviceKeyAlgorithmName.Unknown).toStrictEqual(3);
9788
});
9889
});

0 commit comments

Comments
 (0)