View Single Post
  #16  
Old 08-30-2012, 02:44 PM
zementmischer zementmischer is offline
Member
 
Join Date: Apr 2011
Location: Europe
Posts: 43
Default

The decriptor fails because of the two loops inside the enhanced solver:
Code:
 for (k = iSig, iIdx = rgwIdx[i], s = 0; k >= 0; --k)                    
{                                                                       
    d = abs(rgwBC[iIdx] - lpwSig[k]);                           
    s += d * d;                                                         
    if (s > 0x4074 || d > 0x57) { k = 1; break; }                       
    iIdx = _rotr16(iIdx ^ 0x1, 1);                                      
    if (iIdx & 0x8000) iIdx ^= j;                                       
}                                                                       
if (k >= 0) continue;                                                   
                                                                        
for (k = iSig + 1, iIdx = rgwIdx[i], s = 0; k < SSP_SIG_TABLE_SIZE; ++k)
{                                                                       
    if (iIdx & 0x8000) iIdx ^= j;                                       
    iIdx = _rotl16(iIdx, 1) ^ 0x1;                                      
    d = abs(rgwBC[iIdx] - lpwSig[k]);                           
    s += d * d;                                                         
    if (s > 0x4074 || d > 0x57) { k = 1; break; }                       
}                                                                       
if (k < SSP_SIG_TABLE_SIZE) continue;
My workaround was to limit the value of d (I masked it with 0x7F). But increasing the values 0x4074 and 0x57 is also an option.
Needless to say that this is just a dirty hack.
The main culprit is probably one of the pre-computed tables.
As a side note, I also recompiled f1__spor.cpp and this solver was able to calculate the descriptor...
__________________
Real programmers don't comment their code.
If it was hard to write, it should be hard to read.
Reply With Quote