Generic MBEDTLS_ROOT

This commit is contained in:
Andrew Steinborn
2018-12-24 12:18:36 -05:00
parent 1c2235af5a
commit e690d88fa0
3 changed files with 6 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Modify as you need. # Modify as you need.
MBEDTLS_ROOT=mbedtls-2.12.0 MBEDTLS_ROOT=mbedtls
CFLAGS="-O3 -I$JAVA_HOME/include/ -I$JAVA_HOME/include/linux/ -fPIC -shared" CFLAGS="-O3 -I$JAVA_HOME/include/ -I$JAVA_HOME/include/linux/ -fPIC -shared"
gcc $CFLAGS -lz src/main/c/jni_util.c src/main/c/jni_zlib_deflate.c src/main/c/jni_zlib_inflate.c \ gcc $CFLAGS -lz src/main/c/jni_util.c src/main/c/jni_zlib_deflate.c src/main/c/jni_zlib_inflate.c \
-o src/main/resources/linux_x64/velocity-compress.so -o src/main/resources/linux_x64/velocity-compress.so

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Modify as you need. # Modify as you need.
MBEDTLS_ROOT=mbedtls-2.12.0 MBEDTLS_ROOT=mbedtls
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home
CFLAGS="-O3 -I$JAVA_HOME/include/ -I$JAVA_HOME/include/darwin/ -fPIC -shared" CFLAGS="-O3 -I$JAVA_HOME/include/ -I$JAVA_HOME/include/darwin/ -fPIC -shared"

View File

@@ -1,8 +1,10 @@
package com.velocitypowered.natives.encryption; package com.velocitypowered.natives.encryption;
public class MbedtlsAesImpl { import java.security.GeneralSecurityException;
native long init(byte[] key); class MbedtlsAesImpl {
native long init(byte[] key) throws GeneralSecurityException;
native void process(long ctx, long sourceAddress, int sourceLength, long destinationAddress, native void process(long ctx, long sourceAddress, int sourceLength, long destinationAddress,
boolean encrypt); boolean encrypt);