37 lines
863 B
D
Raw Permalink Normal View History

2025-03-11 01:01:54 +03:00
module bindings.olm;
// import api: Encrypted;
// void decrypt(Encrypted* evt) @nogc {
// import main: session;
// import libolm.inbound;
// import core.stdc.stdlib;
// import core.stdc.string: strcpy;
// // import std.stdio;
// char[] buf = cast(char[])malloc(evt.ciphertext.length)[0..evt.ciphertext.length];
// strcpy(cast(char*)buf, cast(char*)evt.ciphertext);
// size_t mlen = olm_group_decrypt_max_plaintext_length (
// session,
// cast(ubyte*)buf,
// buf.length
// );
// char[] decbuf = cast(char[])malloc(mlen)[0..mlen];
// size_t dcr = olm_group_decrypt (
// session,
// cast(ubyte*)buf,
// buf.length,
// cast(ubyte*)decbuf,
// mlen,
// null
// );
// import core.stdc.stdio;
// printf("%d\n", dcr);
// // // string msg = cast(string)decbuf[0..dcr];
// // writeln(dcr);
// // writeln(msg);
// }