decrypt method
Implementation
DecryptResult decrypt(String message) {
final units = utf8.encode(message);
final mem = malloc.call<Uint8>(units.length);
try {
mem.asTypedList(units.length).setAll(0, units);
int outLen =
olm_group_decrypt_max_plaintext_length(_inst, mem, units.length);
mem.asTypedList(units.length).setAll(0, units);
final outMem = malloc.call<Uint8>(outLen + 4);
final outMem2 = outMem.elementAt(outLen).cast<Uint32>();
try {
outLen = olm_group_decrypt(
_inst, mem, units.length, outMem, outLen, outMem2);
return DecryptResult._(
outMem2.value, utf8.decode(outMem.asTypedList(outLen)));
} finally {
malloc.free(outMem);
}
} finally {
malloc.free(mem);
}
}