Skip to content

Commit

Permalink
Vectorized 1Password, cloudkeychain and added support for long passwords
Browse files Browse the repository at this point in the history
  • Loading branch information
jsteube committed Jul 6, 2017
1 parent d63e5f2 commit ccd85f3
Show file tree
Hide file tree
Showing 7 changed files with 325 additions and 679 deletions.
6 changes: 4 additions & 2 deletions OpenCL/inc_hash_sha1.cl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ void sha1_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], const u3
u32 we_t = w3[2];
u32 wf_t = w3[3];

#undef K
#define K SHA1C00

SHA1_STEP_S (SHA1_F0o, a, b, c, d, e, w0_t);
Expand Down Expand Up @@ -138,6 +137,8 @@ void sha1_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], const u3
we_t = rotl32_S ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP_S (SHA1_F1, c, d, e, a, b, we_t);
wf_t = rotl32_S ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP_S (SHA1_F1, b, c, d, e, a, wf_t);

#undef K

digest[0] += a;
digest[1] += b;
digest[2] += c;
Expand Down Expand Up @@ -844,7 +845,6 @@ void sha1_transform_vector (const u32x w0[4], const u32x w1[4], const u32x w2[4]
u32x we_t = w3[2];
u32x wf_t = w3[3];

#undef K
#define K SHA1C00

SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t);
Expand Down Expand Up @@ -940,6 +940,8 @@ void sha1_transform_vector (const u32x w0[4], const u32x w1[4], const u32x w2[4]
we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);

#undef K

digest[0] += a;
digest[1] += b;
digest[2] += c;
Expand Down
6 changes: 6 additions & 0 deletions OpenCL/inc_hash_sha256.cl
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ void sha256_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], const
ROUND_EXPAND_S (); ROUND_STEP_S (i);
}

#undef ROUND_EXPAND_S
#undef ROUND_STEP_S

digest[0] += a;
digest[1] += b;
digest[2] += c;
Expand Down Expand Up @@ -880,6 +883,9 @@ void sha256_transform_vector (const u32x w0[4], const u32x w1[4], const u32x w2[
ROUND_EXPAND (); ROUND_STEP (i);
}

#undef ROUND_EXPAND
#undef ROUND_STEP

digest[0] += a;
digest[1] += b;
digest[2] += c;
Expand Down
6 changes: 6 additions & 0 deletions OpenCL/inc_hash_sha512.cl
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ void sha512_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], const
ROUND_EXPAND_S (); ROUND_STEP_S (i);
}

#undef ROUND_EXPAND_S
#undef ROUND_STEP_S

digest[0] += a;
digest[1] += b;
digest[2] += c;
Expand Down Expand Up @@ -1315,6 +1318,9 @@ void sha512_transform_vector (const u32x w0[4], const u32x w1[4], const u32x w2[
ROUND_EXPAND (); ROUND_STEP (i);
}

#undef ROUND_EXPAND
#undef ROUND_STEP

digest[0] += a;
digest[1] += b;
digest[2] += c;
Expand Down
1 change: 1 addition & 0 deletions OpenCL/inc_hash_whirlpool.cl
Original file line number Diff line number Diff line change
Expand Up @@ -2351,5 +2351,6 @@ void whirlpool_final_vector (whirlpool_ctx_vector_t *ctx, __local u32 (*s_Ch)[25
whirlpool_transform_vector (ctx->w0, ctx->w1, ctx->w2, ctx->w3, ctx->h, s_Ch, s_Cl);
}

#undef R
#undef BOX
#undef BOX_S
Loading

0 comments on commit ccd85f3

Please sign in to comment.