|
Message-ID: <b306f6d5701cafc52a0323b7c4fe3fcd@smtp.hushmail.com> Date: Mon, 21 Jan 2013 19:39:23 +0100 From: magnum <john.magnum@...hmail.com> To: john-dev@...ts.openwall.com Subject: Re: Proposed optimizations to pwsafe On 21 Jan, 2013, at 19:15 , magnum <john.magnum@...hmail.com> wrote: > On 21 Jan, 2013, at 18:55 , Brian Wallace <nightstrike9809@...il.com> wrote: > >> Fixed the OpenSSL comment issue and made a pull request. I can look into doing the SIMD for SHA256. > > Thanks! I accepted the pull request for unstable-jumbo although it is mosty bugfix-only. SIMD would be excellent but please check out the bleeding-jumbo branch for that. Our local sha2.h may end up using OpenSSL, CommonCrypto or homebrewn code. The use of an OpenSSL-internal struct member broke CommonCrypto builds but it was an easy fix: @@ -487,12 +487,18 @@ static int crypt_all(int *pcount, struct db_salt *salt) #endif { SHA256_CTX ctx; + SHA256_Init(&ctx); SHA256_Update(&ctx, saved_key[index], strlen(saved_key[index])); SHA256_Update(&ctx, cur_salt->salt, 32); SHA256_Final((unsigned char*)crypt_out[index], &ctx); +#ifdef COMMON_DIGEST_FOR_OPENSSL + pwsafe_sha256_iterate(ctx.hash, cur_salt->iterations); + memcpy(crypt_out[index], ctx.hash, 32); +#else pwsafe_sha256_iterate(ctx.h, cur_salt->iterations); memcpy(crypt_out[index], ctx.h, 32); +#endif } return count; } The patches are merged to bleeding-jumbo too now. magnum
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.