/
opencl_bf_std.h
71 lines (56 loc) · 1.53 KB
/
opencl_bf_std.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
* This software is Copyright (c) 2012 Sayantan Datta <std2048 at gmail dot com>
* and it is hereby released to the general public under the following terms:
* Redistribution and use in source and binary forms, with or without modification, are permitted.
*/
#ifndef _OPENCL_BF_STD_H
#define _OPENCL_BF_STD_H
#include "arch.h"
#include "common.h"
#include "common-opencl.h"
typedef unsigned int BF_word;
/*
* Binary salt type, also keeps the number of rounds and hash sub-type.
*/
typedef struct {
BF_word salt[4];
unsigned char rounds;
char subtype;
} BF_salt;
/*
* Binary ciphertext type.
*/
typedef BF_word BF_binary[6];
#define BF_N 1024
#define MAX_DEVICES_PER_PLATFORM 8
/*
* BF_std_crypt() output buffer.
*/
extern BF_binary opencl_BF_out[BF_N];
/*
* ASCII to binary conversion table, for use in BF_fmt.valid().
*/
extern unsigned char opencl_BF_atoi64[0x80];
/*
* Sets a key for BF_std_crypt().
*/
extern void opencl_BF_std_set_key(char *key, int index, int sign_extension_bug);
/*
* Main hashing routine, sets first two words of BF_out
* (or all words in an OpenMP-enabled build).
*/
extern void opencl_BF_std_crypt(BF_salt *salt, int n);
/*
* Calculates the rest of BF_out, for exact comparison.
*/
extern void opencl_BF_std_crypt_exact(int index);
/*
* Returns the salt for BF_std_crypt().
*/
extern void *opencl_BF_std_get_salt(char *ciphertext);
/*
* Converts an ASCII ciphertext to binary.
*/
extern void *opencl_BF_std_get_binary(char *ciphertext);
extern void BF_select_device(int,int);
#endif