my code is like this

Code: Select all

```
template <unsigned char length> __global__ void GetHashes(int* Ret, uint4 HashToCrack, float CharsetLength,unsigned char *basechar,unsigned char *charset){
const float id = (blockIdx.y * gridDim.x + blockIdx.x) * blockDim.x + threadIdx.x;
float counter = id;
unsigned int x1=0,x2=0,x3=0,x4=0,x5=0,x15=0,x16=0; //used to get str and it will be 0x61616161=="aaaa";
int oc;
int a = 0, carry = 0;
if (length >= 1)
{
oc = counter / CharsetLength;
a= basechar[0]+ counter-__mul24(oc,CharsetLength);
if (a >= CharsetLength) { a -= CharsetLength; carry = 1; }
else carry = 0;
x1= charset[a];
counter = oc;
}
if (length >= 2)
{
oc = counter / CharsetLength;
a= basechar[1]+ counter-__mul24(oc,CharsetLength)+carry;
if (a >= CharsetLength) { a -= CharsetLength; carry = 1; }
else carry = 0;
x1 |= charset[a]<<8;
counter = oc;
}
if (length >= 3)
{
oc = counter / CharsetLength;
a= basechar[2]+ counter-__mul24(oc,CharsetLength)+carry;
if (a >= CharsetLength) { a -= CharsetLength; carry = 1; }
else carry = 0;
x1 |= charset[a] << 16;
counter = oc;
}
.........
```

and now i can get aboat 420mhash/s in gtx295 but who can help me to make it much faster.

thx .