CHG: Syncronized so all different parts uses the same implementation of Crapto1 v3.3

This commit is contained in:
iceman1001
2016-01-19 18:01:16 +01:00
parent 1a4b67382a
commit 8130eba4d1
11 changed files with 41 additions and 48 deletions

View File

@@ -520,7 +520,7 @@ struct Crypto1State* lfsr_common_prefix(uint32_t pfx, uint32_t rr, uint8_t ks[8]
odd = lfsr_prefix_ks(ks, 1);
even = lfsr_prefix_ks(ks, 0);
s = statelist = malloc((sizeof *statelist) << 20);
s = statelist = malloc((sizeof *statelist) << 21);
if(!s || !odd || !even) {
free(statelist);
free(odd);

View File

@@ -37,7 +37,6 @@ struct Crypto1State* lfsr_recovery32(uint32_t ks2, uint32_t in);
struct Crypto1State* lfsr_recovery64(uint32_t ks2, uint32_t ks3);
uint32_t *lfsr_prefix_ks(uint8_t ks[8], int isodd);
struct Crypto1State* lfsr_common_prefix(uint32_t pfx, uint32_t rr, uint8_t ks[8], uint8_t par[8][8]);
struct Crypto1State* lfsr_common_prefix_ex(uint32_t pfx, uint8_t ks[8], uint8_t par[8][8]);
uint8_t lfsr_rollback_bit(struct Crypto1State* s, uint32_t in, int fb);
uint8_t lfsr_rollback_byte(struct Crypto1State* s, uint32_t in, int fb);
@@ -69,7 +68,7 @@ static inline int parity(uint32_t x)
x ^= x >> 4;
return BIT(0x6996, x & 0xf);
#else
__asm__( "movl %1, %%eax\n"
__asm__( "movl %1, %%eax\n"
"mov %%ax, %%cx\n"
"shrl $0x10, %%eax\n"
"xor %%ax, %%cx\n"

View File

@@ -59,6 +59,7 @@ int nonce2key(uint32_t uid, uint32_t nt, uint32_t nr, uint64_t par_info, uint64_
state = lfsr_common_prefix(nr, rr, ks3x, par);
lfsr_rollback_word(state, uid^nt, 0);
crypto1_get_lfsr(state, key);
printf("\nkey recovered: %012"llx"\n\n",key);
crypto1_destroy(state);
return 0;
}