File tree Expand file tree Collapse file tree 2 files changed +4
-18
lines changed Expand file tree Collapse file tree 2 files changed +4
-18
lines changed Original file line number Diff line number Diff line change @@ -163,17 +163,14 @@ impl DeviceKeyAlgorithm {
163
163
#[ derive( Debug ) ]
164
164
pub enum DeviceKeyAlgorithmName {
165
165
/// The Ed25519 signature algorithm.
166
- Ed25519 ,
166
+ Ed25519 = 0 ,
167
167
168
168
/// The Curve25519 ECDH algorithm.
169
- Curve25519 ,
170
-
171
- /// The Curve25519 ECDH algorithm, but the key also contains
172
- /// signatures.
173
- SignedCurve25519 ,
169
+ Curve25519 = 1 ,
174
170
171
+ // SignedCurve25519 = 2 used to exist but was removed from Ruma
175
172
/// An unknown device key algorithm.
176
- Unknown ,
173
+ Unknown = 3 ,
177
174
}
178
175
179
176
impl TryFrom < DeviceKeyAlgorithmName > for ruma:: DeviceKeyAlgorithm {
@@ -185,7 +182,6 @@ impl TryFrom<DeviceKeyAlgorithmName> for ruma::DeviceKeyAlgorithm {
185
182
Ok ( match value {
186
183
Ed25519 => Self :: Ed25519 ,
187
184
Curve25519 => Self :: Curve25519 ,
188
- SignedCurve25519 => Self :: SignedCurve25519 ,
189
185
Unknown => {
190
186
return Err ( JsError :: new (
191
187
"The `DeviceKeyAlgorithmName.Unknown` variant cannot be converted" ,
@@ -202,7 +198,6 @@ impl From<ruma::DeviceKeyAlgorithm> for DeviceKeyAlgorithmName {
202
198
match value {
203
199
Ed25519 => Self :: Ed25519 ,
204
200
Curve25519 => Self :: Curve25519 ,
205
- SignedCurve25519 => Self :: SignedCurve25519 ,
206
201
_ => Self :: Unknown ,
207
202
}
208
203
}
Original file line number Diff line number Diff line change @@ -61,14 +61,6 @@ describe(DeviceKeyId.name, () => {
61
61
deviceId : "foobar" ,
62
62
} ,
63
63
64
- {
65
- name : "signed curve25519" ,
66
- id : "signed_curve25519:foobar" ,
67
- algorithmName : DeviceKeyAlgorithmName . SignedCurve25519 ,
68
- algorithm : "signed_curve25519" ,
69
- deviceId : "foobar" ,
70
- } ,
71
-
72
64
{
73
65
name : "unknown" ,
74
66
id : "hello:foobar" ,
@@ -92,7 +84,6 @@ describe("DeviceKeyAlgorithmName", () => {
92
84
test ( "has the correct variants" , ( ) => {
93
85
expect ( DeviceKeyAlgorithmName . Ed25519 ) . toStrictEqual ( 0 ) ;
94
86
expect ( DeviceKeyAlgorithmName . Curve25519 ) . toStrictEqual ( 1 ) ;
95
- expect ( DeviceKeyAlgorithmName . SignedCurve25519 ) . toStrictEqual ( 2 ) ;
96
87
expect ( DeviceKeyAlgorithmName . Unknown ) . toStrictEqual ( 3 ) ;
97
88
} ) ;
98
89
} ) ;
You can’t perform that action at this time.
0 commit comments