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

Factor out a function for doing olm encryption #177

Merged
merged 1 commit into from
Aug 22, 2016
Merged

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Aug 22, 2016

Make a library file with some constants and a function to pack olm-encrypted
events (which we are going to use from megolm)

Make a library file with some constants and a function to pack olm-encrypted
events (which we are going to use from megolm)
@NegativeMjark
Copy link
Contributor

I'm not sure I really understand the module structure going on here. But it looks like valid javascript?

@richvdh
Copy link
Member Author

richvdh commented Aug 22, 2016

I'm not sure I really understand the module structure going on here

Nor am I, to be honest. It's evolved out of everything being dumped in MatrixClient, and I'm not entirely satisfied with the results.

Currently we have:

  • Crypto - supposedly the interface which MatrixClient uses to do all of its cryptography bits. Delegates to:
  • crypto-algorithms: implementations of event encryption and decryption
  • OlmDevice - wrapper around olm.js library; nothing matrix-specific here. (Frankly it probably ought to be in olm.js).

The problem is that Crypto has ended up as a dumping ground instead, and includes a bunch of methods which only really exist so that crypto-algorithms implementations can call back to them; that means both that the MatrixClient-facing interface is obscured by the other crap, and that you end up with circularity in the modules. Hence deciding we need yet another module for stuff that is common between the olm and megolm crypto-algorithms interfaces.

Your suggestions for making this better are very welcome.

But it looks like valid javascript?

Do you think it is correct javascript?

@NegativeMjark
Copy link
Contributor

Okay so crypto.js -> crypto-algorithms/*.js -> olmlib.js -> OlmDevice.js -> olm.js

@NegativeMjark
Copy link
Contributor

I guess that's okay. LGTM.

@richvdh
Copy link
Member Author

richvdh commented Aug 22, 2016

ja

On 22/08/16 11:59, Mark Haines wrote:

Okay so |crypto.js -> crypto-algorithms/*.js -> olmlib.js ->
OlmDevice.js -> olm.js|

@richvdh richvdh merged commit e4bfb3c into develop Aug 22, 2016
@richvdh richvdh deleted the rav/olmlib branch August 22, 2016 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants