From 9012926b44aa2b40e539237a24b769d5e2f9fcc6 Mon Sep 17 00:00:00 2001 From: Cerber Date: Mon, 27 May 2013 20:12:06 +0200 Subject: [PATCH] Added a getter to be able to know if we are working on native lib or plain java --- src/main/java/com/lambdaworks/crypto/SCrypt.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/com/lambdaworks/crypto/SCrypt.java b/src/main/java/com/lambdaworks/crypto/SCrypt.java index 6274238..e7b764a 100644 --- a/src/main/java/com/lambdaworks/crypto/SCrypt.java +++ b/src/main/java/com/lambdaworks/crypto/SCrypt.java @@ -28,6 +28,14 @@ public class SCrypt { native_library_loaded = loader.load("scrypt", true); } + /** + * Tells if the native lib has been successfully loaded. + * @return true while working on native lib. + */ + public static boolean isNativeImpl(){ + return native_library_loaded; + } + /** * Implementation of the scrypt KDF. * Calls the native implementation {@link #scryptN} when the native library was successfully