xargo does print a reasonably nice error for this, but it doesn't
mention which toolchain to install rust-src for. Check ourselves so
that CocoaPods clients don't have to do something weird like "cd into
the package and run rustup there".
While a Curve25519 private key can always derive its corresponding
public key, doing so is not a free operation. Make sure we're only
ever doing so once, or not at all if we already have that information.
This results in a ~10% speedup to SSv2 encrypt and decrypt operations.
Also, convert the output of HKDF to a fixed-size array for storage,
instead of keeping around a boxed slice. This seems to allow for
further optimization and another 5% or so speedup.
Signal has a fork of curve25519-dalek to add some features that are
used by zkgroup. However, libsignal-protocol and poksho don't use
those features directly, and thus they don't depend on our fork
specifically. Anyone outside of Signal using libsignal-protocol can
thus use the standard curve25519-dalek and avoid building it twice.
Signal will continue using our fork thanks to the workspace patch in
the root Cargo.toml.
Additionally, remove all the passthrough features for customizing
curve25519-dalek; we don't use any of them, and clients can always
specify them directly.
- Upgrade electron and typescript to match Desktop.
- Manually upgrade node-gyp and electron-mocha.
- Don't explicitly specify mocha; let electron-mocha choose it.
- Don't explicitly specify @types/node; let electron choose it.
- yarn upgrade
On Windows, node-gyp tries to be helpful by changing forward slashes
to backslashes and making paths relative to the source root rather
than the build directory, and indeed we rely on that. However, it has
to guess what's a path and what isn't. Previously, we worked around
that by manually stripping the prepended "..\", but the node-gyp
maintainers suggested a better workaround of using joined arguments
instead (`--foo=bar` instead of `--foo bar`).
This is overkill for most calls but multi-recipient messages require
potentially a lot of objects. The codegen is in the way of making a
surgical change at the moment so hitting it with a broad fix for
now. May return to add a conditional to the macro definition later.
The only operation that touches archived sessions is decryption, and
even then only in two cases: when checking to see if an incoming
PreKey message matches an existing session, and after decrypting on
the current session fails. Neither of those are unlikely, but they
happen an order of magnitude less than normal decryptions (not to
mention encryptions), so it's worth making the fast path faster.
This dedicated error is thrown when a recipient has a registration ID
that's out of the range used by Signal [0, 0x3FFF]. These IDs cannot
be encoded in the sealed sender v2 format and are not supported, even
though they don't cause any problems for 1:1 messages.