1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-01-09 15:20:59 +00:00

whitespace and code style fixes

This commit is contained in:
philsmd 2021-10-08 17:38:54 +02:00
parent 07e58631a5
commit 5ef522ed8f
No known key found for this signature in database
GPG Key ID: 4F25D016D9D6A8AF
14 changed files with 80 additions and 72 deletions

View File

@ -2113,7 +2113,8 @@ DECLSPEC u32 parse_public (secp256k1_t *r, const u32 *k)
* Set precomputed values of the basepoint g to a secp256k1 structure. * Set precomputed values of the basepoint g to a secp256k1 structure.
* @param r out: x and y coordinates. pre-computed points: (x1,y1,-y1),(x3,y3,-y3),(x5,y5,-y5),(x7,y7,-y7) * @param r out: x and y coordinates. pre-computed points: (x1,y1,-y1),(x3,y3,-y3),(x5,y5,-y5),(x7,y7,-y7)
*/ */
DECLSPEC void set_precomputed_basepoint_g (secp256k1_t *r) { DECLSPEC void set_precomputed_basepoint_g (secp256k1_t *r)
{
// x1 // x1
r->xy[ 0] = SECP256K1_G_PRE_COMPUTED_00; r->xy[ 0] = SECP256K1_G_PRE_COMPUTED_00;
r->xy[ 1] = SECP256K1_G_PRE_COMPUTED_01; r->xy[ 1] = SECP256K1_G_PRE_COMPUTED_01;

View File

@ -346,8 +346,11 @@ KERNEL_FQ void m25400_comp (KERN_ATTR_TMPS_ESALT (pdf14_tmp_t, pdf_t))
// the best comparison I can think of is checking each byte // the best comparison I can think of is checking each byte
// whether it's a padding byte or ASCII, if so we're good, // whether it's a padding byte or ASCII, if so we're good,
// if not, decryption was not successful // if not, decryption was not successful
bool correct = true; bool correct = true;
int i_padding=0; int i_padding=0;
for (int i = 0; i < 16; i++) for (int i = 0; i < 16; i++)
{ {
// cast out buffer to byte such that we can do a byte per byte comparison // cast out buffer to byte such that we can do a byte per byte comparison
@ -363,15 +366,18 @@ KERNEL_FQ void m25400_comp (KERN_ATTR_TMPS_ESALT (pdf14_tmp_t, pdf_t))
// we don't use the user-password in the attack now (as we don't need it), // we don't use the user-password in the attack now (as we don't need it),
// however we could use it in the comparison of the decrypted o-value, // however we could use it in the comparison of the decrypted o-value,
// yet it may make this attack a bit more fragile, as now we just check for ASCII // yet it may make this attack a bit more fragile, as now we just check for ASCII
if((u8OutBufPtr[i] >=20 && u8OutBufPtr[i] <= 0x7e) || u8OutBufPtr[i]==u8OutPadPtr[i_padding]) if ((u8OutBufPtr[i] >= 20 && u8OutBufPtr[i] <= 0x7e) ||
(u8OutBufPtr[i] == u8OutPadPtr[i_padding]))
{
if (u8OutBufPtr[i] == u8OutPadPtr[i_padding])
{ {
if(u8OutBufPtr[i]==u8OutPadPtr[i_padding]) {
//printf("correct padding byte[%d]=0x%02x\n", i, u8OutBufPtr[i]); //printf("correct padding byte[%d]=0x%02x\n", i, u8OutBufPtr[i]);
i_padding = i_padding + 1; i_padding = i_padding + 1;
} }
else else
{ {
if(u8OutBufPtr[i] >=20 && u8OutBufPtr[i] <= 0x7e) { if (u8OutBufPtr[i] >= 20 && u8OutBufPtr[i] <= 0x7e)
{
//printf("correct ASCII byte[%d]=0x%02x\n", i, u8OutBufPtr[i]); //printf("correct ASCII byte[%d]=0x%02x\n", i, u8OutBufPtr[i]);
} }
} }
@ -400,6 +406,7 @@ KERNEL_FQ void m25400_comp (KERN_ATTR_TMPS_ESALT (pdf14_tmp_t, pdf_t))
if (correct) if (correct)
{ {
int digest_pos = find_hash (digest, digests_cnt, &digests_buf[DIGESTS_OFFSET]); int digest_pos = find_hash (digest, digests_cnt, &digests_buf[DIGESTS_OFFSET]);
if (digest_pos != -1) if (digest_pos != -1)
{ {
const u32 final_hash_pos = DIGESTS_OFFSET + digest_pos; const u32 final_hash_pos = DIGESTS_OFFSET + digest_pos;