@@ -30,23 +30,23 @@ import { crypto, subtleCrypto, TextEncoder } from "../../crypto/crypto";
3030import { generateDecimalSas } from "../../crypto/verification/SASDecimal" ;
3131import { UnstableValue } from "../../NamespacedValue" ;
3232
33- const ECDH = new UnstableValue (
33+ const ECDH_V2 = new UnstableValue (
3434 "m.rendezvous.v2.curve25519-aes-sha256" ,
3535 "org.matrix.msc3903.rendezvous.v2.curve25519-aes-sha256" ,
3636) ;
3737
3838export interface ECDHv2RendezvousCode extends RendezvousCode {
3939 rendezvous : {
4040 transport : RendezvousTransportDetails ;
41- algorithm : typeof ECDH . name | typeof ECDH . altName ;
41+ algorithm : typeof ECDH_V2 . name | typeof ECDH_V2 . altName ;
4242 key : string ;
4343 } ;
4444}
4545
4646export type MSC3903ECDHPayload = PlainTextPayload | EncryptedPayload ;
4747
4848export interface PlainTextPayload {
49- algorithm : typeof ECDH . name | typeof ECDH . altName ;
49+ algorithm : typeof ECDH_V2 . name | typeof ECDH_V2 . altName ;
5050 key ?: string ;
5151}
5252
@@ -90,11 +90,11 @@ export class MSC3903ECDHv2RendezvousChannel<T> implements RendezvousChannel<T> {
9090 throw new Error ( "Code already generated" ) ;
9191 }
9292
93- await this . transport . send ( { algorithm : ECDH . name } ) ;
93+ await this . transport . send ( { algorithm : ECDH_V2 . name } ) ;
9494
9595 const rendezvous : ECDHv2RendezvousCode = {
9696 rendezvous : {
97- algorithm : ECDH . name ,
97+ algorithm : ECDH_V2 . name ,
9898 key : encodeUnpaddedBase64 ( this . ourPublicKey ) ,
9999 transport : await this . transport . details ( ) ,
100100 } ,
@@ -123,7 +123,7 @@ export class MSC3903ECDHv2RendezvousChannel<T> implements RendezvousChannel<T> {
123123 }
124124 const res = rawRes as Partial < PlainTextPayload > ;
125125 const { key, algorithm } = res ;
126- if ( ! algorithm || ! ECDH . matches ( algorithm ) || ! key ) {
126+ if ( ! algorithm || ! ECDH_V2 . matches ( algorithm ) || ! key ) {
127127 throw new RendezvousError (
128128 "Unsupported algorithm: " + algorithm ,
129129 RendezvousFailureReason . UnsupportedAlgorithm ,
@@ -134,7 +134,7 @@ export class MSC3903ECDHv2RendezvousChannel<T> implements RendezvousChannel<T> {
134134 } else {
135135 // send our public key unencrypted
136136 await this . transport . send ( {
137- algorithm : ECDH . name ,
137+ algorithm : ECDH_V2 . name ,
138138 key : encodeUnpaddedBase64 ( this . ourPublicKey ) ,
139139 } ) ;
140140 }
@@ -145,7 +145,7 @@ export class MSC3903ECDHv2RendezvousChannel<T> implements RendezvousChannel<T> {
145145
146146 const initiatorKey = isInitiator ? this . ourPublicKey : this . theirPublicKey ! ;
147147 const recipientKey = isInitiator ? this . theirPublicKey ! : this . ourPublicKey ;
148- let aesInfo = ECDH . name ;
148+ let aesInfo = ECDH_V2 . name ;
149149 aesInfo += `|${ encodeUnpaddedBase64 ( initiatorKey ) } ` ;
150150 aesInfo += `|${ encodeUnpaddedBase64 ( recipientKey ) } ` ;
151151
0 commit comments