RTEMS-6
Annotated Report
libcrypt
Mon Mar 1 00:31:05 2021
0000000040022050 <_crypt_b64_from_24bit>:
void
b64_from_24bit(uint8_t B2, uint8_t B1, uint8_t B0, int n, int *buflen, char **cp)
{
40022050: 12001c42 and w2, w2, #0xff
uint32_t w;
int i;
#if defined(__rtems__)
w = ((uint32_t)B2 << 16) | ((uint32_t)B1 << 8) | B0;
40022054: 53181c21 ubfiz w1, w1, #8, #8
40022058: 2a020022 orr w2, w1, w2
4002205c: 53101c00 ubfiz w0, w0, #16, #8
#else
w = (B2 << 16) | (B1 << 8) | B0;
#endif
for (i = 0; i < n; i++) {
40022060: 7100007f cmp w3, #0x0
w = ((uint32_t)B2 << 16) | ((uint32_t)B1 << 8) | B0;
40022064: 2a000042 orr w2, w2, w0
for (i = 0; i < n; i++) {
40022068: 5400028d b.le 400220b8 <_crypt_b64_from_24bit+0x68> <== NEVER TAKEN
4002206c: b00000c8 adrp x8, 4003b000 <bsp_section_rodata_begin+0x48>
40022070: 913b6108 add x8, x8, #0xed8
40022074: 52800006 mov w6, #0x0 // #0
**cp = itoa64[w&0x3f];
40022078: f94000a0 ldr x0, [x5]
4002207c: 14000003 b 40022088 <_crypt_b64_from_24bit+0x38>
for (i = 0; i < n; i++) {
40022080: 6b06007f cmp w3, w6
40022084: 540001a0 b.eq 400220b8 <_crypt_b64_from_24bit+0x68> // b.none
**cp = itoa64[w&0x3f];
40022088: 12001441 and w1, w2, #0x3f
for (i = 0; i < n; i++) {
4002208c: 110004c6 add w6, w6, #0x1
**cp = itoa64[w&0x3f];
40022090: 53067c42 lsr w2, w2, #6
40022094: 38614901 ldrb w1, [x8, w1, uxtw]
40022098: 39000001 strb w1, [x0]
(*cp)++;
4002209c: f94000a0 ldr x0, [x5]
if ((*buflen)-- < 0)
400220a0: b9400081 ldr w1, [x4]
(*cp)++;
400220a4: 91000400 add x0, x0, #0x1
400220a8: f90000a0 str x0, [x5]
if ((*buflen)-- < 0)
400220ac: 51000427 sub w7, w1, #0x1
400220b0: b9000087 str w7, [x4]
400220b4: 36fffe61 tbz w1, #31, 40022080 <_crypt_b64_from_24bit+0x30> <== ALWAYS TAKEN
break;
w >>= 6;
}
}
400220b8: d65f03c0 ret
400220bc: 00000000 udf #0
0000000040022010 <_crypt_to64>:
"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
void
_crypt_to64(char *s, u_long v, int n)
{
while (--n >= 0) {
40022010: 7100005f cmp w2, #0x0
40022014: 540001ad b.le 40022048 <_crypt_to64+0x38> <== NEVER TAKEN
40022018: 51000442 sub w2, w2, #0x1
4002201c: b00000c4 adrp x4, 4003b000 <bsp_section_rodata_begin+0x48>
40022020: 913b6084 add x4, x4, #0xed8
40022024: 91000442 add x2, x2, #0x1
40022028: 8b020002 add x2, x0, x2
4002202c: d503201f nop
*s++ = itoa64[v&0x3f];
40022030: 92401423 and x3, x1, #0x3f
v >>= 6;
40022034: d346fc21 lsr x1, x1, #6
*s++ = itoa64[v&0x3f];
40022038: 38636883 ldrb w3, [x4, x3]
4002203c: 38001403 strb w3, [x0], #1
while (--n >= 0) {
40022040: eb02001f cmp x0, x2
40022044: 54ffff61 b.ne 40022030 <_crypt_to64+0x20> // b.any
}
}
40022048: d65f03c0 ret
4002204c: 00000000 udf #0
0000000040020cf0 <crypt_add_format>:
&cf_default
};
void crypt_add_format(struct crypt_format *cf)
{
if (cf->link.sle_next == NULL)
40020cf0: f9400001 ldr x1, [x0]
40020cf4: b4000041 cbz x1, 40020cfc <crypt_add_format+0xc> <== ALWAYS TAKEN
SLIST_INSERT_HEAD(&cf_head, cf, link);
}
40020cf8: d65f03c0 ret <== NOT EXECUTED
SLIST_INSERT_HEAD(&cf_head, cf, link);
40020cfc: 90000701 adrp x1, 40100000 <_RTEMS_tasks_Information>
40020d00: f9408022 ldr x2, [x1, #256]
40020d04: f9008020 str x0, [x1, #256]
40020d08: f9000002 str x2, [x0]
}
40020d0c: d65f03c0 ret
0000000040020d90 <crypt_md5_r>:
* UNIX password
*/
char *
crypt_md5_r(const char *pw, const char *salt, struct crypt_data *data)
{
40020d90: a9ac7bfd stp x29, x30, [sp, #-320]!
40020d94: 910003fd mov x29, sp
40020d98: a90153f3 stp x19, x20, [sp, #16]
40020d9c: aa0003f4 mov x20, x0
40020da0: a9025bf5 stp x21, x22, [sp, #32]
40020da4: a90363f7 stp x23, x24, [sp, #48]
40020da8: a9046bf9 stp x25, x26, [sp, #64]
40020dac: aa0103fa mov x26, x1
40020db0: a90573fb stp x27, x28, [sp, #80]
40020db4: aa0203fc mov x28, x2
/* Refine the Salt first */
sp = salt;
/* If it starts with the magic string, then skip that */
if(!strncmp(sp, magic, strlen(magic)))
40020db8: 39400020 ldrb w0, [x1]
40020dbc: 7100901f cmp w0, #0x24
40020dc0: 54000081 b.ne 40020dd0 <crypt_md5_r+0x40> // b.any <== NEVER TAKEN
40020dc4: 39400420 ldrb w0, [x1, #1]
40020dc8: 7100c41f cmp w0, #0x31
40020dcc: 54001dc0 b.eq 40021184 <crypt_md5_r+0x3f4> // b.none <== ALWAYS TAKEN
sp += strlen(magic);
/* It stops at the first '$', max 8 chars */
for(ep = sp; *ep && *ep != '$' && ep < (sp + 8); ep++)
40020dd0: 39400340 ldrb w0, [x26]
40020dd4: 7100901f cmp w0, #0x24
40020dd8: 7a401804 ccmp w0, #0x0, #0x4, ne // ne = any
40020ddc: 54001de0 b.eq 40021198 <crypt_md5_r+0x408> // b.none <== NEVER TAKEN
40020de0: 91002342 add x2, x26, #0x8
40020de4: aa1a03e0 mov x0, x26
40020de8: 38401c01 ldrb w1, [x0, #1]!
40020dec: 7100903f cmp w1, #0x24
40020df0: 7a401824 ccmp w1, #0x0, #0x4, ne // ne = any
40020df4: 54000060 b.eq 40020e00 <crypt_md5_r+0x70> // b.none
40020df8: eb02001f cmp x0, x2
40020dfc: 54ffff61 b.ne 40020de8 <crypt_md5_r+0x58> // b.any <== ALWAYS TAKEN
continue;
/* get the length of the true salt */
sl = ep - sp;
40020e00: cb1a0000 sub x0, x0, x26
/* Then our magic string */
MD5Update(&ctx, (const u_char *)magic, strlen(magic));
/* Then the raw salt */
MD5Update(&ctx, (const u_char *)sp, (u_int)sl);
40020e04: 2a0003fb mov w27, w0
else
MD5Update(&ctx, (const u_char *)pw, 1);
/* Now make the output string */
strcpy(passwd, magic);
strncat(passwd, sp, (u_int)sl);
40020e08: 92407c15 and x21, x0, #0xffffffff
MD5Init(&ctx);
40020e0c: 9101c3e0 add x0, sp, #0x70
40020e10: 94001384 bl 40025c20 <MD5Init>
MD5Update(&ctx, (const u_char *)pw, strlen(pw));
40020e14: aa1403e0 mov x0, x20
40020e18: 94004aa2 bl 400338a0 <strlen>
40020e1c: aa1403e1 mov x1, x20
40020e20: 2a0003e2 mov w2, w0
40020e24: 9101c3e0 add x0, sp, #0x70
40020e28: 9400138a bl 40025c50 <MD5Update>
MD5Update(&ctx, (const u_char *)magic, strlen(magic));
40020e2c: 9101c3e0 add x0, sp, #0x70
40020e30: 52800062 mov w2, #0x3 // #3
40020e34: f00000c1 adrp x1, 4003b000 <bsp_section_rodata_begin+0x48>
40020e38: 913a4021 add x1, x1, #0xe90
40020e3c: 94001385 bl 40025c50 <MD5Update>
MD5Update(&ctx, (const u_char *)sp, (u_int)sl);
40020e40: 2a1b03e2 mov w2, w27
40020e44: aa1a03e1 mov x1, x26
40020e48: 9101c3e0 add x0, sp, #0x70
40020e4c: 94001381 bl 40025c50 <MD5Update>
MD5Init(&ctx1);
40020e50: 910363e0 add x0, sp, #0xd8
40020e54: 94001373 bl 40025c20 <MD5Init>
MD5Update(&ctx1, (const u_char *)pw, strlen(pw));
40020e58: aa1403e0 mov x0, x20
40020e5c: 94004a91 bl 400338a0 <strlen>
40020e60: aa1403e1 mov x1, x20
40020e64: 2a0003e2 mov w2, w0
40020e68: 910363e0 add x0, sp, #0xd8
40020e6c: 94001379 bl 40025c50 <MD5Update>
MD5Update(&ctx1, (const u_char *)sp, (u_int)sl);
40020e70: 2a1b03e2 mov w2, w27
40020e74: aa1a03e1 mov x1, x26
40020e78: 910363e0 add x0, sp, #0xd8
40020e7c: 94001375 bl 40025c50 <MD5Update>
MD5Update(&ctx1, (const u_char *)pw, strlen(pw));
40020e80: aa1403e0 mov x0, x20
40020e84: 94004a87 bl 400338a0 <strlen>
40020e88: 2a0003e2 mov w2, w0
40020e8c: aa1403e1 mov x1, x20
40020e90: 910363e0 add x0, sp, #0xd8
40020e94: 9400136f bl 40025c50 <MD5Update>
MD5Final(final, &ctx1);
40020e98: 910363e1 add x1, sp, #0xd8
40020e9c: 910183e0 add x0, sp, #0x60
40020ea0: 9400139c bl 40025d10 <MD5Final>
for(pl = (int)strlen(pw); pl > 0; pl -= MD5_SIZE)
40020ea4: aa1403e0 mov x0, x20
40020ea8: 94004a7e bl 400338a0 <strlen>
40020eac: 7100001f cmp w0, #0x0
40020eb0: 2a0003f3 mov w19, w0
40020eb4: 540001ed b.le 40020ef0 <crypt_md5_r+0x160> <== NEVER TAKEN
40020eb8: 51000416 sub w22, w0, #0x1
40020ebc: 51004000 sub w0, w0, #0x10
40020ec0: 121c6ed6 and w22, w22, #0xfffffff0
(u_int)(pl > MD5_SIZE ? MD5_SIZE : pl));
40020ec4: 52800217 mov w23, #0x10 // #16
40020ec8: 4b160016 sub w22, w0, w22
40020ecc: d503201f nop
40020ed0: 7100427f cmp w19, #0x10
MD5Update(&ctx, (const u_char *)final,
40020ed4: 910183e1 add x1, sp, #0x60
40020ed8: 1a97d262 csel w2, w19, w23, le
40020edc: 9101c3e0 add x0, sp, #0x70
for(pl = (int)strlen(pw); pl > 0; pl -= MD5_SIZE)
40020ee0: 51004273 sub w19, w19, #0x10
MD5Update(&ctx, (const u_char *)final,
40020ee4: 9400135b bl 40025c50 <MD5Update>
for(pl = (int)strlen(pw); pl > 0; pl -= MD5_SIZE)
40020ee8: 6b16027f cmp w19, w22
40020eec: 54ffff21 b.ne 40020ed0 <crypt_md5_r+0x140> // b.any <== NEVER TAKEN
for (i = strlen(pw); i; i >>= 1)
40020ef0: aa1403e0 mov x0, x20
memset(final, 0, sizeof(final));
40020ef4: a9067fff stp xzr, xzr, [sp, #96]
for (i = strlen(pw); i; i >>= 1)
40020ef8: 94004a6a bl 400338a0 <strlen>
40020efc: 2a0003f3 mov w19, w0
40020f00: 350000e0 cbnz w0, 40020f1c <crypt_md5_r+0x18c> <== ALWAYS TAKEN
40020f04: 1400000d b 40020f38 <crypt_md5_r+0x1a8> <== NOT EXECUTED
MD5Update(&ctx, (const u_char *)final, 1);
40020f08: 910183e1 add x1, sp, #0x60
40020f0c: 9101c3e0 add x0, sp, #0x70
for (i = strlen(pw); i; i >>= 1)
40020f10: 53017e73 lsr w19, w19, #1
MD5Update(&ctx, (const u_char *)final, 1);
40020f14: 9400134f bl 40025c50 <MD5Update>
for (i = strlen(pw); i; i >>= 1)
40020f18: 34000113 cbz w19, 40020f38 <crypt_md5_r+0x1a8>
MD5Update(&ctx, (const u_char *)final, 1);
40020f1c: 52800022 mov w2, #0x1 // #1
if(i & 1)
40020f20: 3707ff53 tbnz w19, #0, 40020f08 <crypt_md5_r+0x178>
MD5Update(&ctx, (const u_char *)pw, 1);
40020f24: aa1403e1 mov x1, x20
40020f28: 9101c3e0 add x0, sp, #0x70
for (i = strlen(pw); i; i >>= 1)
40020f2c: 53017e73 lsr w19, w19, #1
MD5Update(&ctx, (const u_char *)pw, 1);
40020f30: 94001348 bl 40025c50 <MD5Update>
for (i = strlen(pw); i; i >>= 1)
40020f34: 35ffff53 cbnz w19, 40020f1c <crypt_md5_r+0x18c> <== ALWAYS TAKEN
strncat(passwd, sp, (u_int)sl);
40020f38: aa1503e2 mov x2, x21
strcpy(passwd, magic);
40020f3c: 52800623 mov w3, #0x31 // #49
strncat(passwd, sp, (u_int)sl);
40020f40: aa1a03e1 mov x1, x26
strcpy(passwd, magic);
40020f44: 52800495 mov w21, #0x24 // #36
40020f48: 39000395 strb w21, [x28]
strncat(passwd, sp, (u_int)sl);
40020f4c: aa1c03e0 mov x0, x28
strcpy(passwd, magic);
40020f50: 39000783 strb w3, [x28, #1]
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);
40020f54: 52955579 mov w25, #0xaaab // #43691
40020f58: 72b55559 movk w25, #0xaaaa, lsl #16
strcpy(passwd, magic);
40020f5c: 39000b95 strb w21, [x28, #2]
40020f60: 39000f9f strb wzr, [x28, #3]
if(i % 3)
MD5Update(&ctx1, (const u_char *)sp, (u_int)sl);
40020f64: 528db6f7 mov w23, #0x6db7 // #28087
40020f68: 72b6db77 movk w23, #0xb6db, lsl #16
if(i % 7)
40020f6c: 52892496 mov w22, #0x4924 // #18724
40020f70: 72a49256 movk w22, #0x2492, lsl #16
strncat(passwd, sp, (u_int)sl);
40020f74: 94004a5c bl 400338e4 <strncat>
strcat(passwd, "$");
40020f78: aa1c03e0 mov x0, x28
40020f7c: 94004a49 bl 400338a0 <strlen>
40020f80: aa0003e2 mov x2, x0
40020f84: 8b000383 add x3, x28, x0
MD5Final(final, &ctx);
40020f88: 9101c3e1 add x1, sp, #0x70
40020f8c: 910183e0 add x0, sp, #0x60
for(i = 0; i < 1000; i++) {
40020f90: 52800013 mov w19, #0x0 // #0
if(i % 3)
40020f94: 3200f3f8 mov w24, #0x55555555 // #1431655765
strcat(passwd, "$");
40020f98: 38226b95 strb w21, [x28, x2]
40020f9c: 3900047f strb wzr, [x3, #1]
MD5Final(final, &ctx);
40020fa0: 9400135c bl 40025d10 <MD5Final>
for(i = 0; i < 1000; i++) {
40020fa4: d503201f nop
MD5Init(&ctx1);
40020fa8: 910363e0 add x0, sp, #0xd8
if(i & 1)
40020fac: 12000275 and w21, w19, #0x1
MD5Init(&ctx1);
40020fb0: 9400131c bl 40025c20 <MD5Init>
if(i & 1)
40020fb4: 36000d13 tbz w19, #0, 40021154 <crypt_md5_r+0x3c4>
MD5Update(&ctx1, (const u_char *)pw, strlen(pw));
40020fb8: aa1403e0 mov x0, x20
40020fbc: 94004a39 bl 400338a0 <strlen>
40020fc0: aa1403e1 mov x1, x20
40020fc4: 2a0003e2 mov w2, w0
40020fc8: 910363e0 add x0, sp, #0xd8
40020fcc: 94001321 bl 40025c50 <MD5Update>
MD5Update(&ctx1, (const u_char *)final, MD5_SIZE);
40020fd0: 1b197e60 mul w0, w19, w25
if(i % 3)
40020fd4: 6b18001f cmp w0, w24
40020fd8: 54000cc8 b.hi 40021170 <crypt_md5_r+0x3e0> // b.pmore
MD5Update(&ctx1, (const u_char *)sp, (u_int)sl);
40020fdc: 1b177e60 mul w0, w19, w23
if(i % 7)
40020fe0: 6b16001f cmp w0, w22
40020fe4: 540009c8 b.hi 4002111c <crypt_md5_r+0x38c> // b.pmore
MD5Update(&ctx1, (const u_char *)pw, strlen(pw));
if(i & 1)
40020fe8: 34000a95 cbz w21, 40021138 <crypt_md5_r+0x3a8>
MD5Update(&ctx1, (const u_char *)final, MD5_SIZE);
40020fec: 910183e1 add x1, sp, #0x60
40020ff0: 910363e0 add x0, sp, #0xd8
40020ff4: 52800202 mov w2, #0x10 // #16
40020ff8: 94001316 bl 40025c50 <MD5Update>
for(i = 0; i < 1000; i++) {
40020ffc: 11000673 add w19, w19, #0x1
else
MD5Update(&ctx1, (const u_char *)pw, strlen(pw));
MD5Final(final, &ctx1);
40021000: 910363e1 add x1, sp, #0xd8
40021004: 910183e0 add x0, sp, #0x60
40021008: 94001342 bl 40025d10 <MD5Final>
for(i = 0; i < 1000; i++) {
4002100c: 710fa27f cmp w19, #0x3e8
40021010: 54fffcc1 b.ne 40020fa8 <crypt_md5_r+0x218> // b.any
}
p = passwd + strlen(passwd);
40021014: aa1c03e0 mov x0, x28
40021018: 94004a22 bl 400338a0 <strlen>
l = (final[ 0]<<16) | (final[ 6]<<8) | final[12];
4002101c: 39419be3 ldrb w3, [sp, #102]
p = passwd + strlen(passwd);
40021020: 8b000393 add x19, x28, x0
l = (final[ 0]<<16) | (final[ 6]<<8) | final[12];
40021024: 394183e1 ldrb w1, [sp, #96]
_crypt_to64(p, l, 4); p += 4;
40021028: aa1303e0 mov x0, x19
l = (final[ 0]<<16) | (final[ 6]<<8) | final[12];
4002102c: 3941b3e4 ldrb w4, [sp, #108]
_crypt_to64(p, l, 4); p += 4;
40021030: 52800082 mov w2, #0x4 // #4
l = (final[ 0]<<16) | (final[ 6]<<8) | final[12];
40021034: 53185c63 lsl w3, w3, #8
40021038: 2a014061 orr w1, w3, w1, lsl #16
4002103c: 2a040021 orr w1, w1, w4
_crypt_to64(p, l, 4); p += 4;
40021040: 92405c21 and x1, x1, #0xffffff
40021044: 940003f3 bl 40022010 <_crypt_to64>
l = (final[ 1]<<16) | (final[ 7]<<8) | final[13];
40021048: 39419fe3 ldrb w3, [sp, #103]
_crypt_to64(p, l, 4); p += 4;
4002104c: 91001260 add x0, x19, #0x4
l = (final[ 1]<<16) | (final[ 7]<<8) | final[13];
40021050: 394187e1 ldrb w1, [sp, #97]
_crypt_to64(p, l, 4); p += 4;
40021054: 52800082 mov w2, #0x4 // #4
l = (final[ 1]<<16) | (final[ 7]<<8) | final[13];
40021058: 3941b7e4 ldrb w4, [sp, #109]
4002105c: 53185c63 lsl w3, w3, #8
40021060: 2a014061 orr w1, w3, w1, lsl #16
40021064: 2a040021 orr w1, w1, w4
_crypt_to64(p, l, 4); p += 4;
40021068: 92405c21 and x1, x1, #0xffffff
4002106c: 940003e9 bl 40022010 <_crypt_to64>
l = (final[ 2]<<16) | (final[ 8]<<8) | final[14];
40021070: 3941a3e3 ldrb w3, [sp, #104]
_crypt_to64(p, l, 4); p += 4;
40021074: 91002260 add x0, x19, #0x8
l = (final[ 2]<<16) | (final[ 8]<<8) | final[14];
40021078: 39418be1 ldrb w1, [sp, #98]
_crypt_to64(p, l, 4); p += 4;
4002107c: 52800082 mov w2, #0x4 // #4
l = (final[ 2]<<16) | (final[ 8]<<8) | final[14];
40021080: 3941bbe4 ldrb w4, [sp, #110]
40021084: 53185c63 lsl w3, w3, #8
40021088: 2a014061 orr w1, w3, w1, lsl #16
4002108c: 2a040021 orr w1, w1, w4
_crypt_to64(p, l, 4); p += 4;
40021090: 92405c21 and x1, x1, #0xffffff
40021094: 940003df bl 40022010 <_crypt_to64>
l = (final[ 3]<<16) | (final[ 9]<<8) | final[15];
40021098: 3941a7e3 ldrb w3, [sp, #105]
_crypt_to64(p, l, 4); p += 4;
4002109c: 91003260 add x0, x19, #0xc
l = (final[ 3]<<16) | (final[ 9]<<8) | final[15];
400210a0: 39418fe1 ldrb w1, [sp, #99]
_crypt_to64(p, l, 4); p += 4;
400210a4: 52800082 mov w2, #0x4 // #4
l = (final[ 3]<<16) | (final[ 9]<<8) | final[15];
400210a8: 3941bfe4 ldrb w4, [sp, #111]
400210ac: 53185c63 lsl w3, w3, #8
400210b0: 2a014061 orr w1, w3, w1, lsl #16
400210b4: 2a040021 orr w1, w1, w4
_crypt_to64(p, l, 4); p += 4;
400210b8: 92405c21 and x1, x1, #0xffffff
400210bc: 940003d5 bl 40022010 <_crypt_to64>
l = (final[ 4]<<16) | (final[10]<<8) | final[ 5];
400210c0: 3941abe3 ldrb w3, [sp, #106]
_crypt_to64(p, l, 4); p += 4;
400210c4: 91004260 add x0, x19, #0x10
l = (final[ 4]<<16) | (final[10]<<8) | final[ 5];
400210c8: 394193e1 ldrb w1, [sp, #100]
_crypt_to64(p, l, 4); p += 4;
400210cc: 52800082 mov w2, #0x4 // #4
l = (final[ 4]<<16) | (final[10]<<8) | final[ 5];
400210d0: 394197e4 ldrb w4, [sp, #101]
400210d4: 53185c63 lsl w3, w3, #8
400210d8: 2a014061 orr w1, w3, w1, lsl #16
400210dc: 2a040021 orr w1, w1, w4
_crypt_to64(p, l, 4); p += 4;
400210e0: 92405c21 and x1, x1, #0xffffff
400210e4: 940003cb bl 40022010 <_crypt_to64>
l = final[11];
_crypt_to64(p, l, 2); p += 2;
400210e8: 3941afe1 ldrb w1, [sp, #107]
400210ec: 91005260 add x0, x19, #0x14
400210f0: 52800042 mov w2, #0x2 // #2
400210f4: 940003c7 bl 40022010 <_crypt_to64>
*p = '\0';
400210f8: 39005a7f strb wzr, [x19, #22]
/* Don't leave anything around in vm they could use. */
memset(final, 0, sizeof(final));
return (passwd);
}
400210fc: aa1c03e0 mov x0, x28
40021100: a94153f3 ldp x19, x20, [sp, #16]
40021104: a9425bf5 ldp x21, x22, [sp, #32]
40021108: a94363f7 ldp x23, x24, [sp, #48]
4002110c: a9446bf9 ldp x25, x26, [sp, #64]
40021110: a94573fb ldp x27, x28, [sp, #80]
40021114: a8d47bfd ldp x29, x30, [sp], #320
40021118: d65f03c0 ret
MD5Update(&ctx1, (const u_char *)pw, strlen(pw));
4002111c: aa1403e0 mov x0, x20
40021120: 940049e0 bl 400338a0 <strlen>
40021124: aa1403e1 mov x1, x20
40021128: 2a0003e2 mov w2, w0
4002112c: 910363e0 add x0, sp, #0xd8
40021130: 940012c8 bl 40025c50 <MD5Update>
if(i & 1)
40021134: 35fff5d5 cbnz w21, 40020fec <crypt_md5_r+0x25c>
MD5Update(&ctx1, (const u_char *)pw, strlen(pw));
40021138: aa1403e0 mov x0, x20
4002113c: 940049d9 bl 400338a0 <strlen>
40021140: aa1403e1 mov x1, x20
40021144: 2a0003e2 mov w2, w0
40021148: 910363e0 add x0, sp, #0xd8
4002114c: 940012c1 bl 40025c50 <MD5Update>
40021150: 17ffffab b 40020ffc <crypt_md5_r+0x26c>
MD5Update(&ctx1, (const u_char *)final, MD5_SIZE);
40021154: 910363e0 add x0, sp, #0xd8
40021158: 910183e1 add x1, sp, #0x60
4002115c: 52800202 mov w2, #0x10 // #16
40021160: 940012bc bl 40025c50 <MD5Update>
40021164: 1b197e60 mul w0, w19, w25
if(i % 3)
40021168: 6b18001f cmp w0, w24
4002116c: 54fff389 b.ls 40020fdc <crypt_md5_r+0x24c> // b.plast
MD5Update(&ctx1, (const u_char *)sp, (u_int)sl);
40021170: 2a1b03e2 mov w2, w27
40021174: aa1a03e1 mov x1, x26
40021178: 910363e0 add x0, sp, #0xd8
4002117c: 940012b5 bl 40025c50 <MD5Update>
40021180: 17ffff97 b 40020fdc <crypt_md5_r+0x24c>
if(!strncmp(sp, magic, strlen(magic)))
40021184: 39400821 ldrb w1, [x1, #2]
sp += strlen(magic);
40021188: 91000f40 add x0, x26, #0x3
4002118c: 7100903f cmp w1, #0x24
40021190: 9a9a001a csel x26, x0, x26, eq // eq = none
40021194: 17ffff0f b 40020dd0 <crypt_md5_r+0x40>
for(ep = sp; *ep && *ep != '$' && ep < (sp + 8); ep++)
40021198: d2800015 mov x21, #0x0 // #0 <== NOT EXECUTED
4002119c: 5280001b mov w27, #0x0 // #0 <== NOT EXECUTED
400211a0: 17ffff1b b 40020e0c <crypt_md5_r+0x7c> <== NOT EXECUTED
...
0000000040020d10 <crypt_r>:
char *
crypt_r(const char *passwd, const char *salt, struct crypt_data *data)
{
40020d10: a9bc7bfd stp x29, x30, [sp, #-64]!
40020d14: 910003fd mov x29, sp
40020d18: f9001bf7 str x23, [sp, #48]
const struct crypt_format *cf;
SLIST_FOREACH(cf, &cf_head, link)
40020d1c: 90000703 adrp x3, 40100000 <_RTEMS_tasks_Information>
40020d20: f9408077 ldr x23, [x3, #256]
{
40020d24: a90153f3 stp x19, x20, [sp, #16]
40020d28: aa0103f4 mov x20, x1
40020d2c: a9025bf5 stp x21, x22, [sp, #32]
40020d30: aa0003f5 mov x21, x0
40020d34: aa0203f6 mov x22, x2
SLIST_FOREACH(cf, &cf_head, link)
40020d38: b4000157 cbz x23, 40020d60 <crypt_r+0x50> <== NEVER TAKEN
40020d3c: aa1703f3 mov x19, x23
if (cf->magic != NULL && strstr(salt, cf->magic) == salt)
40020d40: f9400a61 ldr x1, [x19, #16]
40020d44: aa1403e0 mov x0, x20
40020d48: b4000081 cbz x1, 40020d58 <crypt_r+0x48>
40020d4c: 94004b5f bl 40033ac8 <strstr>
40020d50: eb00029f cmp x20, x0
40020d54: 540001a0 b.eq 40020d88 <crypt_r+0x78> // b.none
SLIST_FOREACH(cf, &cf_head, link)
40020d58: f9400273 ldr x19, [x19]
40020d5c: b5ffff33 cbnz x19, 40020d40 <crypt_r+0x30>
return (cf->func(passwd, salt, data));
cf = SLIST_FIRST(&cf_head);
return (cf->func(passwd, salt, data));
40020d60: f94006e3 ldr x3, [x23, #8]
40020d64: aa1603e2 mov x2, x22
40020d68: aa1403e1 mov x1, x20
40020d6c: aa1503e0 mov x0, x21
}
40020d70: a94153f3 ldp x19, x20, [sp, #16]
return (cf->func(passwd, salt, data));
40020d74: aa0303f0 mov x16, x3
}
40020d78: a9425bf5 ldp x21, x22, [sp, #32]
40020d7c: f9401bf7 ldr x23, [sp, #48]
40020d80: a8c47bfd ldp x29, x30, [sp], #64
return (cf->func(passwd, salt, data));
40020d84: d61f0200 br x16
return (cf->func(passwd, salt, data));
40020d88: f9400663 ldr x3, [x19, #8]
40020d8c: 17fffff6 b 40020d64 <crypt_r+0x54>
00000000400211b0 <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)
{
400211b0: a9a57bfd stp x29, x30, [sp, #-432]!
size_t salt_len, key_len, cnt, rounds;
char *cp, *copied_key, *copied_salt, *p_bytes, *s_bytes, *endp;
const char *num;
bool rounds_custom;
char *buffer = &data->buffer[0];
int buflen = (int)sizeof(data->buffer);
400211b4: 52802003 mov w3, #0x100 // #256
{
400211b8: 910003fd mov x29, sp
400211bc: a90153f3 stp x19, x20, [sp, #16]
400211c0: a9025bf5 stp x21, x22, [sp, #32]
400211c4: aa0103f6 mov x22, x1
400211c8: a90363f7 stp x23, x24, [sp, #48]
400211cc: aa0003f7 mov x23, x0
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)
400211d0: 52800480 mov w0, #0x24 // #36
{
400211d4: a9046bf9 stp x25, x26, [sp, #64]
400211d8: a90573fb stp x27, x28, [sp, #80]
if (strncmp(sha256_salt_prefix, salt, sizeof(sha256_salt_prefix) - 1) == 0)
400211dc: 39400021 ldrb w1, [x1]
{
400211e0: f9003fa2 str x2, [x29, #120]
int buflen = (int)sizeof(data->buffer);
400211e4: b9008fa3 str w3, [x29, #140]
if (strncmp(sha256_salt_prefix, salt, sizeof(sha256_salt_prefix) - 1) == 0)
400211e8: 6b01001f cmp w0, w1
400211ec: 54000081 b.ne 400211fc <crypt_sha256_r+0x4c> // b.any <== NEVER TAKEN
400211f0: 394006c1 ldrb w1, [x22, #1]
400211f4: 7100d43f cmp w1, #0x35
400211f8: 54002a20 b.eq 4002173c <crypt_sha256_r+0x58c> // b.none <== ALWAYS TAKEN
/* Skip salt prefix. */
salt += sizeof(sha256_salt_prefix) - 1;
if (strncmp(salt, sha256_rounds_prefix, sizeof(sha256_rounds_prefix) - 1)
400211fc: d00000c0 adrp x0, 4003b000 <bsp_section_rodata_begin+0x48>
40021200: 913ac000 add x0, x0, #0xeb0
40021204: aa0003e1 mov x1, x0
40021208: d28000e2 mov x2, #0x7 // #7
rounds = ROUNDS_DEFAULT;
4002120c: d2827119 mov x25, #0x1388 // #5000
if (strncmp(salt, sha256_rounds_prefix, sizeof(sha256_rounds_prefix) - 1)
40021210: f90037a0 str x0, [x29, #104]
40021214: aa1603e0 mov x0, x22
rounds_custom = false;
40021218: b90077bf str wzr, [x29, #116]
if (strncmp(salt, sha256_rounds_prefix, sizeof(sha256_rounds_prefix) - 1)
4002121c: 940049d9 bl 40033980 <strncmp>
40021220: 34002b60 cbz w0, 4002178c <crypt_sha256_r+0x5dc>
rounds = MAX(ROUNDS_MIN, MIN(srounds, ROUNDS_MAX));
rounds_custom = true;
}
}
salt_len = MIN(strcspn(salt, "$"), SALT_LEN_MAX);
40021224: aa1603e0 mov x0, x22
40021228: d00000c1 adrp x1, 4003b000 <bsp_section_rodata_begin+0x48>
4002122c: 913a6021 add x1, x1, #0xe98
40021230: 94004945 bl 40033744 <strcspn>
40021234: aa0003f5 mov x21, x0
40021238: d2800201 mov x1, #0x10 // #16
4002123c: eb0102bf cmp x21, x1
key_len = strlen(key);
40021240: aa1703e0 mov x0, x23
salt_len = MIN(strcspn(salt, "$"), SALT_LEN_MAX);
40021244: 9a8132b5 csel x21, x21, x1, cc // cc = lo, ul, last
key_len = strlen(key);
40021248: 94004996 bl 400338a0 <strlen>
4002124c: aa0003f4 mov x20, x0
/* Prepare for the real work. */
SHA256_Init(&ctx);
40021250: 910383a0 add x0, x29, #0xe0
40021254: 940018eb bl 40027600 <SHA256_Init>
/* Add the key string. */
SHA256_Update(&ctx, key, key_len);
40021258: aa1403e2 mov x2, x20
4002125c: aa1703e1 mov x1, x23
40021260: 910383a0 add x0, x29, #0xe0
40021264: 940018fb bl 40027650 <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);
40021268: aa1503e2 mov x2, x21
4002126c: aa1603e1 mov x1, x22
40021270: 910383a0 add x0, x29, #0xe0
40021274: 940018f7 bl 40027650 <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);
40021278: 910523a0 add x0, x29, #0x148
4002127c: 940018e1 bl 40027600 <SHA256_Init>
/* Add key. */
SHA256_Update(&alt_ctx, key, key_len);
40021280: aa1403e2 mov x2, x20
40021284: aa1703e1 mov x1, x23
40021288: 910523a0 add x0, x29, #0x148
4002128c: 940018f1 bl 40027650 <SHA256_Update>
/* Add salt. */
SHA256_Update(&alt_ctx, salt, salt_len);
40021290: aa1503e2 mov x2, x21
40021294: aa1603e1 mov x1, x22
40021298: 910523a0 add x0, x29, #0x148
4002129c: 940018ed bl 40027650 <SHA256_Update>
/* Add key again. */
SHA256_Update(&alt_ctx, key, key_len);
400212a0: aa1403e2 mov x2, x20
400212a4: aa1703e1 mov x1, x23
400212a8: 910523a0 add x0, x29, #0x148
400212ac: 940018e9 bl 40027650 <SHA256_Update>
/* Now get result of this (32 bytes) and add it to the other context. */
SHA256_Final(alt_result, &alt_ctx);
400212b0: 910523a1 add x1, x29, #0x148
400212b4: 910283a0 add x0, x29, #0xa0
400212b8: 9400191a bl 40027720 <SHA256_Final>
/* Add for any character in the key one byte of the alternate sum. */
for (cnt = key_len; cnt > 32; cnt -= 32)
400212bc: f100829f cmp x20, #0x20
400212c0: 54002969 b.ls 400217ec <crypt_sha256_r+0x63c> // b.plast
400212c4: aa1403f3 mov x19, x20
400212c8: d1008273 sub x19, x19, #0x20
SHA256_Update(&ctx, alt_result, 32);
400212cc: 910283a1 add x1, x29, #0xa0
400212d0: 910383a0 add x0, x29, #0xe0
400212d4: d2800402 mov x2, #0x20 // #32
400212d8: 940018de bl 40027650 <SHA256_Update>
for (cnt = key_len; cnt > 32; cnt -= 32)
400212dc: f100827f cmp x19, #0x20
400212e0: 54ffff48 b.hi 400212c8 <crypt_sha256_r+0x118> // b.pmore
400212e4: d1008683 sub x3, x20, #0x21
400212e8: d1008282 sub x2, x20, #0x20
SHA256_Update(&ctx, alt_result, cnt);
400212ec: 910283a1 add x1, x29, #0xa0
400212f0: 910383a0 add x0, x29, #0xe0
for (cnt = key_len; cnt > 32; cnt -= 32)
400212f4: cb4317e3 neg x3, x3, lsr #5
SHA256_Update(&ctx, alt_result, cnt);
400212f8: 8b031442 add x2, x2, x3, lsl #5
400212fc: 940018d5 bl 40027650 <SHA256_Update>
key_len = strlen(key);
40021300: aa1403f3 mov x19, x20
40021304: d503201f nop
/* 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)
40021308: 36002113 tbz w19, #0, 40021728 <crypt_sha256_r+0x578>
SHA256_Update(&ctx, alt_result, 32);
4002130c: 910283a1 add x1, x29, #0xa0
40021310: 910383a0 add x0, x29, #0xe0
40021314: d2800402 mov x2, #0x20 // #32
40021318: 940018ce bl 40027650 <SHA256_Update>
for (cnt = key_len; cnt > 0; cnt >>= 1)
4002131c: d341fe73 lsr x19, x19, #1
40021320: b5ffff53 cbnz x19, 40021308 <crypt_sha256_r+0x158>
else
SHA256_Update(&ctx, key, key_len);
/* Create intermediate result. */
SHA256_Final(alt_result, &ctx);
40021324: 910383a1 add x1, x29, #0xe0
40021328: 910283a0 add x0, x29, #0xa0
4002132c: 940018fd bl 40027720 <SHA256_Final>
/* Start computation of P byte sequence. */
SHA256_Init(&alt_ctx);
40021330: 910523a0 add x0, x29, #0x148
40021334: 940018b3 bl 40027600 <SHA256_Init>
/* For every character in the password add the entire password. */
for (cnt = 0; cnt < key_len; ++cnt)
40021338: 91000673 add x19, x19, #0x1
SHA256_Update(&alt_ctx, key, key_len);
4002133c: aa1403e2 mov x2, x20
40021340: aa1703e1 mov x1, x23
40021344: 910523a0 add x0, x29, #0x148
40021348: 940018c2 bl 40027650 <SHA256_Update>
for (cnt = 0; cnt < key_len; ++cnt)
4002134c: eb13029f cmp x20, x19
40021350: 54ffff48 b.hi 40021338 <crypt_sha256_r+0x188> // b.pmore
/* Finish the digest. */
SHA256_Final(temp_result, &alt_ctx);
40021354: 910303b7 add x23, x29, #0xc0
40021358: 910523a1 add x1, x29, #0x148
4002135c: aa1703e0 mov x0, x23
40021360: 940018f0 bl 40027720 <SHA256_Final>
/* Create byte sequence P. */
cp = p_bytes = alloca(key_len);
40021364: 91003e80 add x0, x20, #0xf
for (cnt = key_len; cnt >= 32; cnt -= 32) {
40021368: f1007e9f cmp x20, #0x1f
cp = p_bytes = alloca(key_len);
4002136c: 927cec00 and x0, x0, #0xfffffffffffffff0
40021370: cb2063ff sub sp, sp, x0
40021374: 910003f8 mov x24, sp
40021378: f9004bb8 str x24, [x29, #144]
for (cnt = key_len; cnt >= 32; cnt -= 32) {
4002137c: aa1803e0 mov x0, x24
40021380: 540025c9 b.ls 40021838 <crypt_sha256_r+0x688> // b.plast
40021384: aa1403f3 mov x19, x20
memcpy(cp, temp_result, 32);
40021388: aa1703e1 mov x1, x23
4002138c: d2800402 mov x2, #0x20 // #32
40021390: 940047a3 bl 4003321c <memcpy>
for (cnt = key_len; cnt >= 32; cnt -= 32) {
40021394: d1008273 sub x19, x19, #0x20
cp += 32;
40021398: f9404ba0 ldr x0, [x29, #144]
for (cnt = key_len; cnt >= 32; cnt -= 32) {
4002139c: f1007e7f cmp x19, #0x1f
cp += 32;
400213a0: 91008000 add x0, x0, #0x20
400213a4: f9004ba0 str x0, [x29, #144]
for (cnt = key_len; cnt >= 32; cnt -= 32) {
400213a8: 54ffff08 b.hi 40021388 <crypt_sha256_r+0x1d8> // b.pmore
400213ac: 92401282 and x2, x20, #0x1f
}
memcpy(cp, temp_result, cnt);
400213b0: aa1703e1 mov x1, x23
400213b4: 9400479a bl 4003321c <memcpy>
/* Start computation of S byte sequence. */
SHA256_Init(&alt_ctx);
400213b8: 910523a0 add x0, x29, #0x148
/* For every character in the password add the entire password. */
for (cnt = 0; cnt < 16 + alt_result[0]; ++cnt)
400213bc: d2800013 mov x19, #0x0 // #0
SHA256_Init(&alt_ctx);
400213c0: 94001890 bl 40027600 <SHA256_Init>
for (cnt = 0; cnt < 16 + alt_result[0]; ++cnt)
400213c4: d503201f nop
SHA256_Update(&alt_ctx, salt, salt_len);
400213c8: 910523a0 add x0, x29, #0x148
400213cc: aa1503e2 mov x2, x21
400213d0: aa1603e1 mov x1, x22
400213d4: 9400189f bl 40027650 <SHA256_Update>
for (cnt = 0; cnt < 16 + alt_result[0]; ++cnt)
400213d8: 394283a0 ldrb w0, [x29, #160]
400213dc: 91000673 add x19, x19, #0x1
400213e0: 91004000 add x0, x0, #0x10
400213e4: eb13001f cmp x0, x19
400213e8: 54ffff08 b.hi 400213c8 <crypt_sha256_r+0x218> // b.pmore
/* Finish the digest. */
SHA256_Final(temp_result, &alt_ctx);
400213ec: 910523a1 add x1, x29, #0x148
400213f0: aa1703e0 mov x0, x23
400213f4: 940018cb bl 40027720 <SHA256_Final>
/* Add key or last result. */
if ((cnt & 1) != 0)
SHA256_Update(&ctx, p_bytes, key_len);
else
SHA256_Update(&ctx, alt_result, 32);
400213f8: b201f3fb mov x27, #0xaaaaaaaaaaaaaaaa // #-6148914691236517206
cp = s_bytes = alloca(salt_len);
400213fc: 91003ea0 add x0, x21, #0xf
memcpy(cp, temp_result, cnt);
40021400: aa1703e1 mov x1, x23
cp = s_bytes = alloca(salt_len);
40021404: 927cec00 and x0, x0, #0xfffffffffffffff0
memcpy(cp, temp_result, cnt);
40021408: aa1503e2 mov x2, x21
cp = s_bytes = alloca(salt_len);
4002140c: cb2063ff sub sp, sp, x0
for (cnt = 0; cnt < rounds; ++cnt) {
40021410: d2800013 mov x19, #0x0 // #0
cp = s_bytes = alloca(salt_len);
40021414: 910003fc mov x28, sp
SHA256_Update(&ctx, alt_result, 32);
40021418: f295557b movk x27, #0xaaab
memcpy(cp, temp_result, cnt);
4002141c: aa1c03e0 mov x0, x28
/* Add salt for numbers not divisible by 3. */
if (cnt % 3 != 0)
40021420: b200f3fa mov x26, #0x5555555555555555 // #6148914691236517205
cp = s_bytes = alloca(salt_len);
40021424: f9004bbc str x28, [x29, #144]
memcpy(cp, temp_result, cnt);
40021428: 9400477d bl 4003321c <memcpy>
for (cnt = 0; cnt < rounds; ++cnt) {
4002142c: d503201f nop
SHA256_Init(&ctx);
40021430: 910383a0 add x0, x29, #0xe0
if ((cnt & 1) != 0)
40021434: 92400277 and x23, x19, #0x1
SHA256_Init(&ctx);
40021438: 94001872 bl 40027600 <SHA256_Init>
if ((cnt & 1) != 0)
4002143c: 360015f3 tbz w19, #0, 400216f8 <crypt_sha256_r+0x548>
SHA256_Update(&ctx, p_bytes, key_len);
40021440: 910383a0 add x0, x29, #0xe0
40021444: aa1403e2 mov x2, x20
40021448: aa1803e1 mov x1, x24
4002144c: 94001881 bl 40027650 <SHA256_Update>
SHA256_Update(&ctx, alt_result, 32);
40021450: 9b1b7e60 mul x0, x19, x27
if (cnt % 3 != 0)
40021454: eb1a001f cmp x0, x26
40021458: 540015e8 b.hi 40021714 <crypt_sha256_r+0x564> // b.pmore
SHA256_Update(&ctx, s_bytes, salt_len);
4002145c: d28db6e0 mov x0, #0x6db7 // #28087
40021460: f2b6db60 movk x0, #0xb6db, lsl #16
40021464: f2db6da0 movk x0, #0xdb6d, lsl #32
40021468: f2edb6c0 movk x0, #0x6db6, lsl #48
/* Add key for numbers not divisible by 7. */
if (cnt % 7 != 0)
4002146c: d2849241 mov x1, #0x2492 // #9362
40021470: f2b24921 movk x1, #0x9249, lsl #16
SHA256_Update(&ctx, s_bytes, salt_len);
40021474: 9b007e60 mul x0, x19, x0
if (cnt % 7 != 0)
40021478: f2c92481 movk x1, #0x4924, lsl #32
4002147c: f2e49241 movk x1, #0x2492, lsl #48
40021480: eb01001f cmp x0, x1
40021484: 54001268 b.hi 400216d0 <crypt_sha256_r+0x520> // b.pmore
SHA256_Update(&ctx, p_bytes, key_len);
/* Add key or last result. */
if ((cnt & 1) != 0)
40021488: b40012f7 cbz x23, 400216e4 <crypt_sha256_r+0x534>
SHA256_Update(&ctx, alt_result, 32);
4002148c: 910283a1 add x1, x29, #0xa0
40021490: 910383a0 add x0, x29, #0xe0
40021494: d2800402 mov x2, #0x20 // #32
40021498: 9400186e bl 40027650 <SHA256_Update>
for (cnt = 0; cnt < rounds; ++cnt) {
4002149c: 91000673 add x19, x19, #0x1
else
SHA256_Update(&ctx, p_bytes, key_len);
/* Create intermediate result. */
SHA256_Final(alt_result, &ctx);
400214a0: 910383a1 add x1, x29, #0xe0
400214a4: 910283a0 add x0, x29, #0xa0
400214a8: 9400189e bl 40027720 <SHA256_Final>
for (cnt = 0; cnt < rounds; ++cnt) {
400214ac: eb13033f cmp x25, x19
400214b0: 54fffc01 b.ne 40021430 <crypt_sha256_r+0x280> // b.any
}
/* Now we can construct the result string. It consists of three
* parts. */
cp = stpncpy(buffer, sha256_salt_prefix, MAX(0, buflen));
400214b4: b9408fb3 ldr w19, [x29, #140]
400214b8: d00000c1 adrp x1, 4003b000 <bsp_section_rodata_begin+0x48>
400214bc: 913ae021 add x1, x1, #0xeb8
400214c0: f9403fa0 ldr x0, [x29, #120]
400214c4: 7100027f cmp w19, #0x0
400214c8: 1a9fa262 csel w2, w19, wzr, ge // ge = tcont
400214cc: 93407c42 sxtw x2, w2
400214d0: 94004840 bl 400335d0 <stpncpy>
buflen -= sizeof(sha256_salt_prefix) - 1;
if (rounds_custom) {
400214d4: b94077a1 ldr w1, [x29, #116]
buflen -= sizeof(sha256_salt_prefix) - 1;
400214d8: 71000e73 subs w19, w19, #0x3
n = snprintf(cp, MAX(0, buflen), "%s%zu$",
400214dc: 1a9f5262 csel w2, w19, wzr, pl // pl = nfrst
buflen -= sizeof(sha256_salt_prefix) - 1;
400214e0: b9008fb3 str w19, [x29, #140]
cp = stpncpy(buffer, sha256_salt_prefix, MAX(0, buflen));
400214e4: f9004ba0 str x0, [x29, #144]
400214e8: aa0003e3 mov x3, x0
n = snprintf(cp, MAX(0, buflen), "%s%zu$",
400214ec: 93407c42 sxtw x2, w2
if (rounds_custom) {
400214f0: 35001301 cbnz w1, 40021750 <crypt_sha256_r+0x5a0>
cp += n;
buflen -= n;
}
cp = stpncpy(cp, salt, MIN((size_t)MAX(0, buflen), salt_len));
400214f4: eb0202bf cmp x21, x2
400214f8: aa1603e1 mov x1, x22
400214fc: 9a8292a2 csel x2, x21, x2, ls // ls = plast
40021500: aa0303e0 mov x0, x3
40021504: 94004833 bl 400335d0 <stpncpy>
40021508: f9004ba0 str x0, [x29, #144]
buflen -= MIN((size_t)MAX(0, buflen), salt_len);
4002150c: b9408fa1 ldr w1, [x29, #140]
40021510: 7100003f cmp w1, #0x0
40021514: 1a9fa022 csel w2, w1, wzr, ge // ge = tcont
40021518: 93407c42 sxtw x2, w2
4002151c: eb15005f cmp x2, x21
40021520: 9a959055 csel x21, x2, x21, ls // ls = plast
40021524: 4b150021 sub w1, w1, w21
40021528: b9008fa1 str w1, [x29, #140]
if (buflen > 0) {
4002152c: 7100003f cmp w1, #0x0
40021530: 5400010d b.le 40021550 <crypt_sha256_r+0x3a0> <== NEVER TAKEN
*cp++ = '$';
40021534: 91000401 add x1, x0, #0x1
40021538: f9004ba1 str x1, [x29, #144]
4002153c: 52800481 mov w1, #0x24 // #36
40021540: 39000001 strb w1, [x0]
--buflen;
40021544: b9408fa0 ldr w0, [x29, #140]
40021548: 51000400 sub w0, w0, #0x1
4002154c: b9008fa0 str w0, [x29, #140]
}
b64_from_24bit(alt_result[0], alt_result[10], alt_result[20], 4, &buflen, &cp);
40021550: 394283a0 ldrb w0, [x29, #160]
40021554: 910243a5 add x5, x29, #0x90
40021558: 3942aba1 ldrb w1, [x29, #170]
4002155c: 910233a4 add x4, x29, #0x8c
40021560: 3942d3a2 ldrb w2, [x29, #180]
40021564: 52800083 mov w3, #0x4 // #4
40021568: 940002ba bl 40022050 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[21], alt_result[1], alt_result[11], 4, &buflen, &cp);
4002156c: 394287a1 ldrb w1, [x29, #161]
40021570: 910243a5 add x5, x29, #0x90
40021574: 3942afa2 ldrb w2, [x29, #171]
40021578: 910233a4 add x4, x29, #0x8c
4002157c: 3942d7a0 ldrb w0, [x29, #181]
40021580: 52800083 mov w3, #0x4 // #4
40021584: 940002b3 bl 40022050 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[12], alt_result[22], alt_result[2], 4, &buflen, &cp);
40021588: 39428ba2 ldrb w2, [x29, #162]
4002158c: 910243a5 add x5, x29, #0x90
40021590: 3942b3a0 ldrb w0, [x29, #172]
40021594: 910233a4 add x4, x29, #0x8c
40021598: 3942dba1 ldrb w1, [x29, #182]
4002159c: 52800083 mov w3, #0x4 // #4
400215a0: 940002ac bl 40022050 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[3], alt_result[13], alt_result[23], 4, &buflen, &cp);
400215a4: 39428fa0 ldrb w0, [x29, #163]
400215a8: 910243a5 add x5, x29, #0x90
400215ac: 3942b7a1 ldrb w1, [x29, #173]
400215b0: 910233a4 add x4, x29, #0x8c
400215b4: 3942dfa2 ldrb w2, [x29, #183]
400215b8: 52800083 mov w3, #0x4 // #4
400215bc: 940002a5 bl 40022050 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[24], alt_result[4], alt_result[14], 4, &buflen, &cp);
400215c0: 394293a1 ldrb w1, [x29, #164]
400215c4: 910243a5 add x5, x29, #0x90
400215c8: 3942bba2 ldrb w2, [x29, #174]
400215cc: 910233a4 add x4, x29, #0x8c
400215d0: 3942e3a0 ldrb w0, [x29, #184]
400215d4: 52800083 mov w3, #0x4 // #4
400215d8: 9400029e bl 40022050 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[15], alt_result[25], alt_result[5], 4, &buflen, &cp);
400215dc: 394297a2 ldrb w2, [x29, #165]
400215e0: 910243a5 add x5, x29, #0x90
400215e4: 3942bfa0 ldrb w0, [x29, #175]
400215e8: 910233a4 add x4, x29, #0x8c
400215ec: 3942e7a1 ldrb w1, [x29, #185]
400215f0: 52800083 mov w3, #0x4 // #4
400215f4: 94000297 bl 40022050 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[6], alt_result[16], alt_result[26], 4, &buflen, &cp);
400215f8: 39429ba0 ldrb w0, [x29, #166]
400215fc: 910243a5 add x5, x29, #0x90
40021600: 3942c3a1 ldrb w1, [x29, #176]
40021604: 910233a4 add x4, x29, #0x8c
40021608: 3942eba2 ldrb w2, [x29, #186]
4002160c: 52800083 mov w3, #0x4 // #4
40021610: 94000290 bl 40022050 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[27], alt_result[7], alt_result[17], 4, &buflen, &cp);
40021614: 39429fa1 ldrb w1, [x29, #167]
40021618: 910243a5 add x5, x29, #0x90
4002161c: 3942c7a2 ldrb w2, [x29, #177]
40021620: 910233a4 add x4, x29, #0x8c
40021624: 3942efa0 ldrb w0, [x29, #187]
40021628: 52800083 mov w3, #0x4 // #4
4002162c: 94000289 bl 40022050 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[18], alt_result[28], alt_result[8], 4, &buflen, &cp);
40021630: 3942a3a2 ldrb w2, [x29, #168]
40021634: 910243a5 add x5, x29, #0x90
40021638: 3942cba0 ldrb w0, [x29, #178]
4002163c: 910233a4 add x4, x29, #0x8c
40021640: 3942f3a1 ldrb w1, [x29, #188]
40021644: 52800083 mov w3, #0x4 // #4
40021648: 94000282 bl 40022050 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[9], alt_result[19], alt_result[29], 4, &buflen, &cp);
4002164c: 3942a7a0 ldrb w0, [x29, #169]
40021650: 910243a5 add x5, x29, #0x90
40021654: 3942cfa1 ldrb w1, [x29, #179]
40021658: 910233a4 add x4, x29, #0x8c
4002165c: 3942f7a2 ldrb w2, [x29, #189]
40021660: 52800083 mov w3, #0x4 // #4
40021664: 9400027b bl 40022050 <_crypt_b64_from_24bit>
b64_from_24bit(0, alt_result[31], alt_result[30], 3, &buflen, &cp);
40021668: 3942fba2 ldrb w2, [x29, #190]
4002166c: 52800000 mov w0, #0x0 // #0
40021670: 3942ffa1 ldrb w1, [x29, #191]
40021674: 910243a5 add x5, x29, #0x90
40021678: 910233a4 add x4, x29, #0x8c
4002167c: 52800063 mov w3, #0x3 // #3
40021680: 94000274 bl 40022050 <_crypt_b64_from_24bit>
if (buflen <= 0) {
40021684: b9408fa0 ldr w0, [x29, #140]
40021688: 7100001f cmp w0, #0x0
4002168c: 54000a6d b.le 400217d8 <crypt_sha256_r+0x628> <== NEVER TAKEN
errno = ERANGE;
buffer = NULL;
}
else
*cp = '\0'; /* Terminate the string. */
40021690: f9404ba0 ldr x0, [x29, #144]
40021694: 3900001f strb wzr, [x0]
/* 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);
40021698: 910383a0 add x0, x29, #0xe0
4002169c: 940017d9 bl 40027600 <SHA256_Init>
SHA256_Final(alt_result, &ctx);
400216a0: 910383a1 add x1, x29, #0xe0
400216a4: 910283a0 add x0, x29, #0xa0
400216a8: 9400181e bl 40027720 <SHA256_Final>
memset(copied_key, '\0', key_len);
if (copied_salt != NULL)
memset(copied_salt, '\0', salt_len);
return buffer;
}
400216ac: f9403fa0 ldr x0, [x29, #120]
400216b0: 910003bf mov sp, x29
400216b4: a94153f3 ldp x19, x20, [sp, #16]
400216b8: a9425bf5 ldp x21, x22, [sp, #32]
400216bc: a94363f7 ldp x23, x24, [sp, #48]
400216c0: a9446bf9 ldp x25, x26, [sp, #64]
400216c4: a94573fb ldp x27, x28, [sp, #80]
400216c8: a8db7bfd ldp x29, x30, [sp], #432
400216cc: d65f03c0 ret
SHA256_Update(&ctx, p_bytes, key_len);
400216d0: aa1403e2 mov x2, x20
400216d4: aa1803e1 mov x1, x24
400216d8: 910383a0 add x0, x29, #0xe0
400216dc: 940017dd bl 40027650 <SHA256_Update>
if ((cnt & 1) != 0)
400216e0: b5ffed77 cbnz x23, 4002148c <crypt_sha256_r+0x2dc>
SHA256_Update(&ctx, p_bytes, key_len);
400216e4: aa1403e2 mov x2, x20
400216e8: aa1803e1 mov x1, x24
400216ec: 910383a0 add x0, x29, #0xe0
400216f0: 940017d8 bl 40027650 <SHA256_Update>
400216f4: 17ffff6a b 4002149c <crypt_sha256_r+0x2ec>
SHA256_Update(&ctx, alt_result, 32);
400216f8: 910383a0 add x0, x29, #0xe0
400216fc: 910283a1 add x1, x29, #0xa0
40021700: d2800402 mov x2, #0x20 // #32
40021704: 940017d3 bl 40027650 <SHA256_Update>
40021708: 9b1b7e60 mul x0, x19, x27
if (cnt % 3 != 0)
4002170c: eb1a001f cmp x0, x26
40021710: 54ffea69 b.ls 4002145c <crypt_sha256_r+0x2ac> // b.plast
SHA256_Update(&ctx, s_bytes, salt_len);
40021714: aa1503e2 mov x2, x21
40021718: aa1c03e1 mov x1, x28
4002171c: 910383a0 add x0, x29, #0xe0
40021720: 940017cc bl 40027650 <SHA256_Update>
40021724: 17ffff4e b 4002145c <crypt_sha256_r+0x2ac>
SHA256_Update(&ctx, key, key_len);
40021728: aa1403e2 mov x2, x20
4002172c: aa1703e1 mov x1, x23
40021730: 910383a0 add x0, x29, #0xe0
40021734: 940017c7 bl 40027650 <SHA256_Update>
40021738: 17fffef9 b 4002131c <crypt_sha256_r+0x16c>
if (strncmp(sha256_salt_prefix, salt, sizeof(sha256_salt_prefix) - 1) == 0)
4002173c: 39400ac2 ldrb w2, [x22, #2]
salt += sizeof(sha256_salt_prefix) - 1;
40021740: 91000ec1 add x1, x22, #0x3
40021744: 6b02001f cmp w0, w2
40021748: 9a960036 csel x22, x1, x22, eq // eq = none
4002174c: 17fffeac b 400211fc <crypt_sha256_r+0x4c>
n = snprintf(cp, MAX(0, buflen), "%s%zu$",
40021750: f94037a3 ldr x3, [x29, #104]
40021754: aa0203e1 mov x1, x2
40021758: aa1903e4 mov x4, x25
4002175c: d00000c2 adrp x2, 4003b000 <bsp_section_rodata_begin+0x48>
40021760: 913a8042 add x2, x2, #0xea0
40021764: 94004744 bl 40033474 <snprintf>
buflen -= n;
40021768: b9408fa2 ldr w2, [x29, #140]
cp += n;
4002176c: f9404ba3 ldr x3, [x29, #144]
buflen -= n;
40021770: 6b000042 subs w2, w2, w0
40021774: b9008fa2 str w2, [x29, #140]
cp = stpncpy(cp, salt, MIN((size_t)MAX(0, buflen), salt_len));
40021778: 1a9f5042 csel w2, w2, wzr, pl // pl = nfrst
cp += n;
4002177c: 8b20c063 add x3, x3, w0, sxtw
cp = stpncpy(cp, salt, MIN((size_t)MAX(0, buflen), salt_len));
40021780: 93407c42 sxtw x2, w2
cp += n;
40021784: f9004ba3 str x3, [x29, #144]
buflen -= n;
40021788: 17ffff5b b 400214f4 <crypt_sha256_r+0x344>
srounds = strtoul(num, &endp, 10);
4002178c: 910263a1 add x1, x29, #0x98
40021790: 52800142 mov w2, #0xa // #10
40021794: 91001ec0 add x0, x22, #0x7
40021798: 940049ab bl 40033e44 <strtoul>
if (*endp == '$') {
4002179c: f9404fa1 ldr x1, [x29, #152]
400217a0: 39400022 ldrb w2, [x1]
400217a4: 7100905f cmp w2, #0x24
400217a8: 54ffd3e1 b.ne 40021224 <crypt_sha256_r+0x74> // b.any <== NEVER TAKEN
rounds = MAX(ROUNDS_MIN, MIN(srounds, ROUNDS_MAX));
400217ac: d2993ff9 mov x25, #0xc9ff // #51711
400217b0: f2a77359 movk x25, #0x3b9a, lsl #16
400217b4: eb19001f cmp x0, x25
salt = endp + 1;
400217b8: 91000436 add x22, x1, #0x1
rounds = MAX(ROUNDS_MIN, MIN(srounds, ROUNDS_MAX));
400217bc: 9a999019 csel x25, x0, x25, ls // ls = plast
400217c0: d2807d00 mov x0, #0x3e8 // #1000
400217c4: f10fa33f cmp x25, #0x3e8
400217c8: 9a802339 csel x25, x25, x0, cs // cs = hs, nlast
rounds_custom = true;
400217cc: 52800020 mov w0, #0x1 // #1
400217d0: b90077a0 str w0, [x29, #116]
400217d4: 17fffe94 b 40021224 <crypt_sha256_r+0x74>
errno = ERANGE;
400217d8: 94004631 bl 4003309c <__errno> <== NOT EXECUTED
buffer = NULL;
400217dc: f9003fbf str xzr, [x29, #120] <== NOT EXECUTED
errno = ERANGE;
400217e0: 52800441 mov w1, #0x22 // #34 <== NOT EXECUTED
400217e4: b9000001 str w1, [x0] <== NOT EXECUTED
buffer = NULL;
400217e8: 17ffffac b 40021698 <crypt_sha256_r+0x4e8> <== NOT EXECUTED
SHA256_Update(&ctx, alt_result, cnt);
400217ec: aa1403e2 mov x2, x20
400217f0: 910283a1 add x1, x29, #0xa0
400217f4: 910383a0 add x0, x29, #0xe0
400217f8: 94001796 bl 40027650 <SHA256_Update>
for (cnt = key_len; cnt > 0; cnt >>= 1)
400217fc: b5ffd834 cbnz x20, 40021300 <crypt_sha256_r+0x150> <== ALWAYS TAKEN
SHA256_Final(alt_result, &ctx);
40021800: 910383a1 add x1, x29, #0xe0 <== NOT EXECUTED
40021804: 910283a0 add x0, x29, #0xa0 <== NOT EXECUTED
40021808: 940017c6 bl 40027720 <SHA256_Final> <== NOT EXECUTED
SHA256_Final(temp_result, &alt_ctx);
4002180c: 910303b7 add x23, x29, #0xc0 <== NOT EXECUTED
SHA256_Init(&alt_ctx);
40021810: 910523a0 add x0, x29, #0x148 <== NOT EXECUTED
cp = p_bytes = alloca(key_len);
40021814: 910003f8 mov x24, sp <== NOT EXECUTED
SHA256_Init(&alt_ctx);
40021818: 9400177a bl 40027600 <SHA256_Init> <== NOT EXECUTED
SHA256_Final(temp_result, &alt_ctx);
4002181c: aa1703e0 mov x0, x23 <== NOT EXECUTED
40021820: 910523a1 add x1, x29, #0x148 <== NOT EXECUTED
40021824: 940017bf bl 40027720 <SHA256_Final> <== NOT EXECUTED
cp = p_bytes = alloca(key_len);
40021828: f9004bb8 str x24, [x29, #144] <== NOT EXECUTED
4002182c: 910003e0 mov x0, sp <== NOT EXECUTED
40021830: d2800002 mov x2, #0x0 // #0 <== NOT EXECUTED
40021834: 17fffedf b 400213b0 <crypt_sha256_r+0x200> <== NOT EXECUTED
for (cnt = key_len; cnt >= 32; cnt -= 32) {
40021838: aa1403e2 mov x2, x20
4002183c: 17fffedd b 400213b0 <crypt_sha256_r+0x200>
0000000040021840 <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)
{
40021840: d10b03ff sub sp, sp, #0x2c0
size_t salt_len, key_len, cnt, rounds;
char *cp, *copied_key, *copied_salt, *p_bytes, *s_bytes, *endp;
const char *num;
bool rounds_custom;
char *buffer = &data->buffer[0];
int buflen = (int)sizeof(data->buffer);
40021844: 52802003 mov w3, #0x100 // #256
{
40021848: a9007bfd stp x29, x30, [sp]
4002184c: 910003fd mov x29, sp
40021850: a90153f3 stp x19, x20, [sp, #16]
40021854: a9025bf5 stp x21, x22, [sp, #32]
40021858: aa0103f6 mov x22, x1
4002185c: a90363f7 stp x23, x24, [sp, #48]
40021860: aa0003f7 mov x23, x0
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)
40021864: 52800480 mov w0, #0x24 // #36
{
40021868: a9046bf9 stp x25, x26, [sp, #64]
4002186c: a90573fb stp x27, x28, [sp, #80]
if (strncmp(sha512_salt_prefix, salt, sizeof(sha512_salt_prefix) - 1) == 0)
40021870: 39400021 ldrb w1, [x1]
{
40021874: f9003fa2 str x2, [x29, #120]
int buflen = (int)sizeof(data->buffer);
40021878: b9008fa3 str w3, [x29, #140]
if (strncmp(sha512_salt_prefix, salt, sizeof(sha512_salt_prefix) - 1) == 0)
4002187c: 6b01001f cmp w0, w1
40021880: 54000081 b.ne 40021890 <crypt_sha512_r+0x50> // b.any
40021884: 394006c1 ldrb w1, [x22, #1]
40021888: 7100d83f cmp w1, #0x36
4002188c: 54003400 b.eq 40021f0c <crypt_sha512_r+0x6cc> // b.none <== ALWAYS TAKEN
/* Skip salt prefix. */
salt += sizeof(sha512_salt_prefix) - 1;
if (strncmp(salt, sha512_rounds_prefix, sizeof(sha512_rounds_prefix) - 1)
40021890: d00000c0 adrp x0, 4003b000 <bsp_section_rodata_begin+0x48>
40021894: 913b2000 add x0, x0, #0xec8
40021898: aa0003e1 mov x1, x0
4002189c: d28000e2 mov x2, #0x7 // #7
rounds = ROUNDS_DEFAULT;
400218a0: d2827119 mov x25, #0x1388 // #5000
if (strncmp(salt, sha512_rounds_prefix, sizeof(sha512_rounds_prefix) - 1)
400218a4: f90037a0 str x0, [x29, #104]
400218a8: aa1603e0 mov x0, x22
rounds_custom = false;
400218ac: b90077bf str wzr, [x29, #116]
if (strncmp(salt, sha512_rounds_prefix, sizeof(sha512_rounds_prefix) - 1)
400218b0: 94004834 bl 40033980 <strncmp>
400218b4: 34003540 cbz w0, 40021f5c <crypt_sha512_r+0x71c>
rounds = MAX(ROUNDS_MIN, MIN(srounds, ROUNDS_MAX));
rounds_custom = true;
}
}
salt_len = MIN(strcspn(salt, "$"), SALT_LEN_MAX);
400218b8: aa1603e0 mov x0, x22
400218bc: d00000c1 adrp x1, 4003b000 <bsp_section_rodata_begin+0x48>
400218c0: 913a6021 add x1, x1, #0xe98
400218c4: 940047a0 bl 40033744 <strcspn>
400218c8: aa0003f5 mov x21, x0
400218cc: d2800201 mov x1, #0x10 // #16
400218d0: eb0102bf cmp x21, x1
key_len = strlen(key);
400218d4: aa1703e0 mov x0, x23
salt_len = MIN(strcspn(salt, "$"), SALT_LEN_MAX);
400218d8: 9a8132b5 csel x21, x21, x1, cc // cc = lo, ul, last
key_len = strlen(key);
400218dc: 940047f1 bl 400338a0 <strlen>
400218e0: aa0003f4 mov x20, x0
/* Prepare for the real work. */
SHA512_Init(&ctx);
400218e4: 910483a0 add x0, x29, #0x120
400218e8: 94001fe2 bl 40029870 <SHA512_Init>
/* Add the key string. */
SHA512_Update(&ctx, key, key_len);
400218ec: aa1403e2 mov x2, x20
400218f0: aa1703e1 mov x1, x23
400218f4: 910483a0 add x0, x29, #0x120
400218f8: 94002006 bl 40029910 <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);
400218fc: aa1503e2 mov x2, x21
40021900: aa1603e1 mov x1, x22
40021904: 910483a0 add x0, x29, #0x120
40021908: 94002002 bl 40029910 <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);
4002190c: 9107c3a0 add x0, x29, #0x1f0
40021910: 94001fd8 bl 40029870 <SHA512_Init>
/* Add key. */
SHA512_Update(&alt_ctx, key, key_len);
40021914: aa1403e2 mov x2, x20
40021918: aa1703e1 mov x1, x23
4002191c: 9107c3a0 add x0, x29, #0x1f0
40021920: 94001ffc bl 40029910 <SHA512_Update>
/* Add salt. */
SHA512_Update(&alt_ctx, salt, salt_len);
40021924: aa1503e2 mov x2, x21
40021928: aa1603e1 mov x1, x22
4002192c: 9107c3a0 add x0, x29, #0x1f0
40021930: 94001ff8 bl 40029910 <SHA512_Update>
/* Add key again. */
SHA512_Update(&alt_ctx, key, key_len);
40021934: aa1403e2 mov x2, x20
40021938: aa1703e1 mov x1, x23
4002193c: 9107c3a0 add x0, x29, #0x1f0
40021940: 94001ff4 bl 40029910 <SHA512_Update>
/* Now get result of this (64 bytes) and add it to the other context. */
SHA512_Final(alt_result, &alt_ctx);
40021944: 9107c3a1 add x1, x29, #0x1f0
40021948: 910283a0 add x0, x29, #0xa0
4002194c: 94002029 bl 400299f0 <SHA512_Final>
/* Add for any character in the key one byte of the alternate sum. */
for (cnt = key_len; cnt > 64; cnt -= 64)
40021950: f101029f cmp x20, #0x40
40021954: 54003349 b.ls 40021fbc <crypt_sha512_r+0x77c> // b.plast
40021958: aa1403f3 mov x19, x20
4002195c: d503201f nop
40021960: d1010273 sub x19, x19, #0x40
SHA512_Update(&ctx, alt_result, 64);
40021964: 910283a1 add x1, x29, #0xa0
40021968: 910483a0 add x0, x29, #0x120
4002196c: d2800802 mov x2, #0x40 // #64
40021970: 94001fe8 bl 40029910 <SHA512_Update>
for (cnt = key_len; cnt > 64; cnt -= 64)
40021974: f101027f cmp x19, #0x40
40021978: 54ffff48 b.hi 40021960 <crypt_sha512_r+0x120> // b.pmore <== NEVER TAKEN
4002197c: d1010683 sub x3, x20, #0x41
40021980: d1010282 sub x2, x20, #0x40
SHA512_Update(&ctx, alt_result, cnt);
40021984: 910283a1 add x1, x29, #0xa0
40021988: 910483a0 add x0, x29, #0x120
for (cnt = key_len; cnt > 64; cnt -= 64)
4002198c: cb431be3 neg x3, x3, lsr #6
SHA512_Update(&ctx, alt_result, cnt);
40021990: 8b031842 add x2, x2, x3, lsl #6
40021994: 94001fdf bl 40029910 <SHA512_Update>
key_len = strlen(key);
40021998: aa1403f3 mov x19, x20
4002199c: d503201f nop
/* 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)
400219a0: 36002ad3 tbz w19, #0, 40021ef8 <crypt_sha512_r+0x6b8>
SHA512_Update(&ctx, alt_result, 64);
400219a4: 910283a1 add x1, x29, #0xa0
400219a8: 910483a0 add x0, x29, #0x120
400219ac: d2800802 mov x2, #0x40 // #64
400219b0: 94001fd8 bl 40029910 <SHA512_Update>
for (cnt = key_len; cnt > 0; cnt >>= 1)
400219b4: d341fe73 lsr x19, x19, #1
400219b8: b5ffff53 cbnz x19, 400219a0 <crypt_sha512_r+0x160>
else
SHA512_Update(&ctx, key, key_len);
/* Create intermediate result. */
SHA512_Final(alt_result, &ctx);
400219bc: 910483a1 add x1, x29, #0x120
400219c0: 910283a0 add x0, x29, #0xa0
400219c4: 9400200b bl 400299f0 <SHA512_Final>
/* Start computation of P byte sequence. */
SHA512_Init(&alt_ctx);
400219c8: 9107c3a0 add x0, x29, #0x1f0
400219cc: 94001fa9 bl 40029870 <SHA512_Init>
/* For every character in the password add the entire password. */
for (cnt = 0; cnt < key_len; ++cnt)
400219d0: 91000673 add x19, x19, #0x1
SHA512_Update(&alt_ctx, key, key_len);
400219d4: aa1403e2 mov x2, x20
400219d8: aa1703e1 mov x1, x23
400219dc: 9107c3a0 add x0, x29, #0x1f0
400219e0: 94001fcc bl 40029910 <SHA512_Update>
for (cnt = 0; cnt < key_len; ++cnt)
400219e4: eb13029f cmp x20, x19
400219e8: 54ffff48 b.hi 400219d0 <crypt_sha512_r+0x190> // b.pmore
/* Finish the digest. */
SHA512_Final(temp_result, &alt_ctx);
400219ec: 910383b7 add x23, x29, #0xe0
400219f0: 9107c3a1 add x1, x29, #0x1f0
400219f4: aa1703e0 mov x0, x23
400219f8: 94001ffe bl 400299f0 <SHA512_Final>
/* Create byte sequence P. */
cp = p_bytes = alloca(key_len);
400219fc: 91003e80 add x0, x20, #0xf
for (cnt = key_len; cnt >= 64; cnt -= 64) {
40021a00: f100fe9f cmp x20, #0x3f
cp = p_bytes = alloca(key_len);
40021a04: 927cec00 and x0, x0, #0xfffffffffffffff0
40021a08: cb2063ff sub sp, sp, x0
40021a0c: 910003f8 mov x24, sp
40021a10: f9004bb8 str x24, [x29, #144]
for (cnt = key_len; cnt >= 64; cnt -= 64) {
40021a14: aa1803e0 mov x0, x24
40021a18: 54002f89 b.ls 40022008 <crypt_sha512_r+0x7c8> // b.plast
40021a1c: aa1403f3 mov x19, x20
memcpy(cp, temp_result, 64);
40021a20: aa1703e1 mov x1, x23
40021a24: d2800802 mov x2, #0x40 // #64
40021a28: 940045fd bl 4003321c <memcpy>
for (cnt = key_len; cnt >= 64; cnt -= 64) {
40021a2c: d1010273 sub x19, x19, #0x40
cp += 64;
40021a30: f9404ba0 ldr x0, [x29, #144]
for (cnt = key_len; cnt >= 64; cnt -= 64) {
40021a34: f100fe7f cmp x19, #0x3f
cp += 64;
40021a38: 91010000 add x0, x0, #0x40
40021a3c: f9004ba0 str x0, [x29, #144]
for (cnt = key_len; cnt >= 64; cnt -= 64) {
40021a40: 54ffff08 b.hi 40021a20 <crypt_sha512_r+0x1e0> // b.pmore <== NEVER TAKEN
40021a44: 92401682 and x2, x20, #0x3f
}
memcpy(cp, temp_result, cnt);
40021a48: aa1703e1 mov x1, x23
40021a4c: 940045f4 bl 4003321c <memcpy>
/* Start computation of S byte sequence. */
SHA512_Init(&alt_ctx);
40021a50: 9107c3a0 add x0, x29, #0x1f0
/* For every character in the password add the entire password. */
for (cnt = 0; cnt < 16 + alt_result[0]; ++cnt)
40021a54: d2800013 mov x19, #0x0 // #0
SHA512_Init(&alt_ctx);
40021a58: 94001f86 bl 40029870 <SHA512_Init>
for (cnt = 0; cnt < 16 + alt_result[0]; ++cnt)
40021a5c: d503201f nop
SHA512_Update(&alt_ctx, salt, salt_len);
40021a60: 9107c3a0 add x0, x29, #0x1f0
40021a64: aa1503e2 mov x2, x21
40021a68: aa1603e1 mov x1, x22
40021a6c: 94001fa9 bl 40029910 <SHA512_Update>
for (cnt = 0; cnt < 16 + alt_result[0]; ++cnt)
40021a70: 394283a0 ldrb w0, [x29, #160]
40021a74: 91000673 add x19, x19, #0x1
40021a78: 91004000 add x0, x0, #0x10
40021a7c: eb13001f cmp x0, x19
40021a80: 54ffff08 b.hi 40021a60 <crypt_sha512_r+0x220> // b.pmore
/* Finish the digest. */
SHA512_Final(temp_result, &alt_ctx);
40021a84: 9107c3a1 add x1, x29, #0x1f0
40021a88: aa1703e0 mov x0, x23
40021a8c: 94001fd9 bl 400299f0 <SHA512_Final>
/* Add key or last result. */
if ((cnt & 1) != 0)
SHA512_Update(&ctx, p_bytes, key_len);
else
SHA512_Update(&ctx, alt_result, 64);
40021a90: b201f3fb mov x27, #0xaaaaaaaaaaaaaaaa // #-6148914691236517206
cp = s_bytes = alloca(salt_len);
40021a94: 91003ea0 add x0, x21, #0xf
memcpy(cp, temp_result, cnt);
40021a98: aa1703e1 mov x1, x23
cp = s_bytes = alloca(salt_len);
40021a9c: 927cec00 and x0, x0, #0xfffffffffffffff0
memcpy(cp, temp_result, cnt);
40021aa0: aa1503e2 mov x2, x21
cp = s_bytes = alloca(salt_len);
40021aa4: cb2063ff sub sp, sp, x0
for (cnt = 0; cnt < rounds; ++cnt) {
40021aa8: d2800013 mov x19, #0x0 // #0
cp = s_bytes = alloca(salt_len);
40021aac: 910003fc mov x28, sp
SHA512_Update(&ctx, alt_result, 64);
40021ab0: f295557b movk x27, #0xaaab
memcpy(cp, temp_result, cnt);
40021ab4: aa1c03e0 mov x0, x28
/* Add salt for numbers not divisible by 3. */
if (cnt % 3 != 0)
40021ab8: b200f3fa mov x26, #0x5555555555555555 // #6148914691236517205
cp = s_bytes = alloca(salt_len);
40021abc: f9004bbc str x28, [x29, #144]
memcpy(cp, temp_result, cnt);
40021ac0: 940045d7 bl 4003321c <memcpy>
for (cnt = 0; cnt < rounds; ++cnt) {
40021ac4: d503201f nop
SHA512_Init(&ctx);
40021ac8: 910483a0 add x0, x29, #0x120
if ((cnt & 1) != 0)
40021acc: 92400277 and x23, x19, #0x1
SHA512_Init(&ctx);
40021ad0: 94001f68 bl 40029870 <SHA512_Init>
if ((cnt & 1) != 0)
40021ad4: 36001fb3 tbz w19, #0, 40021ec8 <crypt_sha512_r+0x688>
SHA512_Update(&ctx, p_bytes, key_len);
40021ad8: 910483a0 add x0, x29, #0x120
40021adc: aa1403e2 mov x2, x20
40021ae0: aa1803e1 mov x1, x24
40021ae4: 94001f8b bl 40029910 <SHA512_Update>
SHA512_Update(&ctx, alt_result, 64);
40021ae8: 9b1b7e60 mul x0, x19, x27
if (cnt % 3 != 0)
40021aec: eb1a001f cmp x0, x26
40021af0: 54001fa8 b.hi 40021ee4 <crypt_sha512_r+0x6a4> // b.pmore
SHA512_Update(&ctx, s_bytes, salt_len);
40021af4: d28db6e0 mov x0, #0x6db7 // #28087
40021af8: f2b6db60 movk x0, #0xb6db, lsl #16
40021afc: f2db6da0 movk x0, #0xdb6d, lsl #32
40021b00: f2edb6c0 movk x0, #0x6db6, lsl #48
/* Add key for numbers not divisible by 7. */
if (cnt % 7 != 0)
40021b04: d2849241 mov x1, #0x2492 // #9362
40021b08: f2b24921 movk x1, #0x9249, lsl #16
SHA512_Update(&ctx, s_bytes, salt_len);
40021b0c: 9b007e60 mul x0, x19, x0
if (cnt % 7 != 0)
40021b10: f2c92481 movk x1, #0x4924, lsl #32
40021b14: f2e49241 movk x1, #0x2492, lsl #48
40021b18: eb01001f cmp x0, x1
40021b1c: 54001c28 b.hi 40021ea0 <crypt_sha512_r+0x660> // b.pmore
SHA512_Update(&ctx, p_bytes, key_len);
/* Add key or last result. */
if ((cnt & 1) != 0)
40021b20: b4001cb7 cbz x23, 40021eb4 <crypt_sha512_r+0x674>
SHA512_Update(&ctx, alt_result, 64);
40021b24: 910283a1 add x1, x29, #0xa0
40021b28: 910483a0 add x0, x29, #0x120
40021b2c: d2800802 mov x2, #0x40 // #64
40021b30: 94001f78 bl 40029910 <SHA512_Update>
for (cnt = 0; cnt < rounds; ++cnt) {
40021b34: 91000673 add x19, x19, #0x1
else
SHA512_Update(&ctx, p_bytes, key_len);
/* Create intermediate result. */
SHA512_Final(alt_result, &ctx);
40021b38: 910483a1 add x1, x29, #0x120
40021b3c: 910283a0 add x0, x29, #0xa0
40021b40: 94001fac bl 400299f0 <SHA512_Final>
for (cnt = 0; cnt < rounds; ++cnt) {
40021b44: eb13033f cmp x25, x19
40021b48: 54fffc01 b.ne 40021ac8 <crypt_sha512_r+0x288> // b.any
}
/* Now we can construct the result string. It consists of three
* parts. */
cp = stpncpy(buffer, sha512_salt_prefix, MAX(0, buflen));
40021b4c: b9408fb3 ldr w19, [x29, #140]
40021b50: d00000c1 adrp x1, 4003b000 <bsp_section_rodata_begin+0x48>
40021b54: 913b4021 add x1, x1, #0xed0
40021b58: f9403fa0 ldr x0, [x29, #120]
40021b5c: 7100027f cmp w19, #0x0
40021b60: 1a9fa262 csel w2, w19, wzr, ge // ge = tcont
40021b64: 93407c42 sxtw x2, w2
40021b68: 9400469a bl 400335d0 <stpncpy>
buflen -= sizeof(sha512_salt_prefix) - 1;
if (rounds_custom) {
40021b6c: b94077a1 ldr w1, [x29, #116]
buflen -= sizeof(sha512_salt_prefix) - 1;
40021b70: 71000e73 subs w19, w19, #0x3
n = snprintf(cp, MAX(0, buflen), "%s%zu$",
40021b74: 1a9f5262 csel w2, w19, wzr, pl // pl = nfrst
buflen -= sizeof(sha512_salt_prefix) - 1;
40021b78: b9008fb3 str w19, [x29, #140]
cp = stpncpy(buffer, sha512_salt_prefix, MAX(0, buflen));
40021b7c: f9004ba0 str x0, [x29, #144]
40021b80: aa0003e3 mov x3, x0
n = snprintf(cp, MAX(0, buflen), "%s%zu$",
40021b84: 93407c42 sxtw x2, w2
if (rounds_custom) {
40021b88: 35001cc1 cbnz w1, 40021f20 <crypt_sha512_r+0x6e0>
cp += n;
buflen -= n;
}
cp = stpncpy(cp, salt, MIN((size_t)MAX(0, buflen), salt_len));
40021b8c: eb0202bf cmp x21, x2
40021b90: aa1603e1 mov x1, x22
40021b94: 9a8292a2 csel x2, x21, x2, ls // ls = plast
40021b98: aa0303e0 mov x0, x3
40021b9c: 9400468d bl 400335d0 <stpncpy>
40021ba0: f9004ba0 str x0, [x29, #144]
buflen -= MIN((size_t)MAX(0, buflen), salt_len);
40021ba4: b9408fa1 ldr w1, [x29, #140]
40021ba8: 7100003f cmp w1, #0x0
40021bac: 1a9fa022 csel w2, w1, wzr, ge // ge = tcont
40021bb0: 93407c42 sxtw x2, w2
40021bb4: eb15005f cmp x2, x21
40021bb8: 9a959055 csel x21, x2, x21, ls // ls = plast
40021bbc: 4b150021 sub w1, w1, w21
40021bc0: b9008fa1 str w1, [x29, #140]
if (buflen > 0) {
40021bc4: 7100003f cmp w1, #0x0
40021bc8: 5400010d b.le 40021be8 <crypt_sha512_r+0x3a8> <== NEVER TAKEN
*cp++ = '$';
40021bcc: 91000401 add x1, x0, #0x1
40021bd0: f9004ba1 str x1, [x29, #144]
40021bd4: 52800481 mov w1, #0x24 // #36
40021bd8: 39000001 strb w1, [x0]
--buflen;
40021bdc: b9408fa0 ldr w0, [x29, #140]
40021be0: 51000400 sub w0, w0, #0x1
40021be4: b9008fa0 str w0, [x29, #140]
}
b64_from_24bit(alt_result[0], alt_result[21], alt_result[42], 4, &buflen, &cp);
40021be8: 394283a0 ldrb w0, [x29, #160]
40021bec: 910243a5 add x5, x29, #0x90
40021bf0: 3942d7a1 ldrb w1, [x29, #181]
40021bf4: 910233a4 add x4, x29, #0x8c
40021bf8: 39432ba2 ldrb w2, [x29, #202]
40021bfc: 52800083 mov w3, #0x4 // #4
40021c00: 94000114 bl 40022050 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[22], alt_result[43], alt_result[1], 4, &buflen, &cp);
40021c04: 394287a2 ldrb w2, [x29, #161]
40021c08: 910243a5 add x5, x29, #0x90
40021c0c: 3942dba0 ldrb w0, [x29, #182]
40021c10: 910233a4 add x4, x29, #0x8c
40021c14: 39432fa1 ldrb w1, [x29, #203]
40021c18: 52800083 mov w3, #0x4 // #4
40021c1c: 9400010d bl 40022050 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[44], alt_result[2], alt_result[23], 4, &buflen, &cp);
40021c20: 39428ba1 ldrb w1, [x29, #162]
40021c24: 910243a5 add x5, x29, #0x90
40021c28: 3942dfa2 ldrb w2, [x29, #183]
40021c2c: 910233a4 add x4, x29, #0x8c
40021c30: 394333a0 ldrb w0, [x29, #204]
40021c34: 52800083 mov w3, #0x4 // #4
40021c38: 94000106 bl 40022050 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[3], alt_result[24], alt_result[45], 4, &buflen, &cp);
40021c3c: 39428fa0 ldrb w0, [x29, #163]
40021c40: 910243a5 add x5, x29, #0x90
40021c44: 3942e3a1 ldrb w1, [x29, #184]
40021c48: 910233a4 add x4, x29, #0x8c
40021c4c: 394337a2 ldrb w2, [x29, #205]
40021c50: 52800083 mov w3, #0x4 // #4
40021c54: 940000ff bl 40022050 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[25], alt_result[46], alt_result[4], 4, &buflen, &cp);
40021c58: 394293a2 ldrb w2, [x29, #164]
40021c5c: 910243a5 add x5, x29, #0x90
40021c60: 3942e7a0 ldrb w0, [x29, #185]
40021c64: 910233a4 add x4, x29, #0x8c
40021c68: 39433ba1 ldrb w1, [x29, #206]
40021c6c: 52800083 mov w3, #0x4 // #4
40021c70: 940000f8 bl 40022050 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[47], alt_result[5], alt_result[26], 4, &buflen, &cp);
40021c74: 394297a1 ldrb w1, [x29, #165]
40021c78: 910243a5 add x5, x29, #0x90
40021c7c: 3942eba2 ldrb w2, [x29, #186]
40021c80: 910233a4 add x4, x29, #0x8c
40021c84: 39433fa0 ldrb w0, [x29, #207]
40021c88: 52800083 mov w3, #0x4 // #4
40021c8c: 940000f1 bl 40022050 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[6], alt_result[27], alt_result[48], 4, &buflen, &cp);
40021c90: 39429ba0 ldrb w0, [x29, #166]
40021c94: 910243a5 add x5, x29, #0x90
40021c98: 3942efa1 ldrb w1, [x29, #187]
40021c9c: 910233a4 add x4, x29, #0x8c
40021ca0: 394343a2 ldrb w2, [x29, #208]
40021ca4: 52800083 mov w3, #0x4 // #4
40021ca8: 940000ea bl 40022050 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[28], alt_result[49], alt_result[7], 4, &buflen, &cp);
40021cac: 39429fa2 ldrb w2, [x29, #167]
40021cb0: 910243a5 add x5, x29, #0x90
40021cb4: 3942f3a0 ldrb w0, [x29, #188]
40021cb8: 910233a4 add x4, x29, #0x8c
40021cbc: 394347a1 ldrb w1, [x29, #209]
40021cc0: 52800083 mov w3, #0x4 // #4
40021cc4: 940000e3 bl 40022050 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[50], alt_result[8], alt_result[29], 4, &buflen, &cp);
40021cc8: 3942a3a1 ldrb w1, [x29, #168]
40021ccc: 910243a5 add x5, x29, #0x90
40021cd0: 3942f7a2 ldrb w2, [x29, #189]
40021cd4: 910233a4 add x4, x29, #0x8c
40021cd8: 39434ba0 ldrb w0, [x29, #210]
40021cdc: 52800083 mov w3, #0x4 // #4
40021ce0: 940000dc bl 40022050 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[9], alt_result[30], alt_result[51], 4, &buflen, &cp);
40021ce4: 3942a7a0 ldrb w0, [x29, #169]
40021ce8: 910243a5 add x5, x29, #0x90
40021cec: 3942fba1 ldrb w1, [x29, #190]
40021cf0: 910233a4 add x4, x29, #0x8c
40021cf4: 39434fa2 ldrb w2, [x29, #211]
40021cf8: 52800083 mov w3, #0x4 // #4
40021cfc: 940000d5 bl 40022050 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[31], alt_result[52], alt_result[10], 4, &buflen, &cp);
40021d00: 3942aba2 ldrb w2, [x29, #170]
40021d04: 910243a5 add x5, x29, #0x90
40021d08: 3942ffa0 ldrb w0, [x29, #191]
40021d0c: 910233a4 add x4, x29, #0x8c
40021d10: 394353a1 ldrb w1, [x29, #212]
40021d14: 52800083 mov w3, #0x4 // #4
40021d18: 940000ce bl 40022050 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[53], alt_result[11], alt_result[32], 4, &buflen, &cp);
40021d1c: 3942afa1 ldrb w1, [x29, #171]
40021d20: 910243a5 add x5, x29, #0x90
40021d24: 394303a2 ldrb w2, [x29, #192]
40021d28: 910233a4 add x4, x29, #0x8c
40021d2c: 394357a0 ldrb w0, [x29, #213]
40021d30: 52800083 mov w3, #0x4 // #4
40021d34: 940000c7 bl 40022050 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[12], alt_result[33], alt_result[54], 4, &buflen, &cp);
40021d38: 3942b3a0 ldrb w0, [x29, #172]
40021d3c: 910243a5 add x5, x29, #0x90
40021d40: 394307a1 ldrb w1, [x29, #193]
40021d44: 910233a4 add x4, x29, #0x8c
40021d48: 39435ba2 ldrb w2, [x29, #214]
40021d4c: 52800083 mov w3, #0x4 // #4
40021d50: 940000c0 bl 40022050 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[34], alt_result[55], alt_result[13], 4, &buflen, &cp);
40021d54: 3942b7a2 ldrb w2, [x29, #173]
40021d58: 910243a5 add x5, x29, #0x90
40021d5c: 39430ba0 ldrb w0, [x29, #194]
40021d60: 910233a4 add x4, x29, #0x8c
40021d64: 39435fa1 ldrb w1, [x29, #215]
40021d68: 52800083 mov w3, #0x4 // #4
40021d6c: 940000b9 bl 40022050 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[56], alt_result[14], alt_result[35], 4, &buflen, &cp);
40021d70: 3942bba1 ldrb w1, [x29, #174]
40021d74: 910243a5 add x5, x29, #0x90
40021d78: 39430fa2 ldrb w2, [x29, #195]
40021d7c: 910233a4 add x4, x29, #0x8c
40021d80: 394363a0 ldrb w0, [x29, #216]
40021d84: 52800083 mov w3, #0x4 // #4
40021d88: 940000b2 bl 40022050 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[15], alt_result[36], alt_result[57], 4, &buflen, &cp);
40021d8c: 3942bfa0 ldrb w0, [x29, #175]
40021d90: 910243a5 add x5, x29, #0x90
40021d94: 394313a1 ldrb w1, [x29, #196]
40021d98: 910233a4 add x4, x29, #0x8c
40021d9c: 394367a2 ldrb w2, [x29, #217]
40021da0: 52800083 mov w3, #0x4 // #4
40021da4: 940000ab bl 40022050 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[37], alt_result[58], alt_result[16], 4, &buflen, &cp);
40021da8: 3942c3a2 ldrb w2, [x29, #176]
40021dac: 910243a5 add x5, x29, #0x90
40021db0: 394317a0 ldrb w0, [x29, #197]
40021db4: 910233a4 add x4, x29, #0x8c
40021db8: 39436ba1 ldrb w1, [x29, #218]
40021dbc: 52800083 mov w3, #0x4 // #4
40021dc0: 940000a4 bl 40022050 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[59], alt_result[17], alt_result[38], 4, &buflen, &cp);
40021dc4: 3942c7a1 ldrb w1, [x29, #177]
40021dc8: 910243a5 add x5, x29, #0x90
40021dcc: 39431ba2 ldrb w2, [x29, #198]
40021dd0: 910233a4 add x4, x29, #0x8c
40021dd4: 39436fa0 ldrb w0, [x29, #219]
40021dd8: 52800083 mov w3, #0x4 // #4
40021ddc: 9400009d bl 40022050 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[18], alt_result[39], alt_result[60], 4, &buflen, &cp);
40021de0: 3942cba0 ldrb w0, [x29, #178]
40021de4: 910243a5 add x5, x29, #0x90
40021de8: 39431fa1 ldrb w1, [x29, #199]
40021dec: 910233a4 add x4, x29, #0x8c
40021df0: 394373a2 ldrb w2, [x29, #220]
40021df4: 52800083 mov w3, #0x4 // #4
40021df8: 94000096 bl 40022050 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[40], alt_result[61], alt_result[19], 4, &buflen, &cp);
40021dfc: 3942cfa2 ldrb w2, [x29, #179]
40021e00: 910243a5 add x5, x29, #0x90
40021e04: 394323a0 ldrb w0, [x29, #200]
40021e08: 910233a4 add x4, x29, #0x8c
40021e0c: 394377a1 ldrb w1, [x29, #221]
40021e10: 52800083 mov w3, #0x4 // #4
40021e14: 9400008f bl 40022050 <_crypt_b64_from_24bit>
b64_from_24bit(alt_result[62], alt_result[20], alt_result[41], 4, &buflen, &cp);
40021e18: 3942d3a1 ldrb w1, [x29, #180]
40021e1c: 910243a5 add x5, x29, #0x90
40021e20: 394327a2 ldrb w2, [x29, #201]
40021e24: 910233a4 add x4, x29, #0x8c
40021e28: 39437ba0 ldrb w0, [x29, #222]
40021e2c: 52800083 mov w3, #0x4 // #4
40021e30: 94000088 bl 40022050 <_crypt_b64_from_24bit>
b64_from_24bit(0, 0, alt_result[63], 2, &buflen, &cp);
40021e34: 39437fa2 ldrb w2, [x29, #223]
40021e38: 52800000 mov w0, #0x0 // #0
40021e3c: 910243a5 add x5, x29, #0x90
40021e40: 910233a4 add x4, x29, #0x8c
40021e44: 52800043 mov w3, #0x2 // #2
40021e48: 52800001 mov w1, #0x0 // #0
40021e4c: 94000081 bl 40022050 <_crypt_b64_from_24bit>
if (buflen <= 0) {
40021e50: b9408fa0 ldr w0, [x29, #140]
40021e54: 7100001f cmp w0, #0x0
40021e58: 54000a8d b.le 40021fa8 <crypt_sha512_r+0x768> <== NEVER TAKEN
errno = ERANGE;
buffer = NULL;
}
else
*cp = '\0'; /* Terminate the string. */
40021e5c: f9404ba0 ldr x0, [x29, #144]
40021e60: 3900001f strb wzr, [x0]
/* 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);
40021e64: 910483a0 add x0, x29, #0x120
40021e68: 94001e82 bl 40029870 <SHA512_Init>
SHA512_Final(alt_result, &ctx);
40021e6c: 910483a1 add x1, x29, #0x120
40021e70: 910283a0 add x0, x29, #0xa0
40021e74: 94001edf bl 400299f0 <SHA512_Final>
memset(copied_key, '\0', key_len);
if (copied_salt != NULL)
memset(copied_salt, '\0', salt_len);
return buffer;
}
40021e78: f9403fa0 ldr x0, [x29, #120]
40021e7c: 910003bf mov sp, x29
40021e80: a9407bfd ldp x29, x30, [sp]
40021e84: a94153f3 ldp x19, x20, [sp, #16]
40021e88: a9425bf5 ldp x21, x22, [sp, #32]
40021e8c: a94363f7 ldp x23, x24, [sp, #48]
40021e90: a9446bf9 ldp x25, x26, [sp, #64]
40021e94: a94573fb ldp x27, x28, [sp, #80]
40021e98: 910b03ff add sp, sp, #0x2c0
40021e9c: d65f03c0 ret
SHA512_Update(&ctx, p_bytes, key_len);
40021ea0: aa1403e2 mov x2, x20
40021ea4: aa1803e1 mov x1, x24
40021ea8: 910483a0 add x0, x29, #0x120
40021eac: 94001e99 bl 40029910 <SHA512_Update>
if ((cnt & 1) != 0)
40021eb0: b5ffe3b7 cbnz x23, 40021b24 <crypt_sha512_r+0x2e4>
SHA512_Update(&ctx, p_bytes, key_len);
40021eb4: aa1403e2 mov x2, x20
40021eb8: aa1803e1 mov x1, x24
40021ebc: 910483a0 add x0, x29, #0x120
40021ec0: 94001e94 bl 40029910 <SHA512_Update>
40021ec4: 17ffff1c b 40021b34 <crypt_sha512_r+0x2f4>
SHA512_Update(&ctx, alt_result, 64);
40021ec8: 910483a0 add x0, x29, #0x120
40021ecc: 910283a1 add x1, x29, #0xa0
40021ed0: d2800802 mov x2, #0x40 // #64
40021ed4: 94001e8f bl 40029910 <SHA512_Update>
40021ed8: 9b1b7e60 mul x0, x19, x27
if (cnt % 3 != 0)
40021edc: eb1a001f cmp x0, x26
40021ee0: 54ffe0a9 b.ls 40021af4 <crypt_sha512_r+0x2b4> // b.plast
SHA512_Update(&ctx, s_bytes, salt_len);
40021ee4: aa1503e2 mov x2, x21
40021ee8: aa1c03e1 mov x1, x28
40021eec: 910483a0 add x0, x29, #0x120
40021ef0: 94001e88 bl 40029910 <SHA512_Update>
40021ef4: 17ffff00 b 40021af4 <crypt_sha512_r+0x2b4>
SHA512_Update(&ctx, key, key_len);
40021ef8: aa1403e2 mov x2, x20
40021efc: aa1703e1 mov x1, x23
40021f00: 910483a0 add x0, x29, #0x120
40021f04: 94001e83 bl 40029910 <SHA512_Update>
40021f08: 17fffeab b 400219b4 <crypt_sha512_r+0x174>
if (strncmp(sha512_salt_prefix, salt, sizeof(sha512_salt_prefix) - 1) == 0)
40021f0c: 39400ac2 ldrb w2, [x22, #2]
salt += sizeof(sha512_salt_prefix) - 1;
40021f10: 91000ec1 add x1, x22, #0x3
40021f14: 6b02001f cmp w0, w2
40021f18: 9a960036 csel x22, x1, x22, eq // eq = none
40021f1c: 17fffe5d b 40021890 <crypt_sha512_r+0x50>
n = snprintf(cp, MAX(0, buflen), "%s%zu$",
40021f20: f94037a3 ldr x3, [x29, #104]
40021f24: aa0203e1 mov x1, x2
40021f28: aa1903e4 mov x4, x25
40021f2c: d00000c2 adrp x2, 4003b000 <bsp_section_rodata_begin+0x48>
40021f30: 913a8042 add x2, x2, #0xea0
40021f34: 94004550 bl 40033474 <snprintf>
buflen -= n;
40021f38: b9408fa2 ldr w2, [x29, #140]
cp += n;
40021f3c: f9404ba3 ldr x3, [x29, #144]
buflen -= n;
40021f40: 6b000042 subs w2, w2, w0
40021f44: b9008fa2 str w2, [x29, #140]
cp = stpncpy(cp, salt, MIN((size_t)MAX(0, buflen), salt_len));
40021f48: 1a9f5042 csel w2, w2, wzr, pl // pl = nfrst
cp += n;
40021f4c: 8b20c063 add x3, x3, w0, sxtw
cp = stpncpy(cp, salt, MIN((size_t)MAX(0, buflen), salt_len));
40021f50: 93407c42 sxtw x2, w2
cp += n;
40021f54: f9004ba3 str x3, [x29, #144]
buflen -= n;
40021f58: 17ffff0d b 40021b8c <crypt_sha512_r+0x34c>
srounds = strtoul(num, &endp, 10);
40021f5c: 910263a1 add x1, x29, #0x98
40021f60: 52800142 mov w2, #0xa // #10
40021f64: 91001ec0 add x0, x22, #0x7
40021f68: 940047b7 bl 40033e44 <strtoul>
if (*endp == '$') {
40021f6c: f9404fa1 ldr x1, [x29, #152]
40021f70: 39400022 ldrb w2, [x1]
40021f74: 7100905f cmp w2, #0x24
40021f78: 54ffca01 b.ne 400218b8 <crypt_sha512_r+0x78> // b.any <== NEVER TAKEN
rounds = MAX(ROUNDS_MIN, MIN(srounds, ROUNDS_MAX));
40021f7c: d2993ff9 mov x25, #0xc9ff // #51711
40021f80: f2a77359 movk x25, #0x3b9a, lsl #16
40021f84: eb19001f cmp x0, x25
salt = endp + 1;
40021f88: 91000436 add x22, x1, #0x1
rounds = MAX(ROUNDS_MIN, MIN(srounds, ROUNDS_MAX));
40021f8c: 9a999019 csel x25, x0, x25, ls // ls = plast
40021f90: d2807d00 mov x0, #0x3e8 // #1000
40021f94: f10fa33f cmp x25, #0x3e8
40021f98: 9a802339 csel x25, x25, x0, cs // cs = hs, nlast
rounds_custom = true;
40021f9c: 52800020 mov w0, #0x1 // #1
40021fa0: b90077a0 str w0, [x29, #116]
40021fa4: 17fffe45 b 400218b8 <crypt_sha512_r+0x78>
errno = ERANGE;
40021fa8: 9400443d bl 4003309c <__errno> <== NOT EXECUTED
buffer = NULL;
40021fac: f9003fbf str xzr, [x29, #120] <== NOT EXECUTED
errno = ERANGE;
40021fb0: 52800441 mov w1, #0x22 // #34 <== NOT EXECUTED
40021fb4: b9000001 str w1, [x0] <== NOT EXECUTED
buffer = NULL;
40021fb8: 17ffffab b 40021e64 <crypt_sha512_r+0x624> <== NOT EXECUTED
SHA512_Update(&ctx, alt_result, cnt);
40021fbc: aa1403e2 mov x2, x20
40021fc0: 910283a1 add x1, x29, #0xa0
40021fc4: 910483a0 add x0, x29, #0x120
40021fc8: 94001e52 bl 40029910 <SHA512_Update>
for (cnt = key_len; cnt > 0; cnt >>= 1)
40021fcc: b5ffce74 cbnz x20, 40021998 <crypt_sha512_r+0x158> <== ALWAYS TAKEN
SHA512_Final(alt_result, &ctx);
40021fd0: 910483a1 add x1, x29, #0x120 <== NOT EXECUTED
40021fd4: 910283a0 add x0, x29, #0xa0 <== NOT EXECUTED
40021fd8: 94001e86 bl 400299f0 <SHA512_Final> <== NOT EXECUTED
SHA512_Final(temp_result, &alt_ctx);
40021fdc: 910383b7 add x23, x29, #0xe0 <== NOT EXECUTED
SHA512_Init(&alt_ctx);
40021fe0: 9107c3a0 add x0, x29, #0x1f0 <== NOT EXECUTED
cp = p_bytes = alloca(key_len);
40021fe4: 910003f8 mov x24, sp <== NOT EXECUTED
SHA512_Init(&alt_ctx);
40021fe8: 94001e22 bl 40029870 <SHA512_Init> <== NOT EXECUTED
SHA512_Final(temp_result, &alt_ctx);
40021fec: aa1703e0 mov x0, x23 <== NOT EXECUTED
40021ff0: 9107c3a1 add x1, x29, #0x1f0 <== NOT EXECUTED
40021ff4: 94001e7f bl 400299f0 <SHA512_Final> <== NOT EXECUTED
cp = p_bytes = alloca(key_len);
40021ff8: f9004bb8 str x24, [x29, #144] <== NOT EXECUTED
40021ffc: 910003e0 mov x0, sp <== NOT EXECUTED
40022000: d2800002 mov x2, #0x0 // #0 <== NOT EXECUTED
40022004: 17fffe91 b 40021a48 <crypt_sha512_r+0x208> <== NOT EXECUTED
for (cnt = key_len; cnt >= 64; cnt -= 64) {
40022008: aa1403e2 mov x2, x20
4002200c: 17fffe8f b 40021a48 <crypt_sha512_r+0x208>