Skip to content

Commit

Permalink
java 22 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Zylquinal committed Jun 19, 2024
1 parent d428632 commit 0dc3813
Show file tree
Hide file tree
Showing 24 changed files with 3,529 additions and 2,167 deletions.
12 changes: 0 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,6 @@ dependencies {
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
}

tasks.withType(JavaCompile).configureEach {
options.compilerArgs += "--enable-preview"
}

tasks.withType(Test).configureEach {
jvmArgs += "--enable-preview"
}

tasks.withType(JavaExec).configureEach {
jvmArgs += "--enable-preview"
}

test {
useJUnitPlatform()
}
2 changes: 1 addition & 1 deletion src/main/java/com/zylquinal/argon2/api/ArgonDirect.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public static byte[] rawHash(byte @NotNull [] password, byte @NotNull [] salt, b
int memoryCost, int parallelism, int iterations, @NotNull ArgonVersion version, @NotNull ArgonFlag flag, @NotNull ArgonVariant variant) {
try (Arena arena = Arena.ofConfined()) {
MemorySegment struct = Argon2_Context.layout(password, salt, secret, associatedData, hashLength, memoryCost, parallelism, iterations, version, flag, arena);
MemorySegment outAddress = Argon2_Context.out$get(struct);
MemorySegment outAddress = Argon2_Context.out(struct);
int result = argon2_h.argon2_ctx(struct, variant.variant());
if (result != 0) throw new ArgonException(ArgonStatus.of(result));
return outAddress.asSlice(0, hashLength).toArray(ValueLayout.OfByte.JAVA_BYTE);
Expand Down
Loading

0 comments on commit 0dc3813

Please sign in to comment.