You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JNI DETECTED ERROR IN APPLICATION: jarray was NULL
java_vm_ext.cc:570] in call to GetByteArrayElements
java_vm_ext.cc:570] from int org.libsodium.jni.SodiumJNI.crypto_secretstream_xchacha20poly1305_push(byte[], byte[], int[], byte[], int, byte[], int, short)
I have noticed a few things I don't know if it's me or the library.
1st the Tag is listed as a short but it is a int. I have tried casting it.
The second is the clen_p is an int[]. So I'm not sure what to do with that? how does one get that?
I think it should be null? When run as null there is no error, but nothing is produced. It just hangs. When not null it's given an error. When not null it looks like it defaults to 80?
Here is what I have done. Because I have this working with data, and the xchacha20poly1305 with PHP. But for some reason android is a mess. I'm crashing on the 1st crypto_secretstream_xchacha20poly1305_push with not null and null produces nothing.
an example would have been helpful.
int chunk = 4096;
int buf_out = chunk + crypto_secretstream_xchacha20poly1305_abytes();
Ekey = new byte[crypto_secretstream_xchacha20poly1305_keybytes()];
crypto_secretstream_xchacha20poly1305_keygen(Ekey);
state = new byte[crypto_secretstream_xchacha20poly1305_statebytes()];
header = new byte[crypto_secretstream_xchacha20poly1305_headerbytes()];
crypto_secretstream_xchacha20poly1305_init_push(state, header, Ekey);
byte[] bytes = new byte[chunk];
byte[] outbyte = new byte[chunk + crypto_secretstream_xchacha20poly1305_abytes()];
ByteArrayOutputStream bos = new ByteArrayOutputStream();
try {
fOut = new FileOutputStream(file);
is = new FileInputStream(fileAP);
bufin = new BufferedInputStream(is);
bufout = new BufferedOutputStream(fOut);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
int tag = crypto_secretstream_xchacha20poly1305_tag_message();
try {
Completable.fromAction(() -> {
int readNum = bufin.read(bytes);
while (readNum != -1) {
int[] outbytelength = new int[1];
crypto_secretstream_xchacha20poly1305_push(state, outbyte, null, ,bytes, bytes.length ,null, 0 , (short)tag);
bufout.write(outbyte);
readNum = bufin.read(bytes);
}if(readNum == -1){
int[] outbytelength = new int[outbyte.length];
int tagf = crypto_secretstream_xchacha20poly1305_tag_final();
Sodium.crypto_secretstream_xchacha20poly1305_push(state, outbyte, null ,bytes, bytes.length ,null, 0 , (short) tagf);
bufout.write(outbyte);
}
})
.subscribeOn(Schedulers.io())
.onErrorComplete()
.observeOn(AndroidSchedulers.mainThread())
.subscribe();
} catch (Exception ea) {
}
The text was updated successfully, but these errors were encountered:
Trying to do the file encryption not the stream.
JNI DETECTED ERROR IN APPLICATION: jarray was NULL
java_vm_ext.cc:570] in call to GetByteArrayElements
java_vm_ext.cc:570] from int org.libsodium.jni.SodiumJNI.crypto_secretstream_xchacha20poly1305_push(byte[], byte[], int[], byte[], int, byte[], int, short)
I have noticed a few things I don't know if it's me or the library.
1st the Tag is listed as a short but it is a int. I have tried casting it.
The second is the clen_p is an int[]. So I'm not sure what to do with that? how does one get that?
I think it should be null? When run as null there is no error, but nothing is produced. It just hangs. When not null it's given an error. When not null it looks like it defaults to 80?
Here is what I have done. Because I have this working with data, and the xchacha20poly1305 with PHP. But for some reason android is a mess. I'm crashing on the 1st crypto_secretstream_xchacha20poly1305_push with not null and null produces nothing.
an example would have been helpful.
The text was updated successfully, but these errors were encountered: