-
Notifications
You must be signed in to change notification settings - Fork 6
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
I'd like crypto_stream_xchacha20 and Point*scalar multiplication to be available #5
Comments
Hi. First, if you want to try things out before actually implementing them here, you can use the native bindings to the C-API/JS directly. For example, to use the C-API, you could do: import 'sodium/sodium.ffi.dart';
final dylib = DynamicLibrary.open('...');
final bindings = LibSodiumFFI(dylib);
final keyBytes = bindings.crypto_stream_chacha20_keybytes()
// ... This is not really documented yet, but always a good fallback to get to those APIs quickly. See https://github.com/Skycoder42/libsodium_dart_bindings/blob/main/packages/sodium/lib/src/ffi/bindings/libsodium.ffi.dart for the full file - but warning, it's a very big, generated file. Regarding the PRs - I am not sure yet, how I would want to implement them. The The What do you think? |
Hi, I spent another thought at this and came up with the following idea for integrating the advanced APIs. Here is a small draft. All "advanced" interfaces should be placed in class AdvancedStreamCipher {
// implementation of crypto_stream_XXX
}
class AdvancedSecretStream extends SecretStream {
AdvancedStreamCipher get chacha20;
AdvancedStreamCipher get xchacha20;
// ...
}
class AdvancedScalarMult {
// implementation of crypto_scalarmult
}
class AdvancedCrypto extends Crypto {
@override
AdvancedSecretStream get secretStream;
AdvancedScalarMult get scalarMult;
}
class AdvancedSodium extends Sodium {
@override
AdvancedCrypto get crypto;
}
|
So, if I understand the second draft correctly, you'd go through a whole separate "init" cycle to access the advanced APIs. If that's so I think I really like it. I'd rather have it be really hard to accidentally stray from the safer high level APIs. Am I following your idea correctly? |
Yes, exactly |
I'll be working on this on my |
As the general Advanced APIs have now been implemented in 2.0.0, together with the scalarmult APIs, the crypto_stream_xchacha20 part has been moved to #21 and this issue is closed in favor of the new one |
I'm interested in non-authenticated XChaCha20, for use with SIV. I'm also interested in something a bit lower-level than the
kx
API. I know both of these fall under the advanced tab, and that those items aren't yet implemented. I don't mind putting together a couple PRs, but I'd like some guidance on how you'd like to have the Advanced items organized (under which objects do they go, etc.) or if you'd rather not offer them at all yet.The text was updated successfully, but these errors were encountered: