Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Sat, 31 Aug 2013 13:43:01 -0300
From: Claudio André <claudioandre.br@...il.com>
To: john-dev@...ts.openwall.com
Subject: Commit a77b867 (names pattern)

Hi, seems to be better to, also, apply the attached patch. It uses the 
same names pattern for previous code.

Thanks.



>From 7e229a261e3fcc8b3d0257aba0614db65d3bea7c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Claudio=20Andr=C3=A9?= <claudio.andre@...reios.net.br>
Date: Sat, 31 Aug 2013 13:30:49 -0300
Subject: [PATCH 1557/1557] Follow naming convention specified at: a77b867.

---
 src/opencl_cryptmd5_fmt.c           | 5 +++--
 src/opencl_cryptsha256_fmt.c        | 6 ++++--
 src/opencl_cryptsha512_fmt.c        | 6 ++++--
 src/opencl_pbkdf2_hmac_sha256_fmt.c | 5 +++--
 src/opencl_pwsafe_fmt.c             | 5 +++--
 src/opencl_rawmd4_fmt.c             | 5 +++--
 src/opencl_rawmd5_fmt.c             | 5 +++--
 src/opencl_rawsha256_fmt.c          | 6 ++++--
 src/opencl_rawsha512-ng_fmt.c       | 6 ++++--
 9 files changed, 31 insertions(+), 18 deletions(-)

diff --git a/src/opencl_cryptmd5_fmt.c b/src/opencl_cryptmd5_fmt.c
index 7c079ca..b77b56b 100644
--- a/src/opencl_cryptmd5_fmt.c
+++ b/src/opencl_cryptmd5_fmt.c
@@ -40,7 +40,7 @@
 #define MIN_KEYS_PER_CRYPT	1 /* These will change in init() */
 #define MAX_KEYS_PER_CRYPT	1
 
-#define CONFIG_NAME		"md5crypt"
+#define OCL_CONFIG		"md5crypt"
 #define STEP                    1024
 #define ROUNDS_DEFAULT          1000
 
@@ -317,7 +317,8 @@ static void init(struct fmt_main *self)
 	/* Note: we ask for the kernels' max sizes, not the device's! */
 	HANDLE_CLERROR(clGetKernelWorkGroupInfo(crypt_kernel, devices[ocl_gpu_id], CL_KERNEL_WORK_GROUP_SIZE, sizeof(maxsize), &maxsize, NULL), "Query max work group size");
 
-	opencl_get_user_preferences(CONFIG_NAME);
+	/* Read LWS/GWS prefs from config or environment */
+	opencl_get_user_preferences(OCL_CONFIG);
 
 	//Initialize openCL tuning (library) for this format.
 	opencl_init_auto_setup(STEP, 0, 3, NULL,
diff --git a/src/opencl_cryptsha256_fmt.c b/src/opencl_cryptsha256_fmt.c
index 7397222..d18bf5d 100644
--- a/src/opencl_cryptsha256_fmt.c
+++ b/src/opencl_cryptsha256_fmt.c
@@ -26,7 +26,7 @@
 #define BENCHMARK_COMMENT		" (rounds=5000)"
 #define BENCHMARK_LENGTH		-1
 
-#define CONFIG_NAME			"sha256crypt"
+#define OCL_CONFIG			"sha256crypt"
 
 //Checks for source code to pick (parameters, sizes, kernels to execute, etc.)
 #define _USE_CPU_SOURCE			(cpu(source_in_use))
@@ -377,7 +377,9 @@ static void init(struct fmt_main * self) {
 	source_in_use = device_info[ocl_gpu_id];
 	global_work_size = get_task_max_size();
 	local_work_size = get_default_workgroup();
-	opencl_get_user_preferences(CONFIG_NAME);
+
+	/* Read LWS/GWS prefs from config or environment */
+	opencl_get_user_preferences(OCL_CONFIG);
 
 	//Initialize openCL tuning (library) for this format.
 	opencl_init_auto_setup(STEP, HASH_LOOPS, ((_SPLIT_KERNEL_IN_USE) ? 7 : 3),
diff --git a/src/opencl_cryptsha512_fmt.c b/src/opencl_cryptsha512_fmt.c
index 6659c86..e33ceee 100644
--- a/src/opencl_cryptsha512_fmt.c
+++ b/src/opencl_cryptsha512_fmt.c
@@ -22,7 +22,7 @@
 
 #define FORMAT_LABEL			"sha512crypt-opencl"
 #define ALGORITHM_NAME			"SHA512 OpenCL"
-#define CONFIG_NAME			"sha512crypt"
+#define OCL_CONFIG			"sha512crypt"
 
 //Checks for source code to pick (parameters, sizes, kernels to execute, etc.)
 #define _USE_CPU_SOURCE			(cpu(source_in_use))
@@ -359,7 +359,9 @@ static void init(struct fmt_main * self) {
 
 	global_work_size = get_task_max_size();
 	local_work_size = get_default_workgroup();
-	opencl_get_user_preferences(CONFIG_NAME);
+
+	/* Read LWS/GWS prefs from config or environment */
+	opencl_get_user_preferences(OCL_CONFIG);
 
 	//Initialize openCL tuning (library) for this format.
 	opencl_init_auto_setup(STEP, HASH_LOOPS, ((_SPLIT_KERNEL_IN_USE) ? 7 : 3),
diff --git a/src/opencl_pbkdf2_hmac_sha256_fmt.c b/src/opencl_pbkdf2_hmac_sha256_fmt.c
index 4927737..9f45120 100644
--- a/src/opencl_pbkdf2_hmac_sha256_fmt.c
+++ b/src/opencl_pbkdf2_hmac_sha256_fmt.c
@@ -40,7 +40,7 @@
 #define FMT_PREFIX		"$pbkdf2-sha256$"
 #define KERNEL_NAME		"pbkdf2_sha256_kernel"
 #define SPLIT_KERNEL_NAME	"pbkdf2_sha256_loop"
-#define CONFIG_NAME		"pbkdf2_sha256"
+#define OCL_CONFIG		"pbkdf2_sha256"
 
 #define MIN(a,b)		(((a)<(b))?(a):(b))
 #define HASH_LOOPS		500
@@ -152,7 +152,8 @@ static void init(struct fmt_main *self)
         opencl_init("$JOHN/kernels/pbkdf2_hmac_sha256_kernel.cl",
             ocl_gpu_id, build_opts);
 
-	opencl_get_user_preferences(CONFIG_NAME);
+	/* Read LWS/GWS prefs from config or environment */
+	opencl_get_user_preferences(OCL_CONFIG);
 	if (!local_work_size) {
 #ifdef DEBUG
 		fprintf(stderr, "Forcing LWS = %d\n", DEFAULT_LWS);
diff --git a/src/opencl_pwsafe_fmt.c b/src/opencl_pwsafe_fmt.c
index 7f223f8..74edf07 100644
--- a/src/opencl_pwsafe_fmt.c
+++ b/src/opencl_pwsafe_fmt.c
@@ -40,7 +40,7 @@
 #define MIN_KEYS_PER_CRYPT      (512*112)
 #define MAX_KEYS_PER_CRYPT      MIN_KEYS_PER_CRYPT
 
-#define CONFIG_NAME		"pwsafe"
+#define OCL_CONFIG		"pwsafe"
 #define STEP                    256
 #define ROUNDS_DEFAULT          2048
 
@@ -232,7 +232,8 @@ static void init(struct fmt_main *self)
 
 	local_work_size = cpu(device_info[ocl_gpu_id]) ? 1 : 64;
 
-	opencl_get_user_preferences(CONFIG_NAME);
+	/* Read LWS/GWS prefs from config or environment */
+	opencl_get_user_preferences(OCL_CONFIG);
 
 	//Initialize openCL tuning (library) for this format.
 	opencl_init_auto_setup(STEP, ROUNDS_DEFAULT/8, 8, split_events,
diff --git a/src/opencl_rawmd4_fmt.c b/src/opencl_rawmd4_fmt.c
index 026db58..97ab215 100644
--- a/src/opencl_rawmd4_fmt.c
+++ b/src/opencl_rawmd4_fmt.c
@@ -50,7 +50,7 @@ static unsigned int key_idx = 0;
 #define MIN_KEYS_PER_CRYPT      1024
 #define MAX_KEYS_PER_CRYPT      (1024 * 2048)
 
-#define CONFIG_NAME             "rawmd4"
+#define OCL_CONFIG              "rawmd4"
 #define STEP                    65536
 
 static int have_full_hashes;
@@ -178,7 +178,8 @@ static void init(struct fmt_main *self)
 	crypt_kernel = clCreateKernel(program[ocl_gpu_id], "md4", &ret_code);
 	HANDLE_CLERROR(ret_code, "Error creating kernel. Double-check kernel name?");
 
-	opencl_get_user_preferences(CONFIG_NAME);
+	/* Read LWS/GWS prefs from config or environment */
+	opencl_get_user_preferences(OCL_CONFIG);
 
 	// Initialize openCL tuning (library) for this format.
 	opencl_init_auto_setup(STEP, 0, 3, NULL, warn,
diff --git a/src/opencl_rawmd5_fmt.c b/src/opencl_rawmd5_fmt.c
index 62511ff..2e3e51c 100644
--- a/src/opencl_rawmd5_fmt.c
+++ b/src/opencl_rawmd5_fmt.c
@@ -50,7 +50,7 @@ static unsigned int key_idx = 0;
 #define MIN_KEYS_PER_CRYPT      1024
 #define MAX_KEYS_PER_CRYPT      (1024 * 2048)
 
-#define CONFIG_NAME             "rawmd5"
+#define OCL_CONFIG             "rawmd5"
 #define STEP                    65536
 
 static int have_full_hashes;
@@ -174,7 +174,8 @@ static void init(struct fmt_main *self)
 	crypt_kernel = clCreateKernel(program[ocl_gpu_id], "md5", &ret_code);
 	HANDLE_CLERROR(ret_code, "Error creating kernel. Double-check kernel name?");
 
-	opencl_get_user_preferences(CONFIG_NAME);
+	/* Read LWS/GWS prefs from config or environment */
+	opencl_get_user_preferences(OCL_CONFIG);
 
 	// Initialize openCL tuning (library) for this format.
 	opencl_init_auto_setup(STEP, 0, 3, NULL, warn,
diff --git a/src/opencl_rawsha256_fmt.c b/src/opencl_rawsha256_fmt.c
index 7038893..e7984ae 100644
--- a/src/opencl_rawsha256_fmt.c
+++ b/src/opencl_rawsha256_fmt.c
@@ -28,7 +28,7 @@
 
 #define ALGORITHM_NAME			"SHA256 OpenCL (inefficient, development use mostly)"
 
-#define CONFIG_NAME			"rawsha256"
+#define OCL_CONFIG			"rawsha256"
 
 static uint32_t				* plaintext, * saved_idx;	// plaintext ciphertexts
 static uint32_t				* calculated_hash;		// calculated (partial) hashes
@@ -320,7 +320,9 @@ static void init(struct fmt_main * self) {
 
 	global_work_size = get_task_max_size();
 	local_work_size = get_default_workgroup();
-	opencl_get_user_preferences(CONFIG_NAME);
+
+	/* Read LWS/GWS prefs from config or environment */
+	opencl_get_user_preferences(OCL_CONFIG);
 
 	gws_limit = MIN((0xf << 22) * 4 / BUFFER_SIZE,
 			get_max_mem_alloc_size(ocl_gpu_id) / BUFFER_SIZE);
diff --git a/src/opencl_rawsha512-ng_fmt.c b/src/opencl_rawsha512-ng_fmt.c
index b66fdb9..f4a211a 100644
--- a/src/opencl_rawsha512-ng_fmt.c
+++ b/src/opencl_rawsha512-ng_fmt.c
@@ -38,7 +38,7 @@
 #define RAW_BENCHMARK_LENGTH		-1
 #define X_BENCHMARK_LENGTH		0
 
-#define CONFIG_NAME			"rawsha512"
+#define OCL_CONFIG			"rawsha512"
 
 static sha512_salt			* salt;
 static uint32_t				* plaintext, * saved_idx;	// plaintext ciphertexts
@@ -393,7 +393,9 @@ static void init(struct fmt_main * self) {
 
 	global_work_size = get_task_max_size();
 	local_work_size = get_default_workgroup();
-	opencl_get_user_preferences(CONFIG_NAME);
+
+	/* Read LWS/GWS prefs from config or environment */
+	opencl_get_user_preferences(OCL_CONFIG);
 
 	gws_limit = MIN((0xf << 22) * 4 / BUFFER_SIZE,
 			get_max_mem_alloc_size(ocl_gpu_id) / BUFFER_SIZE);
-- 
1.8.1.2


Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ