Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve documentation of Rust crypto #4132

Open
2 tasks
richvdh opened this issue Mar 25, 2024 · 6 comments
Open
2 tasks

Improve documentation of Rust crypto #4132

richvdh opened this issue Mar 25, 2024 · 6 comments
Labels
A-Developer-Experience A-Element-R Issues affecting the port of Element's crypto layer to Rust T-Task Tasks for the team like planning

Comments

@richvdh
Copy link
Member

richvdh commented Mar 25, 2024

@richvdh richvdh added the A-Element-R Issues affecting the port of Element's crypto layer to Rust label Mar 25, 2024
@richvdh
Copy link
Member Author

richvdh commented Mar 25, 2024

We might want to make initCrypto an alias for initRustCrypto first, to save updating the docs twice

@t3chguy
Copy link
Member

t3chguy commented Mar 25, 2024

We might want to make initCrypto an alias for initRustCrypto first, to save updating the docs twice

Rust Crypto hasn't reached feature parity yet, so I'm against this.

@richvdh
Copy link
Member Author

richvdh commented Mar 25, 2024

Rust Crypto hasn't reached feature parity yet, so I'm against this.

We're planning to remove the old code soon, rather than maintaining two crypto stacks indefinitely. If you're aware of any specific blockers, could you raise them as issues so we can prioritise them?

@t3chguy
Copy link
Member

t3chguy commented Mar 25, 2024

One that has massively impacted me personally due to switching HS:

@florianduros florianduros added A-Developer-Experience T-Task Tasks for the team like planning labels Mar 25, 2024
@matthintosh
Copy link

matthintosh commented May 20, 2024

Hi ! Any news about this issue ? I have multiple blocking point with rust crypto like "One time key signed_curve25519:AAAAAAAAAA8 already exists" and unable to decrypt message. Maybe I'm missing something on client creation side or whatever but the documentation related to e2ee is very poor actually and the README explain that the old fashionned way for encryption is deprecated. Any help is welcome. Thank you !

@saul-jb
Copy link
Contributor

saul-jb commented Oct 8, 2024

I have multiple blocking point with rust crypto like "One time key signed_curve25519:AAAAAAAAAA8 already exists" and unable to decrypt message.

Just been through the headache of updating matrix-js-sdk and getting e2e encryption working again with the rust crypto... I was running into that error when I had disabled indexedDB in initRustCrypto:

const client = sdk.createClient({
  // ...
  cryptoStore: new LocalStorageCryptoStore(path)
})

await client.initRustCrypto({ useIndexedDB: false })

To fix this you need to enabled indexedDB and provide an implementation as your crypto store using: IndexedDBCryptoStore, i.e. :

/**
 * This part is to load an implementation of indexedDB in nodejs:
 */

// @ts-expect-error Missing types.
import dbManager from 'node-indexeddb/dbManager'
async function loadModule (): Promise<void> {
  await dbManager.loadCache().catch(console.error)

  // @ts-expect-error Missing types.
  await import('node-indexeddb/auto')
}
await loadModule()
/**
 * This part is to use the indexedDB
 */
const idbFactory = new IDBFactory()

const client = sdk.createClient({
  // ...
  cryptoStore: new IndexedDBCryptoStore(idbFactory, path)
})

await client.initRustCrypto()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Developer-Experience A-Element-R Issues affecting the port of Element's crypto layer to Rust T-Task Tasks for the team like planning
Projects
None yet
Development

No branches or pull requests

5 participants