RTEMS-6
Annotated Report
libcrypt
Sun Feb 28 23:59:37 2021
00105824 <_crypt_b64_from_24bit>:
{
uint32_t w;
int i;
#if defined(__rtems__)
w = ((uint32_t)B2 << 16) | ((uint32_t)B1 << 8) | B0;
105824: ea42 2201 orr.w r2, r2, r1, lsl #8
#else
w = (B2 << 16) | (B1 << 8) | B0;
#endif
for (i = 0; i < n; i++) {
105828: f1b3 0c00 subs.w ip, r3, #0
{
10582c: b570 push {r4, r5, r6, lr}
w = ((uint32_t)B2 << 16) | ((uint32_t)B1 << 8) | B0;
10582e: ea42 4000 orr.w r0, r2, r0, lsl #16
{
105832: e9dd 5404 ldrd r5, r4, [sp, #16]
for (i = 0; i < n; i++) {
105836: dd19 ble.n 10586c <_crypt_b64_from_24bit+0x48> <== ALWAYS TAKEN
105838: f649 4e18 movw lr, #39960 ; 0x9c18
**cp = itoa64[w&0x3f];
10583c: 6822 ldr r2, [r4, #0]
10583e: f2c0 0e11 movt lr, #17
for (i = 0; i < n; i++) {
105842: 2100 movs r1, #0
105844: e001 b.n 10584a <_crypt_b64_from_24bit+0x26>
105846: 458c cmp ip, r1
105848: d010 beq.n 10586c <_crypt_b64_from_24bit+0x48>
**cp = itoa64[w&0x3f];
10584a: f000 063f and.w r6, r0, #63 ; 0x3f
for (i = 0; i < n; i++) {
10584e: 3101 adds r1, #1
**cp = itoa64[w&0x3f];
105850: f81e 6006 ldrb.w r6, [lr, r6]
(*cp)++;
if ((*buflen)-- < 0)
break;
w >>= 6;
105854: 0980 lsrs r0, r0, #6
**cp = itoa64[w&0x3f];
105856: 7016 strb r6, [r2, #0]
if ((*buflen)-- < 0)
105858: 682b ldr r3, [r5, #0]
(*cp)++;
10585a: 6822 ldr r2, [r4, #0]
if ((*buflen)-- < 0)
10585c: 2b00 cmp r3, #0
10585e: f103 36ff add.w r6, r3, #4294967295 ; 0xffffffff
(*cp)++;
105862: f102 0201 add.w r2, r2, #1
105866: 6022 str r2, [r4, #0]
if ((*buflen)-- < 0)
105868: 602e str r6, [r5, #0]
10586a: daec bge.n 105846 <_crypt_b64_from_24bit+0x22> <== NEVER TAKEN
}
}
10586c: bd70 pop {r4, r5, r6, pc}
10586e: bf00 nop
00105800 <_crypt_to64>:
"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
void
_crypt_to64(char *s, u_long v, int n)
{
while (--n >= 0) {
105800: 2a00 cmp r2, #0
105802: dd0d ble.n 105820 <_crypt_to64+0x20> <== ALWAYS TAKEN
105804: f649 4c18 movw ip, #39960 ; 0x9c18
105808: 4402 add r2, r0
10580a: f2c0 0c11 movt ip, #17
*s++ = itoa64[v&0x3f];
10580e: f001 033f and.w r3, r1, #63 ; 0x3f
v >>= 6;
105812: 0989 lsrs r1, r1, #6
*s++ = itoa64[v&0x3f];
105814: f81c 3003 ldrb.w r3, [ip, r3]
105818: f800 3b01 strb.w r3, [r0], #1
while (--n >= 0) {
10581c: 4282 cmp r2, r0
10581e: d1f6 bne.n 10580e <_crypt_to64+0xe>
}
}
105820: 4770 bx lr
105822: bf00 nop
00104960 <crypt_add_format>:
&cf_default
};
void crypt_add_format(struct crypt_format *cf)
{
if (cf->link.sle_next == NULL)
104960: 6803 ldr r3, [r0, #0]
104962: b103 cbz r3, 104966 <crypt_add_format+0x6>
SLIST_INSERT_HEAD(&cf_head, cf, link);
}
104964: 4770 bx lr <== NOT EXECUTED
SLIST_INSERT_HEAD(&cf_head, cf, link);
104966: f240 0388 movw r3, #136 ; 0x88
10496a: f2c0 0320 movt r3, #32
10496e: 681a ldr r2, [r3, #0]
104970: 6018 str r0, [r3, #0]
104972: 6002 str r2, [r0, #0]
}
104974: 4770 bx lr
104976: bf00 nop
001049c0 <crypt_md5_r>:
* UNIX password
*/
char *
crypt_md5_r(const char *pw, const char *salt, struct crypt_data *data)
{
1049c0: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
1049c4: b0bb sub sp, #236 ; 0xec
/* Refine the Salt first */
sp = salt;
/* If it starts with the magic string, then skip that */
if(!strncmp(sp, magic, strlen(magic)))
1049c6: 780b ldrb r3, [r1, #0]
{
1049c8: 468b mov fp, r1
1049ca: 4605 mov r5, r0
1049cc: 9201 str r2, [sp, #4]
if(!strncmp(sp, magic, strlen(magic)))
1049ce: 2b24 cmp r3, #36 ; 0x24
1049d0: d103 bne.n 1049da <crypt_md5_r+0x1a> <== ALWAYS TAKEN
1049d2: 784b ldrb r3, [r1, #1]
1049d4: 2b31 cmp r3, #49 ; 0x31
1049d6: f000 8149 beq.w 104c6c <crypt_md5_r+0x2ac> <== NEVER TAKEN
sp += strlen(magic);
/* It stops at the first '$', max 8 chars */
for(ep = sp; *ep && *ep != '$' && ep < (sp + 8); ep++)
1049da: f89b a000 ldrb.w sl, [fp]
1049de: f1ba 0f24 cmp.w sl, #36 ; 0x24
1049e2: bf18 it ne
1049e4: f1ba 0f00 cmpne.w sl, #0
1049e8: bf14 ite ne
1049ea: f04f 0a01 movne.w sl, #1
1049ee: f04f 0a00 moveq.w sl, #0
1049f2: d00c beq.n 104a0e <crypt_md5_r+0x4e> <== ALWAYS TAKEN
1049f4: f10b 0208 add.w r2, fp, #8
1049f8: 46da mov sl, fp
1049fa: f81a 3f01 ldrb.w r3, [sl, #1]!
1049fe: 2b00 cmp r3, #0
104a00: bf18 it ne
104a02: 2b24 cmpne r3, #36 ; 0x24
104a04: d001 beq.n 104a0a <crypt_md5_r+0x4a>
104a06: 4592 cmp sl, r2
104a08: d1f7 bne.n 1049fa <crypt_md5_r+0x3a> <== NEVER TAKEN
continue;
/* get the length of the true salt */
sl = ep - sp;
104a0a: ebaa 0a0b sub.w sl, sl, fp
MD5Init(&ctx);
104a0e: a806 add r0, sp, #24
104a10: f003 f8f6 bl 107c00 <MD5Init>
/* The password first, since that is what is most unknown */
MD5Update(&ctx, (const u_char *)pw, strlen(pw));
104a14: 4628 mov r0, r5
104a16: f010 fbd3 bl 1151c0 <strlen>
104a1a: 4629 mov r1, r5
104a1c: 4602 mov r2, r0
104a1e: a806 add r0, sp, #24
104a20: f003 f908 bl 107c34 <MD5Update>
/* Then our magic string */
MD5Update(&ctx, (const u_char *)magic, strlen(magic));
104a24: f649 31ec movw r1, #39916 ; 0x9bec
104a28: 2203 movs r2, #3
104a2a: f2c0 0111 movt r1, #17
104a2e: a806 add r0, sp, #24
104a30: f003 f900 bl 107c34 <MD5Update>
/* Then the raw salt */
MD5Update(&ctx, (const u_char *)sp, (u_int)sl);
104a34: 4652 mov r2, sl
104a36: 4659 mov r1, fp
104a38: a806 add r0, sp, #24
104a3a: f003 f8fb bl 107c34 <MD5Update>
/* Then just as many characters of the MD5(pw,salt,pw) */
MD5Init(&ctx1);
104a3e: a820 add r0, sp, #128 ; 0x80
104a40: f003 f8de bl 107c00 <MD5Init>
MD5Update(&ctx1, (const u_char *)pw, strlen(pw));
104a44: 4628 mov r0, r5
104a46: f010 fbbb bl 1151c0 <strlen>
104a4a: 4629 mov r1, r5
104a4c: 4602 mov r2, r0
104a4e: a820 add r0, sp, #128 ; 0x80
104a50: f003 f8f0 bl 107c34 <MD5Update>
MD5Update(&ctx1, (const u_char *)sp, (u_int)sl);
104a54: 4652 mov r2, sl
104a56: 4659 mov r1, fp
104a58: a820 add r0, sp, #128 ; 0x80
104a5a: f003 f8eb bl 107c34 <MD5Update>
MD5Update(&ctx1, (const u_char *)pw, strlen(pw));
104a5e: 4628 mov r0, r5
104a60: f010 fbae bl 1151c0 <strlen>
104a64: 4629 mov r1, r5
104a66: 4602 mov r2, r0
104a68: a820 add r0, sp, #128 ; 0x80
104a6a: f003 f8e3 bl 107c34 <MD5Update>
MD5Final(final, &ctx1);
104a6e: a920 add r1, sp, #128 ; 0x80
104a70: a802 add r0, sp, #8
104a72: f003 f923 bl 107cbc <MD5Final>
for(pl = (int)strlen(pw); pl > 0; pl -= MD5_SIZE)
104a76: 4628 mov r0, r5
104a78: f010 fba2 bl 1151c0 <strlen>
104a7c: 1e43 subs r3, r0, #1
104a7e: f1a0 0610 sub.w r6, r0, #16
104a82: f023 030f bic.w r3, r3, #15
104a86: 4604 mov r4, r0
104a88: 1af6 subs r6, r6, r3
104a8a: b150 cbz r0, 104aa2 <crypt_md5_r+0xe2>
MD5Update(&ctx, (const u_char *)final,
104a8c: 2c10 cmp r4, #16
104a8e: 4622 mov r2, r4
104a90: a902 add r1, sp, #8
104a92: bfa8 it ge
104a94: 2210 movge r2, #16
104a96: a806 add r0, sp, #24
for(pl = (int)strlen(pw); pl > 0; pl -= MD5_SIZE)
104a98: 3c10 subs r4, #16
MD5Update(&ctx, (const u_char *)final,
104a9a: f003 f8cb bl 107c34 <MD5Update>
for(pl = (int)strlen(pw); pl > 0; pl -= MD5_SIZE)
104a9e: 42b4 cmp r4, r6
104aa0: d1f4 bne.n 104a8c <crypt_md5_r+0xcc> <== ALWAYS TAKEN
(u_int)(pl > MD5_SIZE ? MD5_SIZE : pl));
/* Don't leave anything around in vm they could use. */
memset(final, 0, sizeof(final));
104aa2: 2300 movs r3, #0
/* Then something really weird... */
for (i = strlen(pw); i; i >>= 1)
104aa4: 4628 mov r0, r5
memset(final, 0, sizeof(final));
104aa6: e9cd 3302 strd r3, r3, [sp, #8]
104aaa: e9cd 3304 strd r3, r3, [sp, #16]
for (i = strlen(pw); i; i >>= 1)
104aae: f010 fb87 bl 1151c0 <strlen>
104ab2: 4604 mov r4, r0
104ab4: b168 cbz r0, 104ad2 <crypt_md5_r+0x112>
if(i & 1)
104ab6: f014 0f01 tst.w r4, #1
MD5Update(&ctx, (const u_char *)final, 1);
104aba: f04f 0201 mov.w r2, #1
104abe: a902 add r1, sp, #8
104ac0: a806 add r0, sp, #24
else
MD5Update(&ctx, (const u_char *)pw, 1);
104ac2: bf02 ittt eq
104ac4: 2201 moveq r2, #1
104ac6: 4629 moveq r1, r5
104ac8: a806 addeq r0, sp, #24
104aca: f003 f8b3 bl 107c34 <MD5Update>
for (i = strlen(pw); i; i >>= 1)
104ace: 0864 lsrs r4, r4, #1
104ad0: d1f1 bne.n 104ab6 <crypt_md5_r+0xf6>
/* Now make the output string */
strcpy(passwd, magic);
104ad2: f649 33e8 movw r3, #39912 ; 0x9be8
104ad6: 9c01 ldr r4, [sp, #4]
104ad8: f2c0 0311 movt r3, #17
strncat(passwd, sp, (u_int)sl);
104adc: 4652 mov r2, sl
strcpy(passwd, magic);
104ade: 6818 ldr r0, [r3, #0]
strncat(passwd, sp, (u_int)sl);
104ae0: 4659 mov r1, fp
for(i = 0; i < 1000; i++) {
MD5Init(&ctx1);
if(i & 1)
MD5Update(&ctx1, (const u_char *)pw, strlen(pw));
else
MD5Update(&ctx1, (const u_char *)final, MD5_SIZE);
104ae2: f64a 29ab movw r9, #43691 ; 0xaaab
if(i % 3)
MD5Update(&ctx1, (const u_char *)sp, (u_int)sl);
104ae6: f646 58b7 movw r8, #28087 ; 0x6db7
if(i % 7)
104aea: f644 1724 movw r7, #18724 ; 0x4924
MD5Update(&ctx1, (const u_char *)final, MD5_SIZE);
104aee: f6ca 29aa movt r9, #43690 ; 0xaaaa
strcpy(passwd, magic);
104af2: 6020 str r0, [r4, #0]
strncat(passwd, sp, (u_int)sl);
104af4: 4620 mov r0, r4
104af6: f010 fbd1 bl 11529c <strncat>
strcat(passwd, "$");
104afa: 4620 mov r0, r4
MD5Update(&ctx1, (const u_char *)sp, (u_int)sl);
104afc: f2cb 68db movt r8, #46811 ; 0xb6db
strcat(passwd, "$");
104b00: f010 fb5e bl 1151c0 <strlen>
104b04: f649 33e4 movw r3, #39908 ; 0x9be4
if(i % 7)
104b08: f2c2 4792 movt r7, #9362 ; 0x2492
strcat(passwd, "$");
104b0c: f2c0 0311 movt r3, #17
MD5Final(final, &ctx);
104b10: a906 add r1, sp, #24
strcat(passwd, "$");
104b12: 881b ldrh r3, [r3, #0]
104b14: 5223 strh r3, [r4, r0]
for(i = 0; i < 1000; i++) {
104b16: 2400 movs r4, #0
MD5Final(final, &ctx);
104b18: a802 add r0, sp, #8
104b1a: f003 f8cf bl 107cbc <MD5Final>
MD5Init(&ctx1);
104b1e: a820 add r0, sp, #128 ; 0x80
104b20: f003 f86e bl 107c00 <MD5Init>
if(i & 1)
104b24: f014 0601 ands.w r6, r4, #1
104b28: f000 808f beq.w 104c4a <crypt_md5_r+0x28a>
MD5Update(&ctx1, (const u_char *)pw, strlen(pw));
104b2c: 4628 mov r0, r5
104b2e: f010 fb47 bl 1151c0 <strlen>
104b32: 4629 mov r1, r5
104b34: 4602 mov r2, r0
104b36: a820 add r0, sp, #128 ; 0x80
104b38: f003 f87c bl 107c34 <MD5Update>
MD5Update(&ctx1, (const u_char *)final, MD5_SIZE);
104b3c: fb09 f304 mul.w r3, r9, r4
if(i % 3)
104b40: f1b3 3f55 cmp.w r3, #1431655765 ; 0x55555555
104b44: f200 808c bhi.w 104c60 <crypt_md5_r+0x2a0>
MD5Update(&ctx1, (const u_char *)sp, (u_int)sl);
104b48: fb08 f304 mul.w r3, r8, r4
if(i % 7)
104b4c: 42bb cmp r3, r7
104b4e: d869 bhi.n 104c24 <crypt_md5_r+0x264>
MD5Update(&ctx1, (const u_char *)pw, strlen(pw));
if(i & 1)
104b50: 2e00 cmp r6, #0
104b52: d071 beq.n 104c38 <crypt_md5_r+0x278>
MD5Update(&ctx1, (const u_char *)final, MD5_SIZE);
104b54: 2210 movs r2, #16
104b56: a902 add r1, sp, #8
104b58: a820 add r0, sp, #128 ; 0x80
104b5a: f003 f86b bl 107c34 <MD5Update>
else
MD5Update(&ctx1, (const u_char *)pw, strlen(pw));
MD5Final(final, &ctx1);
104b5e: a920 add r1, sp, #128 ; 0x80
104b60: a802 add r0, sp, #8
for(i = 0; i < 1000; i++) {
104b62: 3401 adds r4, #1
MD5Final(final, &ctx1);
104b64: f003 f8aa bl 107cbc <MD5Final>
for(i = 0; i < 1000; i++) {
104b68: f5b4 7f7a cmp.w r4, #1000 ; 0x3e8
104b6c: d1d7 bne.n 104b1e <crypt_md5_r+0x15e>
}
p = passwd + strlen(passwd);
104b6e: 9d01 ldr r5, [sp, #4]
104b70: 4628 mov r0, r5
104b72: f010 fb25 bl 1151c0 <strlen>
l = (final[ 0]<<16) | (final[ 6]<<8) | final[12];
104b76: f89d 300e ldrb.w r3, [sp, #14]
p = passwd + strlen(passwd);
104b7a: 182c adds r4, r5, r0
l = (final[ 0]<<16) | (final[ 6]<<8) | final[12];
104b7c: f89d 2008 ldrb.w r2, [sp, #8]
_crypt_to64(p, l, 4); p += 4;
104b80: 4620 mov r0, r4
l = (final[ 0]<<16) | (final[ 6]<<8) | final[12];
104b82: f89d 1014 ldrb.w r1, [sp, #20]
104b86: 021b lsls r3, r3, #8
104b88: ea43 4302 orr.w r3, r3, r2, lsl #16
_crypt_to64(p, l, 4); p += 4;
104b8c: 2204 movs r2, #4
104b8e: 4319 orrs r1, r3
104b90: f000 fe36 bl 105800 <_crypt_to64>
l = (final[ 1]<<16) | (final[ 7]<<8) | final[13];
104b94: f89d 300f ldrb.w r3, [sp, #15]
_crypt_to64(p, l, 4); p += 4;
104b98: 1d20 adds r0, r4, #4
l = (final[ 1]<<16) | (final[ 7]<<8) | final[13];
104b9a: f89d 2009 ldrb.w r2, [sp, #9]
104b9e: f89d 1015 ldrb.w r1, [sp, #21]
104ba2: 021b lsls r3, r3, #8
104ba4: ea43 4302 orr.w r3, r3, r2, lsl #16
_crypt_to64(p, l, 4); p += 4;
104ba8: 2204 movs r2, #4
104baa: 4319 orrs r1, r3
104bac: f000 fe28 bl 105800 <_crypt_to64>
l = (final[ 2]<<16) | (final[ 8]<<8) | final[14];
104bb0: f89d 3010 ldrb.w r3, [sp, #16]
_crypt_to64(p, l, 4); p += 4;
104bb4: f104 0008 add.w r0, r4, #8
l = (final[ 2]<<16) | (final[ 8]<<8) | final[14];
104bb8: f89d 200a ldrb.w r2, [sp, #10]
104bbc: f89d 1016 ldrb.w r1, [sp, #22]
104bc0: 021b lsls r3, r3, #8
104bc2: ea43 4302 orr.w r3, r3, r2, lsl #16
_crypt_to64(p, l, 4); p += 4;
104bc6: 2204 movs r2, #4
104bc8: 4319 orrs r1, r3
104bca: f000 fe19 bl 105800 <_crypt_to64>
l = (final[ 3]<<16) | (final[ 9]<<8) | final[15];
104bce: f89d 3011 ldrb.w r3, [sp, #17]
_crypt_to64(p, l, 4); p += 4;
104bd2: f104 000c add.w r0, r4, #12
l = (final[ 3]<<16) | (final[ 9]<<8) | final[15];
104bd6: f89d 200b ldrb.w r2, [sp, #11]
104bda: f89d 1017 ldrb.w r1, [sp, #23]
104bde: 021b lsls r3, r3, #8
104be0: ea43 4302 orr.w r3, r3, r2, lsl #16
_crypt_to64(p, l, 4); p += 4;
104be4: 2204 movs r2, #4
104be6: 4319 orrs r1, r3
104be8: f000 fe0a bl 105800 <_crypt_to64>
l = (final[ 4]<<16) | (final[10]<<8) | final[ 5];
104bec: f89d 3012 ldrb.w r3, [sp, #18]
_crypt_to64(p, l, 4); p += 4;
104bf0: f104 0010 add.w r0, r4, #16
l = (final[ 4]<<16) | (final[10]<<8) | final[ 5];
104bf4: f89d 200c ldrb.w r2, [sp, #12]
104bf8: f89d 100d ldrb.w r1, [sp, #13]
104bfc: 021b lsls r3, r3, #8
104bfe: ea43 4302 orr.w r3, r3, r2, lsl #16
_crypt_to64(p, l, 4); p += 4;
104c02: 2204 movs r2, #4
104c04: 4319 orrs r1, r3
104c06: f000 fdfb bl 105800 <_crypt_to64>
l = final[11];
_crypt_to64(p, l, 2); p += 2;
104c0a: f104 0014 add.w r0, r4, #20
104c0e: f89d 1013 ldrb.w r1, [sp, #19]
104c12: 2202 movs r2, #2
104c14: f000 fdf4 bl 105800 <_crypt_to64>
*p = '\0';
104c18: 2300 movs r3, #0
/* Don't leave anything around in vm they could use. */
memset(final, 0, sizeof(final));
return (passwd);
}
104c1a: 4628 mov r0, r5
*p = '\0';
104c1c: 75a3 strb r3, [r4, #22]
}
104c1e: b03b add sp, #236 ; 0xec
104c20: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
MD5Update(&ctx1, (const u_char *)pw, strlen(pw));
104c24: 4628 mov r0, r5
104c26: f010 facb bl 1151c0 <strlen>
104c2a: 4629 mov r1, r5
104c2c: 4602 mov r2, r0
104c2e: a820 add r0, sp, #128 ; 0x80
104c30: f003 f800 bl 107c34 <MD5Update>
if(i & 1)
104c34: 2e00 cmp r6, #0
104c36: d18d bne.n 104b54 <crypt_md5_r+0x194>
MD5Update(&ctx1, (const u_char *)pw, strlen(pw));
104c38: 4628 mov r0, r5
104c3a: f010 fac1 bl 1151c0 <strlen>
104c3e: 4629 mov r1, r5
104c40: 4602 mov r2, r0
104c42: a820 add r0, sp, #128 ; 0x80
104c44: f002 fff6 bl 107c34 <MD5Update>
104c48: e789 b.n 104b5e <crypt_md5_r+0x19e>
MD5Update(&ctx1, (const u_char *)final, MD5_SIZE);
104c4a: 2210 movs r2, #16
104c4c: a902 add r1, sp, #8
104c4e: a820 add r0, sp, #128 ; 0x80
104c50: f002 fff0 bl 107c34 <MD5Update>
104c54: fb09 f304 mul.w r3, r9, r4
if(i % 3)
104c58: f1b3 3f55 cmp.w r3, #1431655765 ; 0x55555555
104c5c: f67f af74 bls.w 104b48 <crypt_md5_r+0x188>
MD5Update(&ctx1, (const u_char *)sp, (u_int)sl);
104c60: 4652 mov r2, sl
104c62: 4659 mov r1, fp
104c64: a820 add r0, sp, #128 ; 0x80
104c66: f002 ffe5 bl 107c34 <MD5Update>
104c6a: e76d b.n 104b48 <crypt_md5_r+0x188>
if(!strncmp(sp, magic, strlen(magic)))
104c6c: 788b ldrb r3, [r1, #2]
104c6e: 2b24 cmp r3, #36 ; 0x24
sp += strlen(magic);
104c70: bf08 it eq
104c72: f101 0b03 addeq.w fp, r1, #3
104c76: e6b0 b.n 1049da <crypt_md5_r+0x1a>
00104c78 <crypt_sha256_r>:
/* Maximum number of rounds. */
#define ROUNDS_MAX 999999999
char *
crypt_sha256_r(const char *key, const char *salt, struct crypt_data *data)
{
104c78: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
104c7c: b0d5 sub sp, #340 ; 0x154
rounds = ROUNDS_DEFAULT;
rounds_custom = false;
/* Find beginning of salt string. The prefix should normally always
* be present. Just in case it is not. */
if (strncmp(sha256_salt_prefix, salt, sizeof(sha256_salt_prefix) - 1) == 0)
104c7e: 780b ldrb r3, [r1, #0]
{
104c80: af02 add r7, sp, #8
104c82: 4688 mov r8, r1
int buflen = (int)sizeof(data->buffer);
104c84: f44f 7180 mov.w r1, #256 ; 0x100
{
104c88: 4605 mov r5, r0
if (strncmp(sha256_salt_prefix, salt, sizeof(sha256_salt_prefix) - 1) == 0)
104c8a: 2b24 cmp r3, #36 ; 0x24
int buflen = (int)sizeof(data->buffer);
104c8c: 6379 str r1, [r7, #52] ; 0x34
{
104c8e: 61ba str r2, [r7, #24]
if (strncmp(sha256_salt_prefix, salt, sizeof(sha256_salt_prefix) - 1) == 0)
104c90: d104 bne.n 104c9c <crypt_sha256_r+0x24> <== ALWAYS TAKEN
104c92: f898 3001 ldrb.w r3, [r8, #1]
104c96: 2b35 cmp r3, #53 ; 0x35
104c98: f000 8224 beq.w 1050e4 <crypt_sha256_r+0x46c> <== NEVER TAKEN
/* Skip salt prefix. */
salt += sizeof(sha256_salt_prefix) - 1;
if (strncmp(salt, sha256_rounds_prefix, sizeof(sha256_rounds_prefix) - 1)
104c9c: f649 31fc movw r1, #39932 ; 0x9bfc
104ca0: 2207 movs r2, #7
104ca2: f2c0 0111 movt r1, #17
104ca6: 4640 mov r0, r8
104ca8: f010 fb26 bl 1152f8 <strncmp>
104cac: 4604 mov r4, r0
104cae: 2800 cmp r0, #0
104cb0: f000 8235 beq.w 10511e <crypt_sha256_r+0x4a6>
rounds_custom = false;
104cb4: 2300 movs r3, #0
104cb6: 607b str r3, [r7, #4]
rounds = ROUNDS_DEFAULT;
104cb8: f241 3388 movw r3, #5000 ; 0x1388
104cbc: 627b str r3, [r7, #36] ; 0x24
rounds = MAX(ROUNDS_MIN, MIN(srounds, ROUNDS_MAX));
rounds_custom = true;
}
}
salt_len = MIN(strcspn(salt, "$"), SALT_LEN_MAX);
104cbe: f649 31e4 movw r1, #39908 ; 0x9be4
104cc2: 4640 mov r0, r8
104cc4: f2c0 0111 movt r1, #17
104cc8: f010 fa2a bl 115120 <strcspn>
104ccc: 2810 cmp r0, #16
104cce: bf28 it cs
104cd0: 2010 movcs r0, #16
104cd2: 4606 mov r6, r0
key_len = strlen(key);
104cd4: 4628 mov r0, r5
104cd6: f010 fa73 bl 1151c0 <strlen>
104cda: 4604 mov r4, r0
/* Prepare for the real work. */
SHA256_Init(&ctx);
104cdc: f107 0078 add.w r0, r7, #120 ; 0x78
104ce0: f004 f9cc bl 10907c <SHA256_Init>
/* Add the key string. */
SHA256_Update(&ctx, key, key_len);
104ce4: 4622 mov r2, r4
104ce6: 4629 mov r1, r5
104ce8: f107 0078 add.w r0, r7, #120 ; 0x78
104cec: f004 f9f6 bl 1090dc <SHA256_Update>
/* The last part is the salt string. This must be at most 8
* characters and it ends at the first `$' character (for
* compatibility with existing implementations). */
SHA256_Update(&ctx, salt, salt_len);
104cf0: 4632 mov r2, r6
104cf2: 4641 mov r1, r8
104cf4: f107 0078 add.w r0, r7, #120 ; 0x78
104cf8: f004 f9f0 bl 1090dc <SHA256_Update>
/* Compute alternate SHA256 sum with input KEY, SALT, and KEY. The
* final result will be added to the first context. */
SHA256_Init(&alt_ctx);
104cfc: f107 00e0 add.w r0, r7, #224 ; 0xe0
104d00: f004 f9bc bl 10907c <SHA256_Init>
/* Add key. */
SHA256_Update(&alt_ctx, key, key_len);
104d04: 4622 mov r2, r4
104d06: 4629 mov r1, r5
104d08: f107 00e0 add.w r0, r7, #224 ; 0xe0
104d0c: f004 f9e6 bl 1090dc <SHA256_Update>
/* Add salt. */
SHA256_Update(&alt_ctx, salt, salt_len);
104d10: 4632 mov r2, r6
104d12: 4641 mov r1, r8
104d14: f107 00e0 add.w r0, r7, #224 ; 0xe0
104d18: f004 f9e0 bl 1090dc <SHA256_Update>
/* Add key again. */
SHA256_Update(&alt_ctx, key, key_len);
104d1c: 4622 mov r2, r4
104d1e: 4629 mov r1, r5
104d20: f107 00e0 add.w r0, r7, #224 ; 0xe0
104d24: f004 f9da bl 1090dc <SHA256_Update>
/* Now get result of this (32 bytes) and add it to the other context. */
SHA256_Final(alt_result, &alt_ctx);
104d28: f107 01e0 add.w r1, r7, #224 ; 0xe0
104d2c: f107 0038 add.w r0, r7, #56 ; 0x38
104d30: f004 fa10 bl 109154 <SHA256_Final>
/* Add for any character in the key one byte of the alternate sum. */
for (cnt = key_len; cnt > 32; cnt -= 32)
104d34: 2c20 cmp r4, #32
104d36: f240 821d bls.w 105174 <crypt_sha256_r+0x4fc>
104d3a: 46a1 mov r9, r4
SHA256_Update(&ctx, alt_result, 32);
104d3c: 2220 movs r2, #32
104d3e: f107 0138 add.w r1, r7, #56 ; 0x38
for (cnt = key_len; cnt > 32; cnt -= 32)
104d42: f1a9 0920 sub.w r9, r9, #32
SHA256_Update(&ctx, alt_result, 32);
104d46: f107 0078 add.w r0, r7, #120 ; 0x78
104d4a: f004 f9c7 bl 1090dc <SHA256_Update>
for (cnt = key_len; cnt > 32; cnt -= 32)
104d4e: f1b9 0f20 cmp.w r9, #32
104d52: d8f3 bhi.n 104d3c <crypt_sha256_r+0xc4>
104d54: f1a4 0321 sub.w r3, r4, #33 ; 0x21
104d58: f1a4 0220 sub.w r2, r4, #32
104d5c: f023 031f bic.w r3, r3, #31
SHA256_Update(&ctx, alt_result, cnt);
104d60: f107 0138 add.w r1, r7, #56 ; 0x38
104d64: 1ad2 subs r2, r2, r3
104d66: f107 0078 add.w r0, r7, #120 ; 0x78
104d6a: f004 f9b7 bl 1090dc <SHA256_Update>
key_len = strlen(key);
104d6e: 46a1 mov r9, r4
/* Take the binary representation of the length of the key and for
* every 1 add the alternate sum, for every 0 the key. */
for (cnt = key_len; cnt > 0; cnt >>= 1)
if ((cnt & 1) != 0)
104d70: f019 0f01 tst.w r9, #1
SHA256_Update(&ctx, alt_result, 32);
104d74: f04f 0220 mov.w r2, #32
104d78: f107 0138 add.w r1, r7, #56 ; 0x38
104d7c: f107 0078 add.w r0, r7, #120 ; 0x78
else
SHA256_Update(&ctx, key, key_len);
104d80: bf02 ittt eq
104d82: 4622 moveq r2, r4
104d84: 4629 moveq r1, r5
104d86: f107 0078 addeq.w r0, r7, #120 ; 0x78
104d8a: f004 f9a7 bl 1090dc <SHA256_Update>
for (cnt = key_len; cnt > 0; cnt >>= 1)
104d8e: ea5f 0959 movs.w r9, r9, lsr #1
104d92: d1ed bne.n 104d70 <crypt_sha256_r+0xf8>
/* Create intermediate result. */
SHA256_Final(alt_result, &ctx);
104d94: f107 0038 add.w r0, r7, #56 ; 0x38
104d98: f107 0178 add.w r1, r7, #120 ; 0x78
104d9c: f004 f9da bl 109154 <SHA256_Final>
/* Start computation of P byte sequence. */
SHA256_Init(&alt_ctx);
104da0: f107 00e0 add.w r0, r7, #224 ; 0xe0
104da4: f004 f96a bl 10907c <SHA256_Init>
/* For every character in the password add the entire password. */
for (cnt = 0; cnt < key_len; ++cnt)
SHA256_Update(&alt_ctx, key, key_len);
104da8: 4622 mov r2, r4
104daa: 4629 mov r1, r5
for (cnt = 0; cnt < key_len; ++cnt)
104dac: f109 0901 add.w r9, r9, #1
SHA256_Update(&alt_ctx, key, key_len);
104db0: f107 00e0 add.w r0, r7, #224 ; 0xe0
104db4: f004 f992 bl 1090dc <SHA256_Update>
for (cnt = 0; cnt < key_len; ++cnt)
104db8: 454c cmp r4, r9
104dba: d8f5 bhi.n 104da8 <crypt_sha256_r+0x130>
/* Finish the digest. */
SHA256_Final(temp_result, &alt_ctx);
104dbc: f107 0958 add.w r9, r7, #88 ; 0x58
104dc0: f107 01e0 add.w r1, r7, #224 ; 0xe0
104dc4: 4648 mov r0, r9
/* Create byte sequence P. */
cp = p_bytes = alloca(key_len);
104dc6: f107 052c add.w r5, r7, #44 ; 0x2c
SHA256_Final(temp_result, &alt_ctx);
104dca: f004 f9c3 bl 109154 <SHA256_Final>
cp = p_bytes = alloca(key_len);
104dce: 1de3 adds r3, r4, #7
for (cnt = key_len; cnt >= 32; cnt -= 32) {
104dd0: 2c1f cmp r4, #31
cp = p_bytes = alloca(key_len);
104dd2: f023 0307 bic.w r3, r3, #7
104dd6: ebad 0d03 sub.w sp, sp, r3
104dda: f10d 0b08 add.w fp, sp, #8
for (cnt = key_len; cnt >= 32; cnt -= 32) {
104dde: 46de mov lr, fp
cp = p_bytes = alloca(key_len);
104de0: f8c5 b000 str.w fp, [r5]
for (cnt = key_len; cnt >= 32; cnt -= 32) {
104de4: f240 81ea bls.w 1051bc <crypt_sha256_r+0x544>
104de8: 46a2 mov sl, r4
104dea: 46a4 mov ip, r4
104dec: 46b6 mov lr, r6
104dee: 465c mov r4, fp
memcpy(cp, temp_result, 32);
104df0: 464e mov r6, r9
for (cnt = key_len; cnt >= 32; cnt -= 32) {
104df2: f1aa 0a20 sub.w sl, sl, #32
memcpy(cp, temp_result, 32);
104df6: ce0f ldmia r6!, {r0, r1, r2, r3}
for (cnt = key_len; cnt >= 32; cnt -= 32) {
104df8: f1ba 0f1f cmp.w sl, #31
memcpy(cp, temp_result, 32);
104dfc: 6020 str r0, [r4, #0]
104dfe: 6061 str r1, [r4, #4]
104e00: 60a2 str r2, [r4, #8]
104e02: 60e3 str r3, [r4, #12]
104e04: ce0f ldmia r6!, {r0, r1, r2, r3}
104e06: 61e3 str r3, [r4, #28]
cp += 32;
104e08: 682b ldr r3, [r5, #0]
memcpy(cp, temp_result, 32);
104e0a: 6120 str r0, [r4, #16]
104e0c: 6161 str r1, [r4, #20]
104e0e: 61a2 str r2, [r4, #24]
cp += 32;
104e10: f103 0420 add.w r4, r3, #32
104e14: 602c str r4, [r5, #0]
for (cnt = key_len; cnt >= 32; cnt -= 32) {
104e16: d8eb bhi.n 104df0 <crypt_sha256_r+0x178>
104e18: 4676 mov r6, lr
104e1a: f00c 021f and.w r2, ip, #31
104e1e: 46a6 mov lr, r4
104e20: 4664 mov r4, ip
}
memcpy(cp, temp_result, cnt);
104e22: 4670 mov r0, lr
104e24: 4649 mov r1, r9
/* Start computation of S byte sequence. */
SHA256_Init(&alt_ctx);
/* For every character in the password add the entire password. */
for (cnt = 0; cnt < 16 + alt_result[0]; ++cnt)
104e26: f04f 0a00 mov.w sl, #0
memcpy(cp, temp_result, cnt);
104e2a: f00f ec0a blx 114640 <memcpy>
SHA256_Init(&alt_ctx);
104e2e: f107 00e0 add.w r0, r7, #224 ; 0xe0
104e32: f004 f923 bl 10907c <SHA256_Init>
SHA256_Update(&alt_ctx, salt, salt_len);
104e36: 4632 mov r2, r6
104e38: 4641 mov r1, r8
104e3a: f107 00e0 add.w r0, r7, #224 ; 0xe0
for (cnt = 0; cnt < 16 + alt_result[0]; ++cnt)
104e3e: f10a 0a01 add.w sl, sl, #1
SHA256_Update(&alt_ctx, salt, salt_len);
104e42: f004 f94b bl 1090dc <SHA256_Update>
for (cnt = 0; cnt < 16 + alt_result[0]; ++cnt)
104e46: f897 3038 ldrb.w r3, [r7, #56] ; 0x38
104e4a: 3310 adds r3, #16
104e4c: 4553 cmp r3, sl
104e4e: d8f2 bhi.n 104e36 <crypt_sha256_r+0x1be>
/* Finish the digest. */
SHA256_Final(temp_result, &alt_ctx);
104e50: 4648 mov r0, r9
104e52: f107 01e0 add.w r1, r7, #224 ; 0xe0
104e56: f004 f97d bl 109154 <SHA256_Final>
/* Create byte sequence S. */
cp = s_bytes = alloca(salt_len);
104e5a: 1df3 adds r3, r6, #7
else
SHA256_Update(&ctx, alt_result, 32);
/* Add salt for numbers not divisible by 3. */
if (cnt % 3 != 0)
SHA256_Update(&ctx, s_bytes, salt_len);
104e5c: f646 52b7 movw r2, #28087 ; 0x6db7
cp = s_bytes = alloca(salt_len);
104e60: f023 0307 bic.w r3, r3, #7
/* Add key for numbers not divisible by 7. */
if (cnt % 7 != 0)
104e64: f644 1024 movw r0, #18724 ; 0x4924
cp = s_bytes = alloca(salt_len);
104e68: ebad 0d03 sub.w sp, sp, r3
SHA256_Update(&ctx, s_bytes, salt_len);
104e6c: f2cb 62db movt r2, #46811 ; 0xb6db
cp = s_bytes = alloca(salt_len);
104e70: f10d 0c08 add.w ip, sp, #8
if (cnt % 7 != 0)
104e74: f2c2 4092 movt r0, #9362 ; 0x2492
SHA256_Update(&ctx, alt_result, 32);
104e78: f64a 23ab movw r3, #43691 ; 0xaaab
memcpy(cp, temp_result, cnt);
104e7c: 4649 mov r1, r9
SHA256_Update(&ctx, alt_result, 32);
104e7e: f6ca 23aa movt r3, #43690 ; 0xaaaa
SHA256_Update(&ctx, s_bytes, salt_len);
104e82: 613a str r2, [r7, #16]
if (cnt % 7 != 0)
104e84: 60f8 str r0, [r7, #12]
memcpy(cp, temp_result, cnt);
104e86: 4632 mov r2, r6
cp = s_bytes = alloca(salt_len);
104e88: 4660 mov r0, ip
SHA256_Update(&ctx, alt_result, 32);
104e8a: 617b str r3, [r7, #20]
cp = s_bytes = alloca(salt_len);
104e8c: f8c7 c01c str.w ip, [r7, #28]
for (cnt = 0; cnt < rounds; ++cnt) {
104e90: f04f 0900 mov.w r9, #0
cp = s_bytes = alloca(salt_len);
104e94: f8c5 c000 str.w ip, [r5]
memcpy(cp, temp_result, cnt);
104e98: f00f ebd2 blx 114640 <memcpy>
104e9c: f8d7 a00c ldr.w sl, [r7, #12]
104ea0: 623e str r6, [r7, #32]
104ea2: f8c7 8008 str.w r8, [r7, #8]
104ea6: e9d7 8604 ldrd r8, r6, [r7, #16]
104eaa: 617d str r5, [r7, #20]
SHA256_Init(&ctx);
104eac: f107 0078 add.w r0, r7, #120 ; 0x78
104eb0: f004 f8e4 bl 10907c <SHA256_Init>
if ((cnt & 1) != 0)
104eb4: f019 0501 ands.w r5, r9, #1
SHA256_Update(&ctx, alt_result, 32);
104eb8: f107 0078 add.w r0, r7, #120 ; 0x78
SHA256_Update(&ctx, p_bytes, key_len);
104ebc: bf19 ittee ne
104ebe: 4622 movne r2, r4
104ec0: 4659 movne r1, fp
SHA256_Update(&ctx, alt_result, 32);
104ec2: 2220 moveq r2, #32
104ec4: f107 0138 addeq.w r1, r7, #56 ; 0x38
104ec8: f004 f908 bl 1090dc <SHA256_Update>
104ecc: fb06 f309 mul.w r3, r6, r9
if (cnt % 3 != 0)
104ed0: f1b3 3f55 cmp.w r3, #1431655765 ; 0x55555555
104ed4: f200 80ff bhi.w 1050d6 <crypt_sha256_r+0x45e>
SHA256_Update(&ctx, s_bytes, salt_len);
104ed8: fb08 f309 mul.w r3, r8, r9
if (cnt % 7 != 0)
104edc: 4553 cmp r3, sl
104ede: f200 80ea bhi.w 1050b6 <crypt_sha256_r+0x43e>
SHA256_Update(&ctx, p_bytes, key_len);
/* Add key or last result. */
if ((cnt & 1) != 0)
104ee2: 2d00 cmp r5, #0
104ee4: f000 80f0 beq.w 1050c8 <crypt_sha256_r+0x450>
SHA256_Update(&ctx, alt_result, 32);
104ee8: 2220 movs r2, #32
104eea: f107 0138 add.w r1, r7, #56 ; 0x38
104eee: f107 0078 add.w r0, r7, #120 ; 0x78
104ef2: f004 f8f3 bl 1090dc <SHA256_Update>
else
SHA256_Update(&ctx, p_bytes, key_len);
/* Create intermediate result. */
SHA256_Final(alt_result, &ctx);
104ef6: f107 0178 add.w r1, r7, #120 ; 0x78
104efa: f107 0038 add.w r0, r7, #56 ; 0x38
104efe: f004 f929 bl 109154 <SHA256_Final>
for (cnt = 0; cnt < rounds; ++cnt) {
104f02: 6a7b ldr r3, [r7, #36] ; 0x24
104f04: f109 0901 add.w r9, r9, #1
104f08: 454b cmp r3, r9
104f0a: d1cf bne.n 104eac <crypt_sha256_r+0x234>
}
/* Now we can construct the result string. It consists of three
* parts. */
cp = stpncpy(buffer, sha256_salt_prefix, MAX(0, buflen));
104f0c: 6b7c ldr r4, [r7, #52] ; 0x34
104f0e: f649 4104 movw r1, #39940 ; 0x9c04
104f12: f2c0 0111 movt r1, #17
104f16: 69b8 ldr r0, [r7, #24]
104f18: 697d ldr r5, [r7, #20]
104f1a: 6a3e ldr r6, [r7, #32]
104f1c: ea24 72e4 bic.w r2, r4, r4, asr #31
104f20: f8d7 8008 ldr.w r8, [r7, #8]
buflen -= sizeof(sha256_salt_prefix) - 1;
104f24: 3c03 subs r4, #3
cp = stpncpy(buffer, sha256_salt_prefix, MAX(0, buflen));
104f26: f00f fef1 bl 114d0c <stpncpy>
if (rounds_custom) {
104f2a: 6879 ldr r1, [r7, #4]
n = snprintf(cp, MAX(0, buflen), "%s%zu$",
104f2c: ea24 72e4 bic.w r2, r4, r4, asr #31
cp = stpncpy(buffer, sha256_salt_prefix, MAX(0, buflen));
104f30: 4603 mov r3, r0
104f32: 6028 str r0, [r5, #0]
buflen -= sizeof(sha256_salt_prefix) - 1;
104f34: 637c str r4, [r7, #52] ; 0x34
if (rounds_custom) {
104f36: 2900 cmp r1, #0
104f38: f040 80db bne.w 1050f2 <crypt_sha256_r+0x47a>
cp += n;
buflen -= n;
}
cp = stpncpy(cp, salt, MIN((size_t)MAX(0, buflen), salt_len));
104f3c: 42b2 cmp r2, r6
104f3e: 4618 mov r0, r3
104f40: bf28 it cs
104f42: 4632 movcs r2, r6
104f44: 4641 mov r1, r8
104f46: f00f fee1 bl 114d0c <stpncpy>
buflen -= MIN((size_t)MAX(0, buflen), salt_len);
104f4a: 6b7b ldr r3, [r7, #52] ; 0x34
cp = stpncpy(cp, salt, MIN((size_t)MAX(0, buflen), salt_len));
104f4c: 6028 str r0, [r5, #0]
buflen -= MIN((size_t)MAX(0, buflen), salt_len);
104f4e: ea23 72e3 bic.w r2, r3, r3, asr #31
104f52: 42b2 cmp r2, r6
104f54: bf94 ite ls
104f56: 1a9b subls r3, r3, r2
104f58: 1b9b subhi r3, r3, r6
if (buflen > 0) {
104f5a: 2b00 cmp r3, #0
buflen -= MIN((size_t)MAX(0, buflen), salt_len);
104f5c: 637b str r3, [r7, #52] ; 0x34
if (buflen > 0) {
104f5e: dd06 ble.n 104f6e <crypt_sha256_r+0x2f6> <== ALWAYS TAKEN
*cp++ = '$';
104f60: 1c43 adds r3, r0, #1
104f62: 602b str r3, [r5, #0]
104f64: 2324 movs r3, #36 ; 0x24
104f66: 7003 strb r3, [r0, #0]
--buflen;
104f68: 6b7b ldr r3, [r7, #52] ; 0x34
104f6a: 3b01 subs r3, #1
104f6c: 637b str r3, [r7, #52] ; 0x34
}
b64_from_24bit(alt_result[0], alt_result[10], alt_result[20], 4, &buflen, &cp);
104f6e: f107 0234 add.w r2, r7, #52 ; 0x34
104f72: f897 1042 ldrb.w r1, [r7, #66] ; 0x42
104f76: f897 0038 ldrb.w r0, [r7, #56] ; 0x38
104f7a: 2304 movs r3, #4
104f7c: 9200 str r2, [sp, #0]
104f7e: 9501 str r5, [sp, #4]
104f80: f897 204c ldrb.w r2, [r7, #76] ; 0x4c
104f84: f000 fc4e bl 105824 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[21], alt_result[1], alt_result[11], 4, &buflen, &cp);
104f88: f107 0234 add.w r2, r7, #52 ; 0x34
104f8c: f897 1039 ldrb.w r1, [r7, #57] ; 0x39
104f90: f897 004d ldrb.w r0, [r7, #77] ; 0x4d
104f94: 2304 movs r3, #4
104f96: 9200 str r2, [sp, #0]
104f98: 9501 str r5, [sp, #4]
104f9a: f897 2043 ldrb.w r2, [r7, #67] ; 0x43
104f9e: f000 fc41 bl 105824 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[12], alt_result[22], alt_result[2], 4, &buflen, &cp);
104fa2: f107 0234 add.w r2, r7, #52 ; 0x34
104fa6: f897 104e ldrb.w r1, [r7, #78] ; 0x4e
104faa: f897 0044 ldrb.w r0, [r7, #68] ; 0x44
104fae: 2304 movs r3, #4
104fb0: 9200 str r2, [sp, #0]
104fb2: 9501 str r5, [sp, #4]
104fb4: f897 203a ldrb.w r2, [r7, #58] ; 0x3a
104fb8: f000 fc34 bl 105824 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[3], alt_result[13], alt_result[23], 4, &buflen, &cp);
104fbc: f107 0234 add.w r2, r7, #52 ; 0x34
104fc0: f897 1045 ldrb.w r1, [r7, #69] ; 0x45
104fc4: f897 003b ldrb.w r0, [r7, #59] ; 0x3b
104fc8: 2304 movs r3, #4
104fca: 9200 str r2, [sp, #0]
104fcc: 9501 str r5, [sp, #4]
104fce: f897 204f ldrb.w r2, [r7, #79] ; 0x4f
104fd2: f000 fc27 bl 105824 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[24], alt_result[4], alt_result[14], 4, &buflen, &cp);
104fd6: f107 0234 add.w r2, r7, #52 ; 0x34
104fda: f897 103c ldrb.w r1, [r7, #60] ; 0x3c
104fde: f897 0050 ldrb.w r0, [r7, #80] ; 0x50
104fe2: 2304 movs r3, #4
104fe4: 9200 str r2, [sp, #0]
104fe6: 9501 str r5, [sp, #4]
104fe8: f897 2046 ldrb.w r2, [r7, #70] ; 0x46
104fec: f000 fc1a bl 105824 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[15], alt_result[25], alt_result[5], 4, &buflen, &cp);
104ff0: f107 0234 add.w r2, r7, #52 ; 0x34
104ff4: f897 1051 ldrb.w r1, [r7, #81] ; 0x51
104ff8: f897 0047 ldrb.w r0, [r7, #71] ; 0x47
104ffc: 2304 movs r3, #4
104ffe: 9200 str r2, [sp, #0]
105000: 9501 str r5, [sp, #4]
105002: f897 203d ldrb.w r2, [r7, #61] ; 0x3d
105006: f000 fc0d bl 105824 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[6], alt_result[16], alt_result[26], 4, &buflen, &cp);
10500a: f107 0234 add.w r2, r7, #52 ; 0x34
10500e: f897 1048 ldrb.w r1, [r7, #72] ; 0x48
105012: f897 003e ldrb.w r0, [r7, #62] ; 0x3e
105016: 2304 movs r3, #4
105018: 9200 str r2, [sp, #0]
10501a: 9501 str r5, [sp, #4]
10501c: f897 2052 ldrb.w r2, [r7, #82] ; 0x52
105020: f000 fc00 bl 105824 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[27], alt_result[7], alt_result[17], 4, &buflen, &cp);
105024: f107 0234 add.w r2, r7, #52 ; 0x34
105028: f897 103f ldrb.w r1, [r7, #63] ; 0x3f
10502c: f897 0053 ldrb.w r0, [r7, #83] ; 0x53
105030: 2304 movs r3, #4
105032: 9200 str r2, [sp, #0]
105034: 9501 str r5, [sp, #4]
105036: f897 2049 ldrb.w r2, [r7, #73] ; 0x49
10503a: f000 fbf3 bl 105824 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[18], alt_result[28], alt_result[8], 4, &buflen, &cp);
10503e: f107 0234 add.w r2, r7, #52 ; 0x34
105042: f897 1054 ldrb.w r1, [r7, #84] ; 0x54
105046: f897 004a ldrb.w r0, [r7, #74] ; 0x4a
10504a: 2304 movs r3, #4
10504c: 9200 str r2, [sp, #0]
10504e: 9501 str r5, [sp, #4]
105050: f897 2040 ldrb.w r2, [r7, #64] ; 0x40
105054: f000 fbe6 bl 105824 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[9], alt_result[19], alt_result[29], 4, &buflen, &cp);
105058: f107 0234 add.w r2, r7, #52 ; 0x34
10505c: f897 104b ldrb.w r1, [r7, #75] ; 0x4b
105060: f897 0041 ldrb.w r0, [r7, #65] ; 0x41
105064: 2304 movs r3, #4
105066: 9200 str r2, [sp, #0]
105068: 9501 str r5, [sp, #4]
10506a: f897 2055 ldrb.w r2, [r7, #85] ; 0x55
10506e: f000 fbd9 bl 105824 <_crypt_b64_from_24bit>
b64_from_24bit(0, alt_result[31], alt_result[30], 3, &buflen, &cp);
105072: f107 0234 add.w r2, r7, #52 ; 0x34
105076: 2303 movs r3, #3
105078: 9200 str r2, [sp, #0]
10507a: 2000 movs r0, #0
10507c: f897 2056 ldrb.w r2, [r7, #86] ; 0x56
105080: f897 1057 ldrb.w r1, [r7, #87] ; 0x57
105084: 9501 str r5, [sp, #4]
105086: f000 fbcd bl 105824 <_crypt_b64_from_24bit>
if (buflen <= 0) {
10508a: 6b7b ldr r3, [r7, #52] ; 0x34
10508c: 2b00 cmp r3, #0
10508e: dd6a ble.n 105166 <crypt_sha256_r+0x4ee> <== ALWAYS TAKEN
errno = ERANGE;
buffer = NULL;
}
else
*cp = '\0'; /* Terminate the string. */
105090: 682b ldr r3, [r5, #0]
105092: 2200 movs r2, #0
105094: 701a strb r2, [r3, #0]
/* Clear the buffer for the intermediate result so that people
* attaching to processes or reading core dumps cannot get any
* information. We do it in this way to clear correct_words[] inside
* the SHA256 implementation as well. */
SHA256_Init(&ctx);
105096: f107 0078 add.w r0, r7, #120 ; 0x78
10509a: f003 ffef bl 10907c <SHA256_Init>
SHA256_Final(alt_result, &ctx);
10509e: f107 0178 add.w r1, r7, #120 ; 0x78
1050a2: f107 0038 add.w r0, r7, #56 ; 0x38
1050a6: f004 f855 bl 109154 <SHA256_Final>
memset(copied_key, '\0', key_len);
if (copied_salt != NULL)
memset(copied_salt, '\0', salt_len);
return buffer;
}
1050aa: 69b8 ldr r0, [r7, #24]
1050ac: f507 77a6 add.w r7, r7, #332 ; 0x14c
1050b0: 46bd mov sp, r7
1050b2: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
SHA256_Update(&ctx, p_bytes, key_len);
1050b6: 4622 mov r2, r4
1050b8: 4659 mov r1, fp
1050ba: f107 0078 add.w r0, r7, #120 ; 0x78
1050be: f004 f80d bl 1090dc <SHA256_Update>
if ((cnt & 1) != 0)
1050c2: 2d00 cmp r5, #0
1050c4: f47f af10 bne.w 104ee8 <crypt_sha256_r+0x270>
SHA256_Update(&ctx, p_bytes, key_len);
1050c8: 4622 mov r2, r4
1050ca: 4659 mov r1, fp
1050cc: f107 0078 add.w r0, r7, #120 ; 0x78
1050d0: f004 f804 bl 1090dc <SHA256_Update>
1050d4: e70f b.n 104ef6 <crypt_sha256_r+0x27e>
SHA256_Update(&ctx, s_bytes, salt_len);
1050d6: e9d7 1207 ldrd r1, r2, [r7, #28]
1050da: f107 0078 add.w r0, r7, #120 ; 0x78
1050de: f003 fffd bl 1090dc <SHA256_Update>
1050e2: e6f9 b.n 104ed8 <crypt_sha256_r+0x260>
if (strncmp(sha256_salt_prefix, salt, sizeof(sha256_salt_prefix) - 1) == 0)
1050e4: f898 3002 ldrb.w r3, [r8, #2]
1050e8: 2b24 cmp r3, #36 ; 0x24
salt += sizeof(sha256_salt_prefix) - 1;
1050ea: bf08 it eq
1050ec: f108 0803 addeq.w r8, r8, #3
1050f0: e5d4 b.n 104c9c <crypt_sha256_r+0x24>
n = snprintf(cp, MAX(0, buflen), "%s%zu$",
1050f2: 6a7b ldr r3, [r7, #36] ; 0x24
1050f4: 4611 mov r1, r2
1050f6: f649 32f0 movw r2, #39920 ; 0x9bf0
1050fa: f2c0 0211 movt r2, #17
1050fe: 9300 str r3, [sp, #0]
105100: f649 33fc movw r3, #39932 ; 0x9bfc
105104: f2c0 0311 movt r3, #17
105108: f00f fdbc bl 114c84 <snprintf>
buflen -= n;
10510c: 6b7a ldr r2, [r7, #52] ; 0x34
cp += n;
10510e: 682b ldr r3, [r5, #0]
buflen -= n;
105110: 1a12 subs r2, r2, r0
cp += n;
105112: 4403 add r3, r0
buflen -= n;
105114: 637a str r2, [r7, #52] ; 0x34
cp += n;
105116: 602b str r3, [r5, #0]
cp = stpncpy(cp, salt, MIN((size_t)MAX(0, buflen), salt_len));
105118: ea22 72e2 bic.w r2, r2, r2, asr #31
10511c: e70e b.n 104f3c <crypt_sha256_r+0x2c4>
srounds = strtoul(num, &endp, 10);
10511e: 220a movs r2, #10
105120: f107 0130 add.w r1, r7, #48 ; 0x30
105124: f108 0007 add.w r0, r8, #7
105128: f010 fc0e bl 115948 <strtoul>
if (*endp == '$') {
10512c: 6b3b ldr r3, [r7, #48] ; 0x30
10512e: 781a ldrb r2, [r3, #0]
105130: 2a24 cmp r2, #36 ; 0x24
rounds = ROUNDS_DEFAULT;
105132: bf1e ittt ne
105134: f241 3388 movwne r3, #5000 ; 0x1388
rounds_custom = false;
105138: 607c strne r4, [r7, #4]
rounds = ROUNDS_DEFAULT;
10513a: 627b strne r3, [r7, #36] ; 0x24
if (*endp == '$') {
10513c: f47f adbf bne.w 104cbe <crypt_sha256_r+0x46> <== ALWAYS TAKEN
rounds = MAX(ROUNDS_MIN, MIN(srounds, ROUNDS_MAX));
105140: f64c 12ff movw r2, #51711 ; 0xc9ff
salt = endp + 1;
105144: f103 0801 add.w r8, r3, #1
rounds = MAX(ROUNDS_MIN, MIN(srounds, ROUNDS_MAX));
105148: f6c3 329a movt r2, #15258 ; 0x3b9a
10514c: 4603 mov r3, r0
10514e: 4290 cmp r0, r2
105150: bf28 it cs
105152: 4613 movcs r3, r2
rounds_custom = true;
105154: 2201 movs r2, #1
105156: f5b3 7f7a cmp.w r3, #1000 ; 0x3e8
10515a: 607a str r2, [r7, #4]
10515c: bf38 it cc
10515e: f44f 737a movcc.w r3, #1000 ; 0x3e8
105162: 627b str r3, [r7, #36] ; 0x24
105164: e5ab b.n 104cbe <crypt_sha256_r+0x46>
errno = ERANGE;
105166: f00f fa01 bl 11456c <__errno> <== NOT EXECUTED
10516a: 2322 movs r3, #34 ; 0x22 <== NOT EXECUTED
buffer = NULL;
10516c: 2200 movs r2, #0 <== NOT EXECUTED
10516e: 61ba str r2, [r7, #24] <== NOT EXECUTED
errno = ERANGE;
105170: 6003 str r3, [r0, #0] <== NOT EXECUTED
buffer = NULL;
105172: e790 b.n 105096 <crypt_sha256_r+0x41e> <== NOT EXECUTED
SHA256_Update(&ctx, alt_result, cnt);
105174: 4622 mov r2, r4
105176: f107 0138 add.w r1, r7, #56 ; 0x38
10517a: f107 0078 add.w r0, r7, #120 ; 0x78
10517e: f003 ffad bl 1090dc <SHA256_Update>
for (cnt = key_len; cnt > 0; cnt >>= 1)
105182: 2c00 cmp r4, #0
105184: f47f adf3 bne.w 104d6e <crypt_sha256_r+0xf6> <== NEVER TAKEN
SHA256_Final(alt_result, &ctx);
105188: f107 0178 add.w r1, r7, #120 ; 0x78 <== NOT EXECUTED
10518c: f107 0038 add.w r0, r7, #56 ; 0x38 <== NOT EXECUTED
105190: f003 ffe0 bl 109154 <SHA256_Final> <== NOT EXECUTED
SHA256_Final(temp_result, &alt_ctx);
105194: f107 0958 add.w r9, r7, #88 ; 0x58 <== NOT EXECUTED
SHA256_Init(&alt_ctx);
105198: f107 00e0 add.w r0, r7, #224 ; 0xe0 <== NOT EXECUTED
10519c: f003 ff6e bl 10907c <SHA256_Init> <== NOT EXECUTED
cp = p_bytes = alloca(key_len);
1051a0: f10d 0b08 add.w fp, sp, #8 <== NOT EXECUTED
SHA256_Final(temp_result, &alt_ctx);
1051a4: f107 01e0 add.w r1, r7, #224 ; 0xe0 <== NOT EXECUTED
1051a8: 4648 mov r0, r9 <== NOT EXECUTED
cp = p_bytes = alloca(key_len);
1051aa: f107 052c add.w r5, r7, #44 ; 0x2c <== NOT EXECUTED
SHA256_Final(temp_result, &alt_ctx);
1051ae: f003 ffd1 bl 109154 <SHA256_Final> <== NOT EXECUTED
cp = p_bytes = alloca(key_len);
1051b2: 46de mov lr, fp <== NOT EXECUTED
1051b4: 4622 mov r2, r4 <== NOT EXECUTED
1051b6: f8c5 b000 str.w fp, [r5] <== NOT EXECUTED
for (cnt = key_len; cnt >= 32; cnt -= 32) {
1051ba: e632 b.n 104e22 <crypt_sha256_r+0x1aa> <== NOT EXECUTED
1051bc: 4622 mov r2, r4
1051be: e630 b.n 104e22 <crypt_sha256_r+0x1aa>
001051c0 <crypt_sha512_r>:
/* Maximum number of rounds. */
#define ROUNDS_MAX 999999999
char *
crypt_sha512_r(const char *key, const char *salt, struct crypt_data *data)
{
1051c0: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}
1051c4: f5ad 7d19 sub.w sp, sp, #612 ; 0x264
rounds = ROUNDS_DEFAULT;
rounds_custom = false;
/* Find beginning of salt string. The prefix should normally always
* be present. Just in case it is not. */
if (strncmp(sha512_salt_prefix, salt, sizeof(sha512_salt_prefix) - 1) == 0)
1051c8: 780b ldrb r3, [r1, #0]
{
1051ca: af02 add r7, sp, #8
1051cc: 460c mov r4, r1
1051ce: 61f9 str r1, [r7, #28]
int buflen = (int)sizeof(data->buffer);
1051d0: f44f 7180 mov.w r1, #256 ; 0x100
if (strncmp(sha512_salt_prefix, salt, sizeof(sha512_salt_prefix) - 1) == 0)
1051d4: 2b24 cmp r3, #36 ; 0x24
{
1051d6: 4605 mov r5, r0
int buflen = (int)sizeof(data->buffer);
1051d8: 6379 str r1, [r7, #52] ; 0x34
{
1051da: 613a str r2, [r7, #16]
if (strncmp(sha512_salt_prefix, salt, sizeof(sha512_salt_prefix) - 1) == 0)
1051dc: d103 bne.n 1051e6 <crypt_sha512_r+0x26>
1051de: 7863 ldrb r3, [r4, #1]
1051e0: 2b36 cmp r3, #54 ; 0x36
1051e2: f000 82a0 beq.w 105726 <crypt_sha512_r+0x566> <== NEVER TAKEN
/* Skip salt prefix. */
salt += sizeof(sha512_salt_prefix) - 1;
if (strncmp(salt, sha512_rounds_prefix, sizeof(sha512_rounds_prefix) - 1)
1051e6: f649 410c movw r1, #39948 ; 0x9c0c
1051ea: 69f8 ldr r0, [r7, #28]
1051ec: 2207 movs r2, #7
1051ee: f2c0 0111 movt r1, #17
1051f2: f010 f881 bl 1152f8 <strncmp>
1051f6: 4604 mov r4, r0
1051f8: 2800 cmp r0, #0
1051fa: f000 82b0 beq.w 10575e <crypt_sha512_r+0x59e>
rounds_custom = false;
1051fe: 2300 movs r3, #0
105200: 607b str r3, [r7, #4]
rounds = ROUNDS_DEFAULT;
105202: f241 3388 movw r3, #5000 ; 0x1388
105206: 627b str r3, [r7, #36] ; 0x24
rounds = MAX(ROUNDS_MIN, MIN(srounds, ROUNDS_MAX));
rounds_custom = true;
}
}
salt_len = MIN(strcspn(salt, "$"), SALT_LEN_MAX);
105208: f8d7 901c ldr.w r9, [r7, #28]
10520c: f649 31e4 movw r1, #39908 ; 0x9be4
105210: f2c0 0111 movt r1, #17
key_len = strlen(key);
/* Prepare for the real work. */
SHA512_Init(&ctx);
105214: f107 04b8 add.w r4, r7, #184 ; 0xb8
salt_len = MIN(strcspn(salt, "$"), SALT_LEN_MAX);
105218: 4648 mov r0, r9
10521a: f00f ff81 bl 115120 <strcspn>
10521e: 2810 cmp r0, #16
105220: bf28 it cs
105222: 2010 movcs r0, #16
105224: 4680 mov r8, r0
key_len = strlen(key);
105226: 4628 mov r0, r5
105228: f00f ffca bl 1151c0 <strlen>
10522c: 4606 mov r6, r0
SHA512_Init(&ctx);
10522e: 4620 mov r0, r4
105230: f009 fd26 bl 10ec80 <SHA512_Init>
/* Add the key string. */
SHA512_Update(&ctx, key, key_len);
105234: 4632 mov r2, r6
105236: 4629 mov r1, r5
105238: 4620 mov r0, r4
10523a: f009 fd6d bl 10ed18 <SHA512_Update>
/* The last part is the salt string. This must be at most 8
* characters and it ends at the first `$' character (for
* compatibility with existing implementations). */
SHA512_Update(&ctx, salt, salt_len);
10523e: 4642 mov r2, r8
105240: 4649 mov r1, r9
105242: 4620 mov r0, r4
105244: f009 fd68 bl 10ed18 <SHA512_Update>
/* Compute alternate SHA512 sum with input KEY, SALT, and KEY. The
* final result will be added to the first context. */
SHA512_Init(&alt_ctx);
105248: f507 70c4 add.w r0, r7, #392 ; 0x188
10524c: f009 fd18 bl 10ec80 <SHA512_Init>
/* Add key. */
SHA512_Update(&alt_ctx, key, key_len);
105250: 4632 mov r2, r6
105252: 4629 mov r1, r5
105254: f507 70c4 add.w r0, r7, #392 ; 0x188
105258: f009 fd5e bl 10ed18 <SHA512_Update>
/* Add salt. */
SHA512_Update(&alt_ctx, salt, salt_len);
10525c: 4642 mov r2, r8
10525e: 4649 mov r1, r9
105260: f507 70c4 add.w r0, r7, #392 ; 0x188
105264: f009 fd58 bl 10ed18 <SHA512_Update>
/* Add key again. */
SHA512_Update(&alt_ctx, key, key_len);
105268: 4632 mov r2, r6
10526a: 4629 mov r1, r5
10526c: f507 70c4 add.w r0, r7, #392 ; 0x188
105270: f009 fd52 bl 10ed18 <SHA512_Update>
/* Now get result of this (64 bytes) and add it to the other context. */
SHA512_Final(alt_result, &alt_ctx);
105274: f507 71c4 add.w r1, r7, #392 ; 0x188
105278: f107 0038 add.w r0, r7, #56 ; 0x38
10527c: f009 fda2 bl 10edc4 <SHA512_Final>
/* Add for any character in the key one byte of the alternate sum. */
for (cnt = key_len; cnt > 64; cnt -= 64)
105280: 2e40 cmp r6, #64 ; 0x40
105282: f240 8297 bls.w 1057b4 <crypt_sha512_r+0x5f4>
105286: 46b1 mov r9, r6
SHA512_Update(&ctx, alt_result, 64);
105288: 2240 movs r2, #64 ; 0x40
10528a: f107 0138 add.w r1, r7, #56 ; 0x38
for (cnt = key_len; cnt > 64; cnt -= 64)
10528e: f1a9 0940 sub.w r9, r9, #64 ; 0x40
SHA512_Update(&ctx, alt_result, 64);
105292: 4620 mov r0, r4
105294: f009 fd40 bl 10ed18 <SHA512_Update>
for (cnt = key_len; cnt > 64; cnt -= 64)
105298: f1b9 0f40 cmp.w r9, #64 ; 0x40
10529c: d8f4 bhi.n 105288 <crypt_sha512_r+0xc8> <== ALWAYS TAKEN
10529e: f1a6 0341 sub.w r3, r6, #65 ; 0x41
1052a2: f1a6 0240 sub.w r2, r6, #64 ; 0x40
1052a6: f023 033f bic.w r3, r3, #63 ; 0x3f
SHA512_Update(&ctx, alt_result, cnt);
1052aa: f107 0138 add.w r1, r7, #56 ; 0x38
1052ae: 1ad2 subs r2, r2, r3
1052b0: 4620 mov r0, r4
1052b2: f009 fd31 bl 10ed18 <SHA512_Update>
key_len = strlen(key);
1052b6: 46b1 mov r9, r6
/* Take the binary representation of the length of the key and for
* every 1 add the alternate sum, for every 0 the key. */
for (cnt = key_len; cnt > 0; cnt >>= 1)
if ((cnt & 1) != 0)
1052b8: f019 0f01 tst.w r9, #1
SHA512_Update(&ctx, alt_result, 64);
1052bc: f04f 0240 mov.w r2, #64 ; 0x40
1052c0: f107 0138 add.w r1, r7, #56 ; 0x38
1052c4: 4620 mov r0, r4
else
SHA512_Update(&ctx, key, key_len);
1052c6: bf02 ittt eq
1052c8: 4632 moveq r2, r6
1052ca: 4629 moveq r1, r5
1052cc: 4620 moveq r0, r4
1052ce: f009 fd23 bl 10ed18 <SHA512_Update>
for (cnt = key_len; cnt > 0; cnt >>= 1)
1052d2: ea5f 0959 movs.w r9, r9, lsr #1
1052d6: d1ef bne.n 1052b8 <crypt_sha512_r+0xf8>
/* Create intermediate result. */
SHA512_Final(alt_result, &ctx);
1052d8: f107 0038 add.w r0, r7, #56 ; 0x38
1052dc: 4621 mov r1, r4
1052de: f009 fd71 bl 10edc4 <SHA512_Final>
/* Start computation of P byte sequence. */
SHA512_Init(&alt_ctx);
1052e2: f507 70c4 add.w r0, r7, #392 ; 0x188
1052e6: f009 fccb bl 10ec80 <SHA512_Init>
/* For every character in the password add the entire password. */
for (cnt = 0; cnt < key_len; ++cnt)
SHA512_Update(&alt_ctx, key, key_len);
1052ea: 4632 mov r2, r6
1052ec: 4629 mov r1, r5
for (cnt = 0; cnt < key_len; ++cnt)
1052ee: f109 0901 add.w r9, r9, #1
SHA512_Update(&alt_ctx, key, key_len);
1052f2: f507 70c4 add.w r0, r7, #392 ; 0x188
1052f6: f009 fd0f bl 10ed18 <SHA512_Update>
for (cnt = 0; cnt < key_len; ++cnt)
1052fa: 454e cmp r6, r9
1052fc: d8f5 bhi.n 1052ea <crypt_sha512_r+0x12a>
/* Finish the digest. */
SHA512_Final(temp_result, &alt_ctx);
1052fe: f107 0978 add.w r9, r7, #120 ; 0x78
105302: f507 71c4 add.w r1, r7, #392 ; 0x188
105306: 4648 mov r0, r9
/* Create byte sequence P. */
cp = p_bytes = alloca(key_len);
105308: f107 052c add.w r5, r7, #44 ; 0x2c
SHA512_Final(temp_result, &alt_ctx);
10530c: f009 fd5a bl 10edc4 <SHA512_Final>
cp = p_bytes = alloca(key_len);
105310: 1df3 adds r3, r6, #7
for (cnt = key_len; cnt >= 64; cnt -= 64) {
105312: 2e3f cmp r6, #63 ; 0x3f
cp = p_bytes = alloca(key_len);
105314: f023 0307 bic.w r3, r3, #7
105318: ebad 0d03 sub.w sp, sp, r3
10531c: a802 add r0, sp, #8
10531e: 60f8 str r0, [r7, #12]
105320: 6028 str r0, [r5, #0]
for (cnt = key_len; cnt >= 64; cnt -= 64) {
105322: f240 8269 bls.w 1057f8 <crypt_sha512_r+0x638>
105326: 46b3 mov fp, r6
memcpy(cp, temp_result, 64);
105328: 4684 mov ip, r0
10532a: 46ca mov sl, r9
10532c: 46d6 mov lr, sl
10532e: f10c 0c10 add.w ip, ip, #16
105332: e8be 000f ldmia.w lr!, {r0, r1, r2, r3}
105336: f10a 0a10 add.w sl, sl, #16
10533a: 45a6 cmp lr, r4
10533c: f84c 0c10 str.w r0, [ip, #-16]
105340: f84c 1c0c str.w r1, [ip, #-12]
105344: f84c 2c08 str.w r2, [ip, #-8]
105348: f84c 3c04 str.w r3, [ip, #-4]
10534c: d1ee bne.n 10532c <crypt_sha512_r+0x16c>
cp += 64;
10534e: 6828 ldr r0, [r5, #0]
for (cnt = key_len; cnt >= 64; cnt -= 64) {
105350: f1ab 0b40 sub.w fp, fp, #64 ; 0x40
105354: f1bb 0f3f cmp.w fp, #63 ; 0x3f
cp += 64;
105358: f100 0040 add.w r0, r0, #64 ; 0x40
10535c: 6028 str r0, [r5, #0]
for (cnt = key_len; cnt >= 64; cnt -= 64) {
10535e: d8e3 bhi.n 105328 <crypt_sha512_r+0x168> <== ALWAYS TAKEN
105360: f006 023f and.w r2, r6, #63 ; 0x3f
}
memcpy(cp, temp_result, cnt);
105364: 4649 mov r1, r9
/* Start computation of S byte sequence. */
SHA512_Init(&alt_ctx);
/* For every character in the password add the entire password. */
for (cnt = 0; cnt < 16 + alt_result[0]; ++cnt)
105366: f04f 0a00 mov.w sl, #0
memcpy(cp, temp_result, cnt);
10536a: f00f e96a blx 114640 <memcpy>
SHA512_Init(&alt_ctx);
10536e: f507 70c4 add.w r0, r7, #392 ; 0x188
105372: f009 fc85 bl 10ec80 <SHA512_Init>
for (cnt = 0; cnt < 16 + alt_result[0]; ++cnt)
105376: f8d7 b01c ldr.w fp, [r7, #28]
SHA512_Update(&alt_ctx, salt, salt_len);
10537a: 4642 mov r2, r8
10537c: 4659 mov r1, fp
10537e: f507 70c4 add.w r0, r7, #392 ; 0x188
for (cnt = 0; cnt < 16 + alt_result[0]; ++cnt)
105382: f10a 0a01 add.w sl, sl, #1
SHA512_Update(&alt_ctx, salt, salt_len);
105386: f009 fcc7 bl 10ed18 <SHA512_Update>
for (cnt = 0; cnt < 16 + alt_result[0]; ++cnt)
10538a: f897 3038 ldrb.w r3, [r7, #56] ; 0x38
10538e: 3310 adds r3, #16
105390: 4553 cmp r3, sl
105392: d8f2 bhi.n 10537a <crypt_sha512_r+0x1ba>
/* Finish the digest. */
SHA512_Final(temp_result, &alt_ctx);
105394: 4648 mov r0, r9
105396: f507 71c4 add.w r1, r7, #392 ; 0x188
10539a: f009 fd13 bl 10edc4 <SHA512_Final>
/* Create byte sequence S. */
cp = s_bytes = alloca(salt_len);
10539e: f108 0307 add.w r3, r8, #7
/* Add key or last result. */
if ((cnt & 1) != 0)
SHA512_Update(&ctx, p_bytes, key_len);
else
SHA512_Update(&ctx, alt_result, 64);
1053a2: f64a 2bab movw fp, #43691 ; 0xaaab
cp = s_bytes = alloca(salt_len);
1053a6: f023 0307 bic.w r3, r3, #7
/* Add salt for numbers not divisible by 3. */
if (cnt % 3 != 0)
SHA512_Update(&ctx, s_bytes, salt_len);
/* Add key for numbers not divisible by 7. */
if (cnt % 7 != 0)
1053aa: f644 1224 movw r2, #18724 ; 0x4924
cp = s_bytes = alloca(salt_len);
1053ae: ebad 0d03 sub.w sp, sp, r3
memcpy(cp, temp_result, cnt);
1053b2: 4649 mov r1, r9
if (cnt % 7 != 0)
1053b4: f2c2 4292 movt r2, #9362 ; 0x2492
SHA512_Update(&ctx, s_bytes, salt_len);
1053b8: f646 53b7 movw r3, #28087 ; 0x6db7
SHA512_Update(&ctx, alt_result, 64);
1053bc: f6ca 2baa movt fp, #43690 ; 0xaaaa
for (cnt = 0; cnt < rounds; ++cnt) {
1053c0: f04f 0900 mov.w r9, #0
cp = s_bytes = alloca(salt_len);
1053c4: a802 add r0, sp, #8
SHA512_Update(&ctx, s_bytes, salt_len);
1053c6: f2cb 63db movt r3, #46811 ; 0xb6db
if (cnt % 7 != 0)
1053ca: 623a str r2, [r7, #32]
memcpy(cp, temp_result, cnt);
1053cc: 4642 mov r2, r8
SHA512_Update(&ctx, s_bytes, salt_len);
1053ce: 60bb str r3, [r7, #8]
cp = s_bytes = alloca(salt_len);
1053d0: 6178 str r0, [r7, #20]
1053d2: 6028 str r0, [r5, #0]
memcpy(cp, temp_result, cnt);
1053d4: f00f e934 blx 114640 <memcpy>
1053d8: f8c7 8018 str.w r8, [r7, #24]
1053dc: e9d7 8a02 ldrd r8, sl, [r7, #8]
1053e0: 60fd str r5, [r7, #12]
SHA512_Init(&ctx);
1053e2: 4620 mov r0, r4
1053e4: f009 fc4c bl 10ec80 <SHA512_Init>
if ((cnt & 1) != 0)
1053e8: f019 0501 ands.w r5, r9, #1
SHA512_Update(&ctx, alt_result, 64);
1053ec: 4620 mov r0, r4
SHA512_Update(&ctx, p_bytes, key_len);
1053ee: bf19 ittee ne
1053f0: 4632 movne r2, r6
1053f2: 4651 movne r1, sl
SHA512_Update(&ctx, alt_result, 64);
1053f4: 2240 moveq r2, #64 ; 0x40
1053f6: f107 0138 addeq.w r1, r7, #56 ; 0x38
1053fa: f009 fc8d bl 10ed18 <SHA512_Update>
1053fe: fb0b f309 mul.w r3, fp, r9
if (cnt % 3 != 0)
105402: f1b3 3f55 cmp.w r3, #1431655765 ; 0x55555555
105406: f200 8188 bhi.w 10571a <crypt_sha512_r+0x55a>
SHA512_Update(&ctx, s_bytes, salt_len);
10540a: fb08 f309 mul.w r3, r8, r9
if (cnt % 7 != 0)
10540e: 6a3a ldr r2, [r7, #32]
105410: 4293 cmp r3, r2
105412: f200 8174 bhi.w 1056fe <crypt_sha512_r+0x53e>
SHA512_Update(&ctx, p_bytes, key_len);
/* Add key or last result. */
if ((cnt & 1) != 0)
105416: 2d00 cmp r5, #0
105418: f000 8179 beq.w 10570e <crypt_sha512_r+0x54e>
SHA512_Update(&ctx, alt_result, 64);
10541c: 2240 movs r2, #64 ; 0x40
10541e: f107 0138 add.w r1, r7, #56 ; 0x38
105422: 4620 mov r0, r4
105424: f009 fc78 bl 10ed18 <SHA512_Update>
else
SHA512_Update(&ctx, p_bytes, key_len);
/* Create intermediate result. */
SHA512_Final(alt_result, &ctx);
105428: 4621 mov r1, r4
10542a: f107 0038 add.w r0, r7, #56 ; 0x38
10542e: f009 fcc9 bl 10edc4 <SHA512_Final>
for (cnt = 0; cnt < rounds; ++cnt) {
105432: 6a7b ldr r3, [r7, #36] ; 0x24
105434: f109 0901 add.w r9, r9, #1
105438: 454b cmp r3, r9
10543a: d1d2 bne.n 1053e2 <crypt_sha512_r+0x222>
}
/* Now we can construct the result string. It consists of three
* parts. */
cp = stpncpy(buffer, sha512_salt_prefix, MAX(0, buflen));
10543c: 6b7e ldr r6, [r7, #52] ; 0x34
10543e: f649 4114 movw r1, #39956 ; 0x9c14
105442: f2c0 0111 movt r1, #17
105446: 6938 ldr r0, [r7, #16]
105448: 68fd ldr r5, [r7, #12]
10544a: f8d7 8018 ldr.w r8, [r7, #24]
10544e: ea26 72e6 bic.w r2, r6, r6, asr #31
buflen -= sizeof(sha512_salt_prefix) - 1;
105452: 3e03 subs r6, #3
cp = stpncpy(buffer, sha512_salt_prefix, MAX(0, buflen));
105454: f00f fc5a bl 114d0c <stpncpy>
if (rounds_custom) {
105458: 6879 ldr r1, [r7, #4]
n = snprintf(cp, MAX(0, buflen), "%s%zu$",
10545a: ea26 72e6 bic.w r2, r6, r6, asr #31
cp = stpncpy(buffer, sha512_salt_prefix, MAX(0, buflen));
10545e: 4603 mov r3, r0
105460: 6028 str r0, [r5, #0]
buflen -= sizeof(sha512_salt_prefix) - 1;
105462: 637e str r6, [r7, #52] ; 0x34
if (rounds_custom) {
105464: 2900 cmp r1, #0
105466: f040 8164 bne.w 105732 <crypt_sha512_r+0x572>
cp += n;
buflen -= n;
}
cp = stpncpy(cp, salt, MIN((size_t)MAX(0, buflen), salt_len));
10546a: 4542 cmp r2, r8
10546c: 4618 mov r0, r3
10546e: bf28 it cs
105470: 4642 movcs r2, r8
105472: 69f9 ldr r1, [r7, #28]
105474: f00f fc4a bl 114d0c <stpncpy>
buflen -= MIN((size_t)MAX(0, buflen), salt_len);
105478: 6b7b ldr r3, [r7, #52] ; 0x34
cp = stpncpy(cp, salt, MIN((size_t)MAX(0, buflen), salt_len));
10547a: 6028 str r0, [r5, #0]
buflen -= MIN((size_t)MAX(0, buflen), salt_len);
10547c: ea23 72e3 bic.w r2, r3, r3, asr #31
105480: 4542 cmp r2, r8
105482: bf94 ite ls
105484: 1a9b subls r3, r3, r2
105486: eba3 0308 subhi.w r3, r3, r8
if (buflen > 0) {
10548a: 2b00 cmp r3, #0
buflen -= MIN((size_t)MAX(0, buflen), salt_len);
10548c: 637b str r3, [r7, #52] ; 0x34
if (buflen > 0) {
10548e: dd06 ble.n 10549e <crypt_sha512_r+0x2de> <== ALWAYS TAKEN
*cp++ = '$';
105490: 1c43 adds r3, r0, #1
105492: 602b str r3, [r5, #0]
105494: 2324 movs r3, #36 ; 0x24
105496: 7003 strb r3, [r0, #0]
--buflen;
105498: 6b7b ldr r3, [r7, #52] ; 0x34
10549a: 3b01 subs r3, #1
10549c: 637b str r3, [r7, #52] ; 0x34
}
b64_from_24bit(alt_result[0], alt_result[21], alt_result[42], 4, &buflen, &cp);
10549e: f107 0234 add.w r2, r7, #52 ; 0x34
1054a2: f897 104d ldrb.w r1, [r7, #77] ; 0x4d
1054a6: f897 0038 ldrb.w r0, [r7, #56] ; 0x38
1054aa: 2304 movs r3, #4
1054ac: 9200 str r2, [sp, #0]
1054ae: 9501 str r5, [sp, #4]
1054b0: f897 2062 ldrb.w r2, [r7, #98] ; 0x62
1054b4: f000 f9b6 bl 105824 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[22], alt_result[43], alt_result[1], 4, &buflen, &cp);
1054b8: f107 0234 add.w r2, r7, #52 ; 0x34
1054bc: f897 1063 ldrb.w r1, [r7, #99] ; 0x63
1054c0: f897 004e ldrb.w r0, [r7, #78] ; 0x4e
1054c4: 2304 movs r3, #4
1054c6: 9200 str r2, [sp, #0]
1054c8: 9501 str r5, [sp, #4]
1054ca: f897 2039 ldrb.w r2, [r7, #57] ; 0x39
1054ce: f000 f9a9 bl 105824 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[44], alt_result[2], alt_result[23], 4, &buflen, &cp);
1054d2: f107 0234 add.w r2, r7, #52 ; 0x34
1054d6: f897 103a ldrb.w r1, [r7, #58] ; 0x3a
1054da: f897 0064 ldrb.w r0, [r7, #100] ; 0x64
1054de: 2304 movs r3, #4
1054e0: 9200 str r2, [sp, #0]
1054e2: 9501 str r5, [sp, #4]
1054e4: f897 204f ldrb.w r2, [r7, #79] ; 0x4f
1054e8: f000 f99c bl 105824 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[3], alt_result[24], alt_result[45], 4, &buflen, &cp);
1054ec: f107 0234 add.w r2, r7, #52 ; 0x34
1054f0: f897 1050 ldrb.w r1, [r7, #80] ; 0x50
1054f4: f897 003b ldrb.w r0, [r7, #59] ; 0x3b
1054f8: 2304 movs r3, #4
1054fa: 9200 str r2, [sp, #0]
1054fc: 9501 str r5, [sp, #4]
1054fe: f897 2065 ldrb.w r2, [r7, #101] ; 0x65
105502: f000 f98f bl 105824 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[25], alt_result[46], alt_result[4], 4, &buflen, &cp);
105506: f107 0234 add.w r2, r7, #52 ; 0x34
10550a: f897 1066 ldrb.w r1, [r7, #102] ; 0x66
10550e: f897 0051 ldrb.w r0, [r7, #81] ; 0x51
105512: 2304 movs r3, #4
105514: 9200 str r2, [sp, #0]
105516: 9501 str r5, [sp, #4]
105518: f897 203c ldrb.w r2, [r7, #60] ; 0x3c
10551c: f000 f982 bl 105824 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[47], alt_result[5], alt_result[26], 4, &buflen, &cp);
105520: f107 0234 add.w r2, r7, #52 ; 0x34
105524: f897 103d ldrb.w r1, [r7, #61] ; 0x3d
105528: f897 0067 ldrb.w r0, [r7, #103] ; 0x67
10552c: 2304 movs r3, #4
10552e: 9200 str r2, [sp, #0]
105530: 9501 str r5, [sp, #4]
105532: f897 2052 ldrb.w r2, [r7, #82] ; 0x52
105536: f000 f975 bl 105824 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[6], alt_result[27], alt_result[48], 4, &buflen, &cp);
10553a: f107 0234 add.w r2, r7, #52 ; 0x34
10553e: f897 1053 ldrb.w r1, [r7, #83] ; 0x53
105542: f897 003e ldrb.w r0, [r7, #62] ; 0x3e
105546: 2304 movs r3, #4
105548: 9200 str r2, [sp, #0]
10554a: 9501 str r5, [sp, #4]
10554c: f897 2068 ldrb.w r2, [r7, #104] ; 0x68
105550: f000 f968 bl 105824 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[28], alt_result[49], alt_result[7], 4, &buflen, &cp);
105554: f107 0234 add.w r2, r7, #52 ; 0x34
105558: f897 1069 ldrb.w r1, [r7, #105] ; 0x69
10555c: f897 0054 ldrb.w r0, [r7, #84] ; 0x54
105560: 2304 movs r3, #4
105562: 9200 str r2, [sp, #0]
105564: 9501 str r5, [sp, #4]
105566: f897 203f ldrb.w r2, [r7, #63] ; 0x3f
10556a: f000 f95b bl 105824 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[50], alt_result[8], alt_result[29], 4, &buflen, &cp);
10556e: f107 0234 add.w r2, r7, #52 ; 0x34
105572: f897 1040 ldrb.w r1, [r7, #64] ; 0x40
105576: f897 006a ldrb.w r0, [r7, #106] ; 0x6a
10557a: 2304 movs r3, #4
10557c: 9200 str r2, [sp, #0]
10557e: 9501 str r5, [sp, #4]
105580: f897 2055 ldrb.w r2, [r7, #85] ; 0x55
105584: f000 f94e bl 105824 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[9], alt_result[30], alt_result[51], 4, &buflen, &cp);
105588: f107 0234 add.w r2, r7, #52 ; 0x34
10558c: f897 1056 ldrb.w r1, [r7, #86] ; 0x56
105590: f897 0041 ldrb.w r0, [r7, #65] ; 0x41
105594: 2304 movs r3, #4
105596: 9200 str r2, [sp, #0]
105598: 9501 str r5, [sp, #4]
10559a: f897 206b ldrb.w r2, [r7, #107] ; 0x6b
10559e: f000 f941 bl 105824 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[31], alt_result[52], alt_result[10], 4, &buflen, &cp);
1055a2: f107 0234 add.w r2, r7, #52 ; 0x34
1055a6: f897 106c ldrb.w r1, [r7, #108] ; 0x6c
1055aa: f897 0057 ldrb.w r0, [r7, #87] ; 0x57
1055ae: 2304 movs r3, #4
1055b0: 9200 str r2, [sp, #0]
1055b2: 9501 str r5, [sp, #4]
1055b4: f897 2042 ldrb.w r2, [r7, #66] ; 0x42
1055b8: f000 f934 bl 105824 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[53], alt_result[11], alt_result[32], 4, &buflen, &cp);
1055bc: f107 0234 add.w r2, r7, #52 ; 0x34
1055c0: f897 1043 ldrb.w r1, [r7, #67] ; 0x43
1055c4: f897 006d ldrb.w r0, [r7, #109] ; 0x6d
1055c8: 2304 movs r3, #4
1055ca: 9200 str r2, [sp, #0]
1055cc: 9501 str r5, [sp, #4]
1055ce: f897 2058 ldrb.w r2, [r7, #88] ; 0x58
1055d2: f000 f927 bl 105824 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[12], alt_result[33], alt_result[54], 4, &buflen, &cp);
1055d6: f107 0234 add.w r2, r7, #52 ; 0x34
1055da: f897 1059 ldrb.w r1, [r7, #89] ; 0x59
1055de: f897 0044 ldrb.w r0, [r7, #68] ; 0x44
1055e2: 2304 movs r3, #4
1055e4: 9200 str r2, [sp, #0]
1055e6: 9501 str r5, [sp, #4]
1055e8: f897 206e ldrb.w r2, [r7, #110] ; 0x6e
1055ec: f000 f91a bl 105824 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[34], alt_result[55], alt_result[13], 4, &buflen, &cp);
1055f0: f107 0234 add.w r2, r7, #52 ; 0x34
1055f4: f897 106f ldrb.w r1, [r7, #111] ; 0x6f
1055f8: f897 005a ldrb.w r0, [r7, #90] ; 0x5a
1055fc: 2304 movs r3, #4
1055fe: 9200 str r2, [sp, #0]
105600: 9501 str r5, [sp, #4]
105602: f897 2045 ldrb.w r2, [r7, #69] ; 0x45
105606: f000 f90d bl 105824 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[56], alt_result[14], alt_result[35], 4, &buflen, &cp);
10560a: f107 0234 add.w r2, r7, #52 ; 0x34
10560e: f897 1046 ldrb.w r1, [r7, #70] ; 0x46
105612: f897 0070 ldrb.w r0, [r7, #112] ; 0x70
105616: 2304 movs r3, #4
105618: 9200 str r2, [sp, #0]
10561a: 9501 str r5, [sp, #4]
10561c: f897 205b ldrb.w r2, [r7, #91] ; 0x5b
105620: f000 f900 bl 105824 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[15], alt_result[36], alt_result[57], 4, &buflen, &cp);
105624: f107 0234 add.w r2, r7, #52 ; 0x34
105628: f897 105c ldrb.w r1, [r7, #92] ; 0x5c
10562c: f897 0047 ldrb.w r0, [r7, #71] ; 0x47
105630: 2304 movs r3, #4
105632: 9200 str r2, [sp, #0]
105634: 9501 str r5, [sp, #4]
105636: f897 2071 ldrb.w r2, [r7, #113] ; 0x71
10563a: f000 f8f3 bl 105824 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[37], alt_result[58], alt_result[16], 4, &buflen, &cp);
10563e: f107 0234 add.w r2, r7, #52 ; 0x34
105642: f897 1072 ldrb.w r1, [r7, #114] ; 0x72
105646: f897 005d ldrb.w r0, [r7, #93] ; 0x5d
10564a: 2304 movs r3, #4
10564c: 9200 str r2, [sp, #0]
10564e: 9501 str r5, [sp, #4]
105650: f897 2048 ldrb.w r2, [r7, #72] ; 0x48
105654: f000 f8e6 bl 105824 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[59], alt_result[17], alt_result[38], 4, &buflen, &cp);
105658: f107 0234 add.w r2, r7, #52 ; 0x34
10565c: f897 1049 ldrb.w r1, [r7, #73] ; 0x49
105660: f897 0073 ldrb.w r0, [r7, #115] ; 0x73
105664: 2304 movs r3, #4
105666: 9200 str r2, [sp, #0]
105668: 9501 str r5, [sp, #4]
10566a: f897 205e ldrb.w r2, [r7, #94] ; 0x5e
10566e: f000 f8d9 bl 105824 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[18], alt_result[39], alt_result[60], 4, &buflen, &cp);
105672: f107 0234 add.w r2, r7, #52 ; 0x34
105676: f897 105f ldrb.w r1, [r7, #95] ; 0x5f
10567a: f897 004a ldrb.w r0, [r7, #74] ; 0x4a
10567e: 2304 movs r3, #4
105680: 9200 str r2, [sp, #0]
105682: 9501 str r5, [sp, #4]
105684: f897 2074 ldrb.w r2, [r7, #116] ; 0x74
105688: f000 f8cc bl 105824 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[40], alt_result[61], alt_result[19], 4, &buflen, &cp);
10568c: f107 0234 add.w r2, r7, #52 ; 0x34
105690: f897 1075 ldrb.w r1, [r7, #117] ; 0x75
105694: f897 0060 ldrb.w r0, [r7, #96] ; 0x60
105698: 2304 movs r3, #4
10569a: 9200 str r2, [sp, #0]
10569c: 9501 str r5, [sp, #4]
10569e: f897 204b ldrb.w r2, [r7, #75] ; 0x4b
1056a2: f000 f8bf bl 105824 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[62], alt_result[20], alt_result[41], 4, &buflen, &cp);
1056a6: f107 0234 add.w r2, r7, #52 ; 0x34
1056aa: f897 104c ldrb.w r1, [r7, #76] ; 0x4c
1056ae: f897 0076 ldrb.w r0, [r7, #118] ; 0x76
1056b2: 2304 movs r3, #4
1056b4: 9200 str r2, [sp, #0]
1056b6: 9501 str r5, [sp, #4]
1056b8: f897 2061 ldrb.w r2, [r7, #97] ; 0x61
1056bc: f000 f8b2 bl 105824 <_crypt_b64_from_24bit>
b64_from_24bit(0, 0, alt_result[63], 2, &buflen, &cp);
1056c0: f107 0234 add.w r2, r7, #52 ; 0x34
1056c4: 2100 movs r1, #0
1056c6: 2302 movs r3, #2
1056c8: 9200 str r2, [sp, #0]
1056ca: 4608 mov r0, r1
1056cc: f897 2077 ldrb.w r2, [r7, #119] ; 0x77
1056d0: 9501 str r5, [sp, #4]
1056d2: f000 f8a7 bl 105824 <_crypt_b64_from_24bit>
if (buflen <= 0) {
1056d6: 6b7b ldr r3, [r7, #52] ; 0x34
1056d8: 2b00 cmp r3, #0
1056da: dd64 ble.n 1057a6 <crypt_sha512_r+0x5e6> <== ALWAYS TAKEN
errno = ERANGE;
buffer = NULL;
}
else
*cp = '\0'; /* Terminate the string. */
1056dc: 682b ldr r3, [r5, #0]
1056de: 2200 movs r2, #0
1056e0: 701a strb r2, [r3, #0]
/* Clear the buffer for the intermediate result so that people
* attaching to processes or reading core dumps cannot get any
* information. We do it in this way to clear correct_words[] inside
* the SHA512 implementation as well. */
SHA512_Init(&ctx);
1056e2: 4620 mov r0, r4
1056e4: f009 facc bl 10ec80 <SHA512_Init>
SHA512_Final(alt_result, &ctx);
1056e8: f107 0038 add.w r0, r7, #56 ; 0x38
1056ec: 4621 mov r1, r4
1056ee: f009 fb69 bl 10edc4 <SHA512_Final>
memset(copied_key, '\0', key_len);
if (copied_salt != NULL)
memset(copied_salt, '\0', salt_len);
return buffer;
}
1056f2: 6938 ldr r0, [r7, #16]
1056f4: f507 7717 add.w r7, r7, #604 ; 0x25c
1056f8: 46bd mov sp, r7
1056fa: e8bd 8ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp, pc}
SHA512_Update(&ctx, p_bytes, key_len);
1056fe: 4632 mov r2, r6
105700: 4651 mov r1, sl
105702: 4620 mov r0, r4
105704: f009 fb08 bl 10ed18 <SHA512_Update>
if ((cnt & 1) != 0)
105708: 2d00 cmp r5, #0
10570a: f47f ae87 bne.w 10541c <crypt_sha512_r+0x25c>
SHA512_Update(&ctx, p_bytes, key_len);
10570e: 4632 mov r2, r6
105710: 4651 mov r1, sl
105712: 4620 mov r0, r4
105714: f009 fb00 bl 10ed18 <SHA512_Update>
105718: e686 b.n 105428 <crypt_sha512_r+0x268>
SHA512_Update(&ctx, s_bytes, salt_len);
10571a: e9d7 1205 ldrd r1, r2, [r7, #20]
10571e: 4620 mov r0, r4
105720: f009 fafa bl 10ed18 <SHA512_Update>
105724: e671 b.n 10540a <crypt_sha512_r+0x24a>
if (strncmp(sha512_salt_prefix, salt, sizeof(sha512_salt_prefix) - 1) == 0)
105726: 78a3 ldrb r3, [r4, #2]
105728: 2b24 cmp r3, #36 ; 0x24
salt += sizeof(sha512_salt_prefix) - 1;
10572a: bf04 itt eq
10572c: 3403 addeq r4, #3
10572e: 61fc streq r4, [r7, #28]
105730: e559 b.n 1051e6 <crypt_sha512_r+0x26>
n = snprintf(cp, MAX(0, buflen), "%s%zu$",
105732: 6a7b ldr r3, [r7, #36] ; 0x24
105734: 4611 mov r1, r2
105736: f649 32f0 movw r2, #39920 ; 0x9bf0
10573a: f2c0 0211 movt r2, #17
10573e: 9300 str r3, [sp, #0]
105740: f649 430c movw r3, #39948 ; 0x9c0c
105744: f2c0 0311 movt r3, #17
105748: f00f fa9c bl 114c84 <snprintf>
buflen -= n;
10574c: 6b7a ldr r2, [r7, #52] ; 0x34
cp += n;
10574e: 682b ldr r3, [r5, #0]
buflen -= n;
105750: 1a12 subs r2, r2, r0
cp += n;
105752: 4403 add r3, r0
buflen -= n;
105754: 637a str r2, [r7, #52] ; 0x34
cp += n;
105756: 602b str r3, [r5, #0]
cp = stpncpy(cp, salt, MIN((size_t)MAX(0, buflen), salt_len));
105758: ea22 72e2 bic.w r2, r2, r2, asr #31
10575c: e685 b.n 10546a <crypt_sha512_r+0x2aa>
srounds = strtoul(num, &endp, 10);
10575e: 69fb ldr r3, [r7, #28]
105760: 220a movs r2, #10
105762: f107 0130 add.w r1, r7, #48 ; 0x30
105766: 1dd8 adds r0, r3, #7
105768: f010 f8ee bl 115948 <strtoul>
if (*endp == '$') {
10576c: 6b3b ldr r3, [r7, #48] ; 0x30
10576e: 781a ldrb r2, [r3, #0]
105770: 2a24 cmp r2, #36 ; 0x24
rounds = ROUNDS_DEFAULT;
105772: bf1e ittt ne
105774: f241 3388 movwne r3, #5000 ; 0x1388
rounds_custom = false;
105778: 607c strne r4, [r7, #4]
rounds = ROUNDS_DEFAULT;
10577a: 627b strne r3, [r7, #36] ; 0x24
if (*endp == '$') {
10577c: f47f ad44 bne.w 105208 <crypt_sha512_r+0x48> <== ALWAYS TAKEN
rounds = MAX(ROUNDS_MIN, MIN(srounds, ROUNDS_MAX));
105780: f64c 12ff movw r2, #51711 ; 0xc9ff
salt = endp + 1;
105784: 3301 adds r3, #1
rounds = MAX(ROUNDS_MIN, MIN(srounds, ROUNDS_MAX));
105786: f6c3 329a movt r2, #15258 ; 0x3b9a
salt = endp + 1;
10578a: 61fb str r3, [r7, #28]
rounds = MAX(ROUNDS_MIN, MIN(srounds, ROUNDS_MAX));
10578c: 4290 cmp r0, r2
10578e: 4603 mov r3, r0
105790: bf28 it cs
105792: 4613 movcs r3, r2
rounds_custom = true;
105794: 2201 movs r2, #1
105796: f5b3 7f7a cmp.w r3, #1000 ; 0x3e8
10579a: 607a str r2, [r7, #4]
10579c: bf38 it cc
10579e: f44f 737a movcc.w r3, #1000 ; 0x3e8
1057a2: 627b str r3, [r7, #36] ; 0x24
1057a4: e530 b.n 105208 <crypt_sha512_r+0x48>
errno = ERANGE;
1057a6: f00e fee1 bl 11456c <__errno> <== NOT EXECUTED
1057aa: 2322 movs r3, #34 ; 0x22 <== NOT EXECUTED
buffer = NULL;
1057ac: 2200 movs r2, #0 <== NOT EXECUTED
1057ae: 613a str r2, [r7, #16] <== NOT EXECUTED
errno = ERANGE;
1057b0: 6003 str r3, [r0, #0] <== NOT EXECUTED
buffer = NULL;
1057b2: e796 b.n 1056e2 <crypt_sha512_r+0x522> <== NOT EXECUTED
SHA512_Update(&ctx, alt_result, cnt);
1057b4: 4632 mov r2, r6
1057b6: f107 0138 add.w r1, r7, #56 ; 0x38
1057ba: 4620 mov r0, r4
1057bc: f009 faac bl 10ed18 <SHA512_Update>
for (cnt = key_len; cnt > 0; cnt >>= 1)
1057c0: 2e00 cmp r6, #0
1057c2: f47f ad78 bne.w 1052b6 <crypt_sha512_r+0xf6> <== NEVER TAKEN
SHA512_Final(alt_result, &ctx);
1057c6: 4621 mov r1, r4 <== NOT EXECUTED
1057c8: f107 0038 add.w r0, r7, #56 ; 0x38 <== NOT EXECUTED
1057cc: f009 fafa bl 10edc4 <SHA512_Final> <== NOT EXECUTED
SHA512_Final(temp_result, &alt_ctx);
1057d0: f107 0978 add.w r9, r7, #120 ; 0x78 <== NOT EXECUTED
SHA512_Init(&alt_ctx);
1057d4: f507 70c4 add.w r0, r7, #392 ; 0x188 <== NOT EXECUTED
1057d8: f009 fa52 bl 10ec80 <SHA512_Init> <== NOT EXECUTED
cp = p_bytes = alloca(key_len);
1057dc: ab02 add r3, sp, #8 <== NOT EXECUTED
SHA512_Final(temp_result, &alt_ctx);
1057de: 4648 mov r0, r9 <== NOT EXECUTED
1057e0: f507 71c4 add.w r1, r7, #392 ; 0x188 <== NOT EXECUTED
cp = p_bytes = alloca(key_len);
1057e4: 60fb str r3, [r7, #12] <== NOT EXECUTED
SHA512_Final(temp_result, &alt_ctx);
1057e6: f009 faed bl 10edc4 <SHA512_Final> <== NOT EXECUTED
cp = p_bytes = alloca(key_len);
1057ea: 68fb ldr r3, [r7, #12] <== NOT EXECUTED
1057ec: f107 052c add.w r5, r7, #44 ; 0x2c <== NOT EXECUTED
1057f0: 4632 mov r2, r6 <== NOT EXECUTED
1057f2: 4618 mov r0, r3 <== NOT EXECUTED
1057f4: 602b str r3, [r5, #0] <== NOT EXECUTED
for (cnt = key_len; cnt >= 64; cnt -= 64) {
1057f6: e5b5 b.n 105364 <crypt_sha512_r+0x1a4> <== NOT EXECUTED
1057f8: 68f8 ldr r0, [r7, #12]
1057fa: 4632 mov r2, r6
1057fc: e5b2 b.n 105364 <crypt_sha512_r+0x1a4>
1057fe: bf00 nop