name string | code string | asm string | file string |
|---|---|---|---|
hexdump | char *hexdump(const unsigned char *buffer, size_t len)
{
static char dump[200 * 3 + 1];
char *p = dump;
size_t i;
if(len > 200)
return NULL;
for(i = 0; i<len; i++, p += 3)
msnprintf(p, 4, "%02x ", buffer[i]);
return dump;
} | pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
leaq 0x2829(%rip), %rax # 0x50e0
movq %rax, -0x20(%rbp)
cmpq $0xc8, -0x18(%rbp)
jbe 0x28cf
movq $0x0, -0x8(%rbp)
jmp 0x2929
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x291e
movq -0x20(%rbp), %rd... | /kfalconspb[P]curl/tests/libtest/first.c |
tutil_tvnow | struct timeval tutil_tvnow(void)
{
/*
** clock_gettime() is granted to be increased monotonically when the
** monotonic clock is queried. Time starting point is unspecified, it
** could be the system start-up time, the Epoch, or something else,
** in any case the time starting point does not change once that ... | pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl $0x1, %edi
leaq -0x20(%rbp), %rsi
callq 0x2090
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x2a5a
movq -0x20(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
movl $0x3e8, %ecx # imm = 0x3E8
cqto
idivq %rcx
movq %rax, -0x8(%rbp)
jmp 0x2a67
leaq... | /kfalconspb[P]curl/tests/libtest/testutil.c |
curlx_ultous | unsigned short curlx_ultous(unsigned long ulnum)
{
#ifdef __INTEL_COMPILER
# pragma warning(push)
# pragma warning(disable:810) /* conversion may lose significant bits */
#endif
DEBUGASSERT(ulnum <= (unsigned long) CURL_MASK_USHORT);
return (unsigned short)(ulnum & (unsigned long) CURL_MASK_USHORT);
#ifdef __IN... | pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
jmp 0x2b5a
movq -0x8(%rbp), %rax
andq $0xffff, %rax # imm = 0xFFFF
popq %rbp
retq
nopw %cs:(%rax,%rax)
| /kfalconspb[P]curl/lib/warnless.c |
curlx_ultosi | int curlx_ultosi(unsigned long ulnum)
{
#ifdef __INTEL_COMPILER
# pragma warning(push)
# pragma warning(disable:810) /* conversion may lose significant bits */
#endif
DEBUGASSERT(ulnum <= (unsigned long) CURL_MASK_SINT);
return (int)(ulnum & (unsigned long) CURL_MASK_SINT);
#ifdef __INTEL_COMPILER
# pragma war... | pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
jmp 0x2b9a
movq -0x8(%rbp), %rax
andq $0x7fffffff, %rax # imm = 0x7FFFFFFF
popq %rbp
retq
nopw %cs:(%rax,%rax)
| /kfalconspb[P]curl/lib/warnless.c |
curlx_uztoso | curl_off_t curlx_uztoso(size_t uznum)
{
#ifdef __INTEL_COMPILER
# pragma warning(push)
# pragma warning(disable:810) /* conversion may lose significant bits */
#elif defined(_MSC_VER)
# pragma warning(push)
# pragma warning(disable:4310) /* cast truncates constant value */
#endif
DEBUGASSERT(uznum <= (size_t) CU... | pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
jmp 0x2bba
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
andq -0x8(%rbp), %rax
popq %rbp
retq
nopw (%rax,%rax)
| /kfalconspb[P]curl/lib/warnless.c |
curlx_uztosi | int curlx_uztosi(size_t uznum)
{
#ifdef __INTEL_COMPILER
# pragma warning(push)
# pragma warning(disable:810) /* conversion may lose significant bits */
#endif
DEBUGASSERT(uznum <= (size_t) CURL_MASK_SINT);
return (int)(uznum & (size_t) CURL_MASK_SINT);
#ifdef __INTEL_COMPILER
# pragma warning(pop)
#endif
} | pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
jmp 0x2bda
movq -0x8(%rbp), %rax
andq $0x7fffffff, %rax # imm = 0x7FFFFFFF
popq %rbp
retq
nopw %cs:(%rax,%rax)
| /kfalconspb[P]curl/lib/warnless.c |
curlx_uztoul | unsigned long curlx_uztoul(size_t uznum)
{
#ifdef __INTEL_COMPILER
# pragma warning(push)
# pragma warning(disable:810) /* conversion may lose significant bits */
#endif
#if (SIZEOF_LONG < SIZEOF_SIZE_T)
DEBUGASSERT(uznum <= (size_t) CURL_MASK_ULONG);
#endif
return (unsigned long)(uznum & (size_t) CURL_MASK_ULONG)... | pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
andq $-0x1, %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
| /kfalconspb[P]curl/lib/warnless.c |
curlx_sltoui | unsigned int curlx_sltoui(long slnum)
{
#ifdef __INTEL_COMPILER
# pragma warning(push)
# pragma warning(disable:810) /* conversion may lose significant bits */
#endif
DEBUGASSERT(slnum >= 0);
#if (SIZEOF_INT < SIZEOF_LONG)
DEBUGASSERT((unsigned long) slnum <= (unsigned long) CURL_MASK_UINT);
#endif
return (uns... | pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
jmp 0x2c5a
jmp 0x2c5c
jmp 0x2c5e
movabsq $0xffffffff, %rax # imm = 0xFFFFFFFF
andq -0x8(%rbp), %rax
popq %rbp
retq
nop
| /kfalconspb[P]curl/lib/warnless.c |
curlx_uztosz | ssize_t curlx_uztosz(size_t uznum)
{
#ifdef __INTEL_COMPILER
# pragma warning(push)
# pragma warning(disable:810) /* conversion may lose significant bits */
#endif
DEBUGASSERT(uznum <= (size_t) CURL_MASK_SSIZE_T);
return (ssize_t)(uznum & (size_t) CURL_MASK_SSIZE_T);
#ifdef __INTEL_COMPILER
# pragma warning(po... | pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
jmp 0x2c9a
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
andq -0x8(%rbp), %rax
popq %rbp
retq
nopw (%rax,%rax)
| /kfalconspb[P]curl/lib/warnless.c |
curlx_sotouz | size_t curlx_sotouz(curl_off_t sonum)
{
#ifdef __INTEL_COMPILER
# pragma warning(push)
# pragma warning(disable:810) /* conversion may lose significant bits */
#endif
DEBUGASSERT(sonum >= 0);
return (size_t)(sonum & (curl_off_t) CURL_MASK_USIZE_T);
#ifdef __INTEL_COMPILER
# pragma warning(pop)
#endif
} | pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
jmp 0x2cba
movq -0x8(%rbp), %rax
andq $-0x1, %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
| /kfalconspb[P]curl/lib/warnless.c |
curlx_sitouz | size_t curlx_sitouz(int sinum)
{
#ifdef __INTEL_COMPILER
# pragma warning(push)
# pragma warning(disable:810) /* conversion may lose significant bits */
#endif
DEBUGASSERT(sinum >= 0);
return (size_t) sinum;
#ifdef __INTEL_COMPILER
# pragma warning(pop)
#endif
} | pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
jmp 0x2d19
movslq -0x4(%rbp), %rax
popq %rbp
retq
| /kfalconspb[P]curl/lib/warnless.c |
CheckFromArray | static int CheckFromArray(void) {
FILE *const out = fopen("out.txt", "r");
int passed = 1;
if (!out) {
printf("can't open out.txt\n");
++testN;
return -1;
}
for (int i = 0; i < testInOut[testN].n; ++i) {
int n;
if (ScanInt(out, &n) != Pass || testInOut[testN].... | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x1eab(%rip), %rdi # 0x4285
leaq 0x1e47(%rip), %rsi # 0x4228
callq 0x21f0
testq %rax, %rax
je 0x24a7
movq %rax, %rbx
movslq 0x5d6b(%rip), %rax # 0x8164
imulq $0x110, %rax, %rax # imm = 0x110
leaq 0x48c9(%rip), %r12 ... | /Evgueni-Petrov-aka-espetrov[P]TestDriver/testlab1-2.c |
FeederBigRand1 | static int FeederBigRand1(void) {
FILE *const in = fopen("in.txt", "w");
if (!in) {
printf("can't create in.txt. No space on disk?\n");
return -1;
}
unsigned int bigTestN = testN - sizeof(testInOut) / sizeof(testInOut[0]);
if (bigTestN >= sizeof(seed) / sizeof(seed[0])) {
pri... | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x1b29(%rip), %rdi # 0x4023
leaq 0x1c82(%rip), %rsi # 0x4183
callq 0x21f0
testq %rax, %rax
je 0x2533
movq %rax, %rbx
movl 0x5c50(%rip), %eax # 0x8164
addl $-0x10, %eax
cmpl $0x2, %eax
jb 0x2544
leaq 0x1ce0(%rip), %rdi... | /Evgueni-Petrov-aka-espetrov[P]TestDriver/testlab1-2.c |
main | int main(int argc, char* argv[])
{
int i, count, fail;
const char* runnerExe = argv[0];
if (argc >= 3 && strcmp(argv[1], "-a") == 0) {
UserTestAll = 1;
argv++;
argc--;
}
if (argc >= 4 && strcmp(argv[1], "-m") == 0 && atoi(argv[2]) != 0) {
UserMemoryLimit = atoi(argv[... | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp # imm = 0x218
movq %rsi, %r13
movl %edi, %ebp
movq (%rsi), %rax
movq %rax, 0x28(%rsp)
cmpl $0x3, %edi
jl 0x2bd4
movq 0x8(%r13), %rdi
leaq 0x1728(%rip), %rsi # 0x42e6
callq 0x2170
testl %eax, %eax
jne 0x2bd4
addq $0x8, %r... | /Evgueni-Petrov-aka-espetrov[P]TestDriver/testDriver.c |
ScanUintUint | const char* ScanUintUint(FILE* out, unsigned* a, unsigned* b) {
int status = fscanf(out, "%u%u", a, b);
if (status < 0) {
PrintWithoutBuffering("output too short -- ");
return Fail;
} else if (status < 2) {
PrintWithoutBuffering("bad output format -- ");
return Fail;
}
... | pushq %rax
movq %rdx, %rcx
movq %rsi, %rdx
leaq 0x1047(%rip), %rsi # 0x4469
xorl %eax, %eax
callq 0x2040
testl %eax, %eax
js 0x343b
cmpl $0x1, %eax
jg 0x3452
leaq 0x104a(%rip), %rdi # 0x4483
jmp 0x3442
leaq 0x102c(%rip), %rdi # 0x446e
xorl %eax, %eax
callq 0x32bc
leaq 0xe8f(%rip), %rax # 0x42df
jmp... | /Evgueni-Petrov-aka-espetrov[P]TestDriver/testDriver.c |
random_read | void random_read(void *vbuf, size_t size)
{
assert(random_seedstr);
uint8_t *buf = (uint8_t *)vbuf;
while (size-- > 0) {
if (random_buf_limit == 0)
random_advance_counter();
*buf++ = random_buf[random_buf_limit--];
}
} | pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpq $0x0, 0x31df0(%rip) # 0x38250
je 0x64b3
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
leaq 0x31dee(%rip), %r12 # 0x38260
cmpq %r15, %rbx
je 0x64a7
movq 0x31dda(%rip), %rax # 0x38258
testq %rax, %rax
jne 0x648f
callq 0x64d2
movq 0x31dc9(%rip), %... | /codexns[P]putty/test/testsc.c |
random_advance_counter | static void random_advance_counter(void)
{
ssh_hash_reset(random_hash);
put_asciz(random_hash, random_seedstr);
put_uint64(random_hash, random_counter);
random_counter++;
random_buf_limit = ssh_hash_alg(random_hash)->hlen;
ssh_hash_digest(random_hash, random_buf);
} | pushq %rax
movq 0x31e1e(%rip), %rdi # 0x382f8
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x31e11(%rip), %rax # 0x382f8
movq 0x8(%rax), %rdi
movq 0x31d5e(%rip), %rsi # 0x38250
callq 0x1fbd3
movq 0x31dfa(%rip), %rax # 0x382f8
movq 0x8(%rax), %rdi
movq 0x31dff(%rip), %rsi # 0x38308
callq 0x1fb2b
incq 0x31... | /codexns[P]putty/test/testsc.c |
main | int main(int argc, char **argv)
{
bool doing_opts = true;
const char *pname = argv[0];
uint8_t tests_to_run[lenof(tests)];
bool keep_outfiles = false;
bool test_names_given = false;
memset(tests_to_run, 1, sizeof(tests_to_run));
random_hash = ssh_hash_new(&ssh_sha256);
while (--argc > ... | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20a8, %rsp # imm = 0x20A8
movq %rsi, %r15
movl %edi, %ebp
movq (%rsi), %r13
movaps 0x1ca3d(%rip), %xmm0 # 0x23010
leaq 0x40(%rsp), %rax
movups %xmm0, 0x4b(%rax)
movaps %xmm0, 0x40(%rax)
movaps %xmm0, 0x30(%rax)
movaps %xmm0, 0x20(%ra... | /codexns[P]putty/test/testsc.c |
test_mp_get_nbits | static void test_mp_get_nbits(void)
{
mp_int *z = mp_new(512);
static const size_t bitposns[] = {
0, 1, 5, 16, 23, 32, 67, 123, 234, 511
};
mp_int *prev = mp_from_integer(0);
for (size_t i = 0; i < looplimit(lenof(bitposns)); i++) {
mp_int *x = mp_power_2(bitposns[i]);
mp_add... | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl $0x200, %edi # imm = 0x200
callq 0x144a5
movq %rax, %rbx
xorl %r13d, %r13d
xorl %edi, %edi
callq 0x14547
movq %rax, %r15
leaq 0x1c485(%rip), %rbp # 0x23090
pushq $0xa
popq %r14
movq 0x3155a(%rip), %rax # 0x38170
movq %r... | /codexns[P]putty/test/testsc.c |
test_mp_select_into | static void test_mp_select_into(void)
{
mp_int *a = mp_random_bits(256);
mp_int *b = mp_random_bits(512);
mp_int *r = mp_new(384);
for (size_t i = 0; i < looplimit(16); i++) {
log_start();
mp_select_into(r, a, b, i & 1);
log_end();
}
mp_free(a);
mp_free(b);
mp_fre... | pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
leaq -0x9fc(%rip), %r14 # 0x6450
movl $0x100, %edi # imm = 0x100
movq %r14, %rsi
callq 0x17b6c
movq %rax, %rbx
movl $0x200, %edi # imm = 0x200
movq %r14, %rsi
callq 0x17b6c
movq %rax, %r14
movl $0x180, %edi # imm = 0x180
callq ... | /codexns[P]putty/test/testsc.c |
test_mp_cond_swap | static void test_mp_cond_swap(void)
{
mp_int *a = mp_random_bits(512);
mp_int *b = mp_random_bits(512);
for (size_t i = 0; i < looplimit(16); i++) {
log_start();
mp_cond_swap(a, b, i & 1);
log_end();
}
mp_free(a);
mp_free(b);
} | pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq -0xa94(%rip), %r14 # 0x6450
movl $0x200, %edi # imm = 0x200
movq %r14, %rsi
callq 0x17b6c
movq %rax, %rbx
movl $0x200, %edi # imm = 0x200
movq %r14, %rsi
callq 0x17b6c
movq %rax, %r14
xorl %r12d, %r12d
pushq $0x10
popq %r15
movq 0x31... | /codexns[P]putty/test/testsc.c |
test_mp_cond_clear | static void test_mp_cond_clear(void)
{
mp_int *a = mp_random_bits(512);
mp_int *x = mp_copy(a);
for (size_t i = 0; i < looplimit(16); i++) {
mp_copy_into(x, a);
log_start();
mp_cond_clear(a, i & 1);
log_end();
}
mp_free(a);
mp_free(x);
} | pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq -0xb16(%rip), %rsi # 0x6450
movl $0x200, %edi # imm = 0x200
callq 0x17b6c
movq %rax, %rbx
movq %rax, %rdi
callq 0x14990
movq %rax, %r14
xorl %r12d, %r12d
pushq $0x10
popq %r15
movq 0x311e4(%rip), %rax # 0x38170
movq %r15, %rdi
callq *%rax
c... | /codexns[P]putty/test/testsc.c |
test_mp_rshift_safe | static void test_mp_rshift_safe(void)
{
mp_int *x = mp_random_bits(256);
for (size_t i = 0; i < looplimit(mp_max_bits(x)+1); i++) {
log_start();
mp_int *r = mp_rshift_safe(x, i);
log_end();
mp_free(r);
}
mp_free(x);
} | pushq %r15
pushq %r14
pushq %rbx
leaq -0xbb9(%rip), %rsi # 0x6450
movl $0x100, %edi # imm = 0x100
callq 0x17b6c
movq %rax, %rbx
xorl %r14d, %r14d
movq 0x31150(%rip), %r15 # 0x38170
movq %rbx, %rdi
callq 0x14574
leaq 0x1(%rax), %rdi
callq *%r15
cmpq %rax, %r14
jae 0x7059
callq 0x6554
movq %rbx, %rdi
... | /codexns[P]putty/test/testsc.c |
test_mp_nthroot | static void test_mp_nthroot(void)
{
mp_int *x = mp_new(256), *remainder = mp_new(256);
for (size_t i = 0; i < looplimit(32); i++) {
uint8_t sizes[1];
random_read(sizes, 1);
mp_random_bits_into(x, sizes[0]);
log_start();
mp_free(mp_nthroot(x, 3, remainder));
log_e... | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl $0x100, %edi # imm = 0x100
callq 0x144a5
movq %rax, %rbx
movl $0x100, %edi # imm = 0x100
callq 0x144a5
movq %rax, %r14
xorl %r12d, %r12d
pushq $0x20
popq %r15
pushq $0x1
popq %r13
pushq $0x3
popq %rbp
movq 0x31005(%r... | /codexns[P]putty/test/testsc.c |
test_ecc_weierstrass_add | static void test_ecc_weierstrass_add(void)
{
WeierstrassCurve *wc = wcurve();
WeierstrassPoint *a = ecc_weierstrass_point_new_identity(wc);
WeierstrassPoint *b = ecc_weierstrass_point_new_identity(wc);
for (size_t i = 0; i < looplimit(5); i++) {
for (size_t j = 0; j < looplimit(5); j++) {
... | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
callq 0x8d34
movq %rax, %rbx
movq %rax, %rdi
callq 0x11b0d
movq %rax, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
movq %rbx, %rdi
callq 0x11b0d
movq %rax, (%rsp)
xorl %r15d, %r15d
pushq $0x5
popq %rbx
movq 0x30dc3(%rip), %rax # 0x38170
movq %rbx... | /codexns[P]putty/test/testsc.c |
test_ecc_weierstrass_add_general | static void test_ecc_weierstrass_add_general(void)
{
WeierstrassCurve *wc = wcurve();
WeierstrassPoint *a = ecc_weierstrass_point_new_identity(wc);
WeierstrassPoint *b = ecc_weierstrass_point_new_identity(wc);
for (size_t i = 0; i < looplimit(5); i++) {
for (size_t j = 0; j < looplimit(5); j++) ... | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
callq 0x8d34
movq %rax, %rbx
movq %rax, %rdi
callq 0x11b0d
movq %rax, %r14
movq %rbx, (%rsp)
movq %rbx, %rdi
callq 0x11b0d
movq %rax, %r15
xorl %r12d, %r12d
movq 0x30bbc(%rip), %rax # 0x38170
pushq $0x5
popq %rdi
callq *%rax
cmpq %rax, %r1... | /codexns[P]putty/test/testsc.c |
test_ecc_weierstrass_multiply | static void test_ecc_weierstrass_multiply(void)
{
WeierstrassCurve *wc = wcurve();
WeierstrassPoint *a = ecc_weierstrass_point_new_identity(wc);
mp_int *exponent = mp_new(56);
for (size_t i = 1; i < looplimit(5); i++) {
WeierstrassPoint *A = wpoint(wc, i);
ecc_weierstrass_point_copy_into... | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
callq 0x8d34
movq %rax, %rbx
movq %rax, %rdi
callq 0x11b0d
movq %rax, %r14
pushq $0x38
popq %rdi
callq 0x144a5
movq %rax, %r15
pushq $0x1
popq %r12
pushq $0x5
popq %r13
movq 0x30ac0(%rip), %rax # 0x38170
movq %r13, %rdi
callq *%rax
cmpq %r... | /codexns[P]putty/test/testsc.c |
test_ecc_weierstrass_is_identity | static void test_ecc_weierstrass_is_identity(void)
{
WeierstrassCurve *wc = wcurve();
WeierstrassPoint *a = ecc_weierstrass_point_new_identity(wc);
for (size_t i = 1; i < looplimit(5); i++) {
WeierstrassPoint *A = wpoint(wc, i);
ecc_weierstrass_point_copy_into(a, A);
ecc_weierstrass_... | pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
callq 0x8d34
movq %rax, %rbx
movq %rax, %rdi
callq 0x11b0d
movq %rax, %r14
pushq $0x1
popq %r15
pushq $0x5
popq %r12
movq 0x30a17(%rip), %rax # 0x38170
movq %r12, %rdi
callq *%rax
cmpq %rax, %r15
jae 0x779b
movq %rbx, %rdi
movq %r15, %rsi
callq 0x8db6
movq %rax... | /codexns[P]putty/test/testsc.c |
test_ecc_weierstrass_decompress | static void test_ecc_weierstrass_decompress(void)
{
WeierstrassCurve *wc = wcurve();
/* As in the mp_modsqrt test, prime the lazy initialisation of the
* ModsqrtContext */
mp_int *x = mp_new(144);
WeierstrassPoint *a = ecc_weierstrass_point_new_from_x(wc, x, 0);
if (a) /* don't... | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
callq 0x8d34
movq %rax, %rbx
movl $0x90, %edi
callq 0x144a5
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x11c22
testq %rax, %rax
je 0x78cb
movq %rax, %rdi
callq 0x11bf0
xorl %r15d, %r15d
pushq $0x5
popq %r13
movq 0x30... | /codexns[P]putty/test/testsc.c |
test_ecc_montgomery_double | static void test_ecc_montgomery_double(void)
{
MontgomeryCurve *wc = mcurve();
MontgomeryPoint *a = NULL;
for (size_t i = 0; i < looplimit(7); i++) {
MontgomeryPoint *A = mpoint(wc, i);
if (!a) {
a = A;
} else {
ecc_montgomery_point_copy_into(a, A);
... | pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
xorl %r14d, %r14d
callq 0x8eb3
movq %rax, %rbx
pushq $0x7
popq %r15
xorl %r12d, %r12d
movq 0x3069b(%rip), %rax # 0x38170
movq %r15, %rdi
callq *%rax
cmpq %rax, %r14
jae 0x7b2c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8f20
movq %rax, %r13
testq %r12, %r12
je 0x7b... | /codexns[P]putty/test/testsc.c |
test_ecc_montgomery_multiply | static void test_ecc_montgomery_multiply(void)
{
MontgomeryCurve *wc = mcurve();
MontgomeryPoint *a = NULL;
mp_int *exponent = mp_new(56);
for (size_t i = 0; i < looplimit(7); i++) {
MontgomeryPoint *A = mpoint(wc, i);
if (!a) {
a = A;
} else {
ecc_montgom... | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
callq 0x8eb3
movq %rax, %rbx
pushq $0x38
popq %rdi
callq 0x144a5
movq %rax, %r14
xorl %r15d, %r15d
pushq $0x7
popq %r12
xorl %r13d, %r13d
movq 0x305fc(%rip), %rax # 0x38170
movq %r12, %rdi
callq *%rax
cmpq %rax, %r15
jae 0x7bd6
movq %rbx, ... | /codexns[P]putty/test/testsc.c |
test_cipher_ssh_3des_ssh2 | static void test_mac(const ssh2_macalg *malg)
{
ssh2_mac *m = ssh2_mac_new(malg, NULL);
if (!m) {
test_skipped = true;
return;
}
uint8_t *mkey = snewn(malg->keylen, uint8_t);
size_t datalen = 256;
size_t maclen = malg->len;
uint8_t *data = snewn(datalen + maclen, uint8_t);
... | leaq 0x2e6bf(%rip), %rdi # 0x36850
jmp 0x908b
| /codexns[P]putty/test/testsc.c |
test_cipher_ssh_des_sshcom_ssh2 | static void test_mac(const ssh2_macalg *malg)
{
ssh2_mac *m = ssh2_mac_new(malg, NULL);
if (!m) {
test_skipped = true;
return;
}
uint8_t *mkey = snewn(malg->keylen, uint8_t);
size_t datalen = 256;
size_t maclen = malg->len;
uint8_t *data = snewn(datalen + maclen, uint8_t);
... | leaq 0x2e617(%rip), %rdi # 0x367c0
jmp 0x908b
| /codexns[P]putty/test/testsc.c |
test_cipher_ssh_aes192_cbc | static void test_mac(const ssh2_macalg *malg)
{
ssh2_mac *m = ssh2_mac_new(malg, NULL);
if (!m) {
test_skipped = true;
return;
}
uint8_t *mkey = snewn(malg->keylen, uint8_t);
size_t datalen = 256;
size_t maclen = malg->len;
uint8_t *data = snewn(datalen + maclen, uint8_t);
... | leaq 0x2dea7(%rip), %rdi # 0x36080
jmp 0x908b
| /codexns[P]putty/test/testsc.c |
test_cipher_ssh_aes256_sdctr_sw | static void test_mac(const ssh2_macalg *malg)
{
ssh2_mac *m = ssh2_mac_new(malg, NULL);
if (!m) {
test_skipped = true;
return;
}
uint8_t *mkey = snewn(malg->keylen, uint8_t);
size_t datalen = 256;
size_t maclen = malg->len;
uint8_t *data = snewn(datalen + maclen, uint8_t);
... | leaq 0x2e3ab(%rip), %rdi # 0x365a8
jmp 0x908b
| /codexns[P]putty/test/testsc.c |
test_cipher_ssh_aes192_sdctr_sw | static void test_mac(const ssh2_macalg *malg)
{
ssh2_mac *m = ssh2_mac_new(malg, NULL);
if (!m) {
test_skipped = true;
return;
}
uint8_t *mkey = snewn(malg->keylen, uint8_t);
size_t datalen = 256;
size_t maclen = malg->len;
uint8_t *data = snewn(datalen + maclen, uint8_t);
... | leaq 0x2e323(%rip), %rdi # 0x36538
jmp 0x908b
| /codexns[P]putty/test/testsc.c |
test_cipher_ssh_aes192_cbc_ni | static void test_mac(const ssh2_macalg *malg)
{
ssh2_mac *m = ssh2_mac_new(malg, NULL);
if (!m) {
test_skipped = true;
return;
}
uint8_t *mkey = snewn(malg->keylen, uint8_t);
size_t datalen = 256;
size_t maclen = malg->len;
uint8_t *data = snewn(datalen + maclen, uint8_t);
... | leaq 0x2f097(%rip), %rdi # 0x37300
jmp 0x908b
| /codexns[P]putty/test/testsc.c |
test_cipher_ssh_aes128_cbc_ni | static void test_mac(const ssh2_macalg *malg)
{
ssh2_mac *m = ssh2_mac_new(malg, NULL);
if (!m) {
test_skipped = true;
return;
}
uint8_t *mkey = snewn(malg->keylen, uint8_t);
size_t datalen = 256;
size_t maclen = malg->len;
uint8_t *data = snewn(datalen + maclen, uint8_t);
... | leaq 0x2f00f(%rip), %rdi # 0x37290
jmp 0x908b
| /codexns[P]putty/test/testsc.c |
test_mac_ssh_hmac_md5 | static void test_hash(const ssh_hashalg *halg)
{
ssh_hash *h = ssh_hash_new(halg);
if (!h) {
test_skipped = true;
return;
}
size_t datalen = 256;
uint8_t *data = snewn(datalen, uint8_t);
uint8_t *hash = snewn(halg->hlen, uint8_t);
for (size_t i = 0; i < looplimit(16); i++) ... | leaq 0x2e7a7(%rip), %rdi # 0x36a40
jmp 0x933b
| /codexns[P]putty/test/testsc.c |
test_mac_ssh_hmac_sha1_96_buggy | static void test_hash(const ssh_hashalg *halg)
{
ssh_hash *h = ssh_hash_new(halg);
if (!h) {
test_skipped = true;
return;
}
size_t datalen = 256;
uint8_t *data = snewn(datalen, uint8_t);
uint8_t *hash = snewn(halg->hlen, uint8_t);
for (size_t i = 0; i < looplimit(16); i++) ... | leaq 0x2e917(%rip), %rdi # 0x36be0
jmp 0x933b
| /codexns[P]putty/test/testsc.c |
mp__from_string_literal | static inline mp_int *mp__from_string_literal(const char *lit)
{
/* Don't call this directly; it's not equipped to deal with
* hostile data. Use only via the MP_LITERAL macro. */
if (lit[0] && (lit[1] == 'x' || lit[1] == 'X'))
return mp_from_hex(lit+2);
else
return mp_from_decimal(lit);... | cmpb $0x0, (%rdi)
je 0x14898
movzbl 0x1(%rdi), %eax
orl $0x20, %eax
cmpl $0x78, %eax
jne 0x14898
addq $0x2, %rdi
jmp 0x1497e
| /codexns[P]putty/mpint.h |
mpoint | static MontgomeryPoint *mpoint(MontgomeryCurve *wc, size_t index)
{
mp_int *x = NULL;
MontgomeryPoint *mp;
switch (index) {
case 0:
x = MP_LITERAL(31415);
break;
case 1:
x = MP_LITERAL(0x4d352c654c06eecfe19104118857b38398e8);
break;
case 2:
x = MP_LI... | pushq %r14
pushq %rbx
pushq %rax
cmpq $0x7, %rsi
jae 0x8f64
movq %rdi, %rbx
leaq 0x1a1ac(%rip), %rax # 0x230e0
movslq (%rax,%rsi,4), %rdi
addq %rax, %rdi
callq 0x8d12
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x12a5b
movq %rax, %rbx
movq %r14, %rdi
callq 0x1452a
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx... | /codexns[P]putty/test/testsc.c |
epoint | static EdwardsPoint *epoint(EdwardsCurve *wc, size_t index)
{
mp_int *x, *y;
EdwardsPoint *ep;
switch (index) {
case 0:
x = MP_LITERAL(0x0);
y = MP_LITERAL(0x1);
break;
case 1:
x = MP_LITERAL(0x3d8aef0294a67c1c7e8e185d987716250d7c);
y = MP_LITERAL(0x27184)... | pushq %r15
pushq %r14
pushq %rbx
cmpq $0x5, %rsi
jae 0x906c
movq %rdi, %rbx
leaq 0x1a0e2(%rip), %rax # 0x230fc
movslq (%rax,%rsi,4), %rdi
addq %rax, %rdi
leaq 0x1a0e8(%rip), %rax # 0x23110
movslq (%rax,%rsi,4), %r14
addq %rax, %r14
callq 0x8d12
movq %rax, %r15
movq %r14, %rdi
callq 0x8d12
movq %rax, %r14
movq %... | /codexns[P]putty/test/testsc.c |
pcs_new_with_firstbits | PrimeCandidateSource *pcs_new_with_firstbits(unsigned bits,
unsigned first, unsigned nfirst)
{
PrimeCandidateSource *s = snew(PrimeCandidateSource);
assert(first >> (nfirst-1) == 1);
s->bits = bits;
s->ready = false;
s->try_sophie_germain = false;
s... | pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %r15d
movl %esi, %ebp
movl %edi, %ebx
pushq $0x1
popq %rdi
pushq $0x58
popq %rsi
xorl %edx, %edx
callq 0x200f8
movq %rax, %r14
leal -0x1(%r15), %ecx
movl %ebp, %eax
shrl %cl, %eax
cmpl $0x1, %eax
jne 0x9e74
movl %ebx, (%r14)
movl %ebp, %edi
andl $0x0, 0x... | /codexns[P]putty/keygen/primecandidate.c |
pcs_free | void pcs_free(PrimeCandidateSource *s)
{
mp_free(s->limit);
mp_free(s->factor);
mp_free(s->addend);
for (size_t i = 0; i < s->nkps; i++)
mp_free(s->kps[i]);
sfree(s->avoids);
sfree(s->kps);
sfree(s);
} | pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x1452a
movq 0x10(%rbx), %rdi
callq 0x1452a
movq 0x18(%rbx), %rdi
callq 0x1452a
xorl %r14d, %r14d
cmpq 0x48(%rbx), %r14
jae 0x9ed8
movq 0x40(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x1452a
incq %r14
jmp 0x9ec0
movq 0x28(%rbx), %rdi
callq 0x2... | /codexns[P]putty/keygen/primecandidate.c |
pcs_ready | void pcs_ready(PrimeCandidateSource *s)
{
/*
* List all the small (modulus, residue) pairs we want to avoid.
*/
init_smallprimes();
#define ADD_AVOID(newmod, newres) do { \
sgrowarray(s->avoids, s->avoidsize, s->navoids); \
s->avoids[s->navoids].mod = ... | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0xa610
movq 0x18(%rbx), %rdi
movl $0x10000, %esi # imm = 0x10000
callq 0x1534f
movl $0x10000, %r15d # imm = 0x10000
testl %eax, %eax
jne 0xa22b
movq 0x18(%rbx), %rdi
callq 0x149e6
movq %rax, %r15
leaq 0x2... | /codexns[P]putty/keygen/primecandidate.c |
pcs_get_upper_bound | mp_int *pcs_get_upper_bound(PrimeCandidateSource *pcs)
{
/* Compute (limit-1) * factor + addend */
mp_int *tmp = mp_mul(pcs->limit, pcs->factor);
mp_int *bound = mp_add(tmp, pcs->addend);
mp_free(tmp);
mp_sub_into(bound, bound, pcs->factor);
return bound;
} | pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
movq 0x10(%rbx), %rsi
callq 0x1584a
movq %rax, %r14
movq 0x18(%rbx), %rsi
movq %rax, %rdi
callq 0x15442
movq %rax, %r15
movq %r14, %rdi
callq 0x1452a
movq 0x10(%rbx), %rdx
movq %r15, %rdi
movq %r15, %rsi
callq 0x1510b
movq %r15, %rax
popq %rbx
popq %... | /codexns[P]putty/keygen/primecandidate.c |
init_smallprimes | void init_smallprimes(void)
{
if (smallprimes_array[0])
return; /* already done */
bool A[65536];
for (size_t i = 2; i < lenof(A); i++)
A[i] = true;
for (size_t i = 2; i < lenof(A); i++) {
if (!A[i])
continue;
for (size_t j = 2*i; j <... | subq $0x10008, %rsp # imm = 0x10008
cmpw $0x0, 0x2dcf1(%rip) # 0x38310
jne 0xa698
pushq $0x2
popq %rax
cmpq $0x10000, %rax # imm = 0x10000
je 0xa635
movb $0x1, (%rsp,%rax)
incq %rax
jmp 0xa624
pushq $0x2
popq %rax
cmpq $0x10000, %rax # imm = 0x10000
je 0xa661
cmpb $0x1, (%rsp,%rax)
jne 0x... | /codexns[P]putty/keygen/smallprimes.c |
miller_rabin_free | void miller_rabin_free(MillerRabin *mr)
{
mp_free(mr->pm1);
mp_free(mr->m_pm1);
mp_free(mr->lowbit);
mp_free(mr->two);
monty_free(mr->mc);
smemclr(mr, sizeof(*mr));
sfree(mr);
} | pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x1452a
movq 0x10(%rbx), %rdi
callq 0x1452a
movq 0x18(%rbx), %rdi
callq 0x1452a
movq 0x20(%rbx), %rdi
callq 0x1452a
movq (%rbx), %rdi
callq 0x16139
pushq $0x28
popq %rsi
movq %rbx, %rdi
callq 0x206e0
movq %rbx, %rdi
popq %rbx
jmp 0x20165
| /codexns[P]putty/keygen/millerrabin.c |
pockle_free | void pockle_free(Pockle *pockle)
{
pockle_release(pockle, 0);
assert(count234(pockle->tree) == 0);
freetree234(pockle->tree);
sfree(pockle->list);
sfree(pockle);
} | pushq %rbx
movq %rdi, %rbx
xorl %esi, %esi
callq 0xabe2
movq (%rbx), %rdi
callq 0x20a5b
testl %eax, %eax
jne 0xabc5
movq (%rbx), %rdi
callq 0x20a0f
movq 0x8(%rbx), %rdi
callq 0x20165
movq %rbx, %rdi
popq %rbx
jmp 0x20165
leaq 0x19bd8(%rip), %rdi # 0x247a4
leaq 0x19bed(%rip), %rsi # 0x247c0
leaq 0x19c38(%rip), %... | /codexns[P]putty/keygen/pockle.c |
pockle_add_small_prime | PockleStatus pockle_add_small_prime(Pockle *pockle, mp_int *p)
{
if (mp_hs_integer(p, (1ULL << 32)))
return POCKLE_SMALL_PRIME_NOT_SMALL;
uint32_t val = mp_get_integer(p);
if (val < 2)
return POCKLE_PRIME_SMALLER_THAN_2;
init_smallprimes();
for (size_t i = 0; i < NSMALLPRIMES; i++... | pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movabsq $0x100000000, %rsi # imm = 0x100000000
movq %rbx, %rdi
callq 0x1534f
testl %eax, %eax
je 0xac6e
pushq $0x1
jmp 0xac81
movq %rbx, %rdi
callq 0x149e6
movq %rax, %r12
cmpl $0x2, %r12d
jae 0xac92
pushq $0x3
popq %r15
movl %r... | /codexns[P]putty/keygen/pockle.c |
aes_select | static ssh_cipher *aes_select(const ssh_cipheralg *alg)
{
const ssh_cipheralg *const *real_algs = (const ssh_cipheralg **)alg->extra;
for (size_t i = 0; real_algs[i]; i++) {
const ssh_cipheralg *alg = real_algs[i];
const struct aes_extra *alg_extra =
(const struct aes_extra *)alg->e... | pushq %r15
pushq %r14
pushq %rbx
movq 0x68(%rdi), %rbx
movq (%rbx), %rdi
testq %rdi, %rdi
je 0xb642
movq 0x68(%rdi), %r14
movq 0x8(%r14), %rax
cmpb $0x0, (%rax)
je 0xb61e
testb $0x1, 0x1(%rax)
je 0xb635
jmp 0xb63b
movq %rdi, %r15
callq *(%r14)
movq 0x8(%r14), %rcx
movb %al, 0x1(%rcx)
movb $0x1, (%rcx)
movq %r15, %rdi
t... | /codexns[P]putty/crypto/aes-select.c |
aes_sw_setkey | static void aes_sw_setkey(ssh_cipher *ciph, const void *vkey)
{
aes_sw_context *ctx = container_of(ciph, aes_sw_context, ciph);
aes_sliced_key_setup(&ctx->sk, vkey, ctx->ciph.vt->real_keybits);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rsi, 0xa8(%rsp)
movq (%rdi), %rax
movslq 0x4c(%rax), %rax
movq %rax, %r14
shrq $0x5, %r14
sarl $0x5, %eax
addl $0x6, %eax
movl %eax, -0x60(%rdi)
leaq 0x1c(,%r14,4), %rax
movq %rax, 0x90(%rsp)
movl %eax, %ebx
movq %rdi, 0x98(%rsp)
l... | /codexns[P]putty/crypto/aes-sw.c |
PUT_64BIT_LSB_FIRST | static inline void PUT_64BIT_LSB_FIRST(void *vp, uint64_t value)
{
uint8_t *p = (uint8_t *)vp;
p[0] = (uint8_t)(value);
p[1] = (uint8_t)(value >> 8);
p[2] = (uint8_t)(value >> 16);
p[3] = (uint8_t)(value >> 24);
p[4] = (uint8_t)(value >> 32);
p[5] = (uint8_t)(value >> 40);
p[6] = (uint8_... | movq %rsi, (%rdi)
retq
| /codexns[P]putty/misc.h |
aes_cbc_sw_decrypt | static inline void aes_cbc_sw_decrypt(
ssh_cipher *ciph, void *vblk, int blklen)
{
aes_sw_context *ctx = container_of(ciph, aes_sw_context, ciph);
uint8_t *blk = (uint8_t *)vblk;
/*
* CBC decryption can run in parallel, because all the
* _ciphertext_ blocks are already available.
*/
... | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp # imm = 0x148
movl %edx, %eax
movq %rsi, %r15
pushq $0x10
popq %rcx
cltd
idivl %ecx
cltq
pxor %xmm0, %xmm0
leaq 0x100(%rsp), %rcx
movdqa %xmm0, 0x30(%rcx)
movdqa %xmm0, 0x20(%rcx)
movdqa %xmm0, 0x10(%rcx)
movdqa %xmm0, (%rcx)... | /codexns[P]putty/crypto/aes-sw.c |
aes_sdctr_sw | static inline void aes_sdctr_sw(
ssh_cipher *ciph, void *vblk, int blklen)
{
aes_sw_context *ctx = container_of(ciph, aes_sw_context, ciph);
/*
* SDCTR encrypt/decrypt loops round one block at a time XORing
* the keystream into the user's data, and periodically has to run
* a parallel encryp... | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movslq %edx, %r15
addq %rsi, %r15
leaq -0x48(%rdi), %rax
movq %rax, 0x88(%rsp)
leaq -0x8(%rdi), %r12
leaq -0x39(%rdi), %rax
movq %rax, 0x98(%rsp)
leaq -0x4d0(%rdi), %rax
movq %rax, 0x90(%rsp)
pushq $0x1
po... | /codexns[P]putty/crypto/aes-sw.c |
hprime_final | static void hprime_final(ssh_hash *h, unsigned length, void *vout)
{
uint8_t *out = (uint8_t *)vout;
while (length > 64) {
uint8_t hashbuf[64];
ssh_hash_final(h, hashbuf);
memcpy(out, hashbuf, 32);
out += 32;
length -= 32;
h = blake2b_new_general(length > 64 ? ... | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r12
movq %rsp, %r14
pushq $0x40
popq %r13
pushq $0x40
popq %r15
movq %r12, %rdi
cmpl $0x41, %ebp
jb 0xef11
movq %r14, %rsi
callq 0xfa7e
movaps (%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
movups %xmm... | /codexns[P]putty/crypto/argon2.c |
G_xor | static void G_xor(uint8_t *out, const uint8_t *X, const uint8_t *Y)
{
uint64_t R[128], Q[128], Z[128];
for (unsigned i = 0; i < 128; i++)
R[i] = GET_64BIT_LSB_FIRST(X + 8*i) ^ GET_64BIT_LSB_FIRST(Y + 8*i);
for (unsigned i = 0; i < 8; i++)
P(Q+16*i, 2, R+16*i, 2);
for (unsigned i = 0; ... | pushq %rbp
pushq %r14
pushq %rbx
subq $0xc00, %rsp # imm = 0xC00
movq %rdi, %rbx
xorl %eax, %eax
cmpq $0x80, %rax
je 0xfb0e
movq (%rdx,%rax,8), %rcx
xorq (%rsi,%rax,8), %rcx
movq %rcx, (%rsp,%rax,8)
incq %rax
jmp 0xfaf5
xorl %r14d, %r14d
pushq $0x2
popq %rbp
cmpq $0x400, %r14 # imm = 0x400
je 0xfb... | /codexns[P]putty/crypto/argon2.c |
blake2b_digest | static void blake2b_digest(ssh_hash *hash, uint8_t *digest)
{
blake2b *s = container_of(hash, blake2b, hash);
memset(s->block + s->used, 0, sizeof(s->block) - s->used);
f_outer(s->h, s->block, s->lenhi, s->lenlo, 1);
uint8_t hash_pre[128];
for (unsigned i = 0; i < 8; i++)
PUT_64BIT_LSB_FIR... | pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x80, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq -0xf8(%rdi), %r15
leaq -0xb4(%rdi), %r12
movq -0x30(%rdi), %rax
addq %rax, %rdi
addq $-0xb4, %rdi
movl $0x80, %edx
subq %rax, %rdx
xorl %r13d, %r13d
xorl %esi, %esi
callq 0x6170
movq -0x28(%r14), %rdx
movq -0x20... | /codexns[P]putty/crypto/blake2.c |
ccp_free | static void ccp_free(ssh_cipher *cipher)
{
struct ccp_context *ctx = container_of(cipher, struct ccp_context, ciph);
smemclr(&ctx->a_cipher, sizeof(ctx->a_cipher));
smemclr(&ctx->b_cipher, sizeof(ctx->b_cipher));
smemclr(&ctx->mac, sizeof(ctx->mac));
sfree(ctx);
} | pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq -0x188(%rdi), %r14
movl $0x84, %esi
movq %r14, %rdi
callq 0x206e0
leaq -0x104(%rbx), %rdi
movl $0x84, %esi
callq 0x206e0
addq $-0x70, %rbx
pushq $0x58
popq %rsi
movq %rbx, %rdi
callq 0x206e0
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x20165
| /codexns[P]putty/crypto/chacha20-poly1305.c |
chacha20_iv | static void chacha20_iv(struct chacha20 *ctx, const unsigned char *iv)
{
ctx->state[12] = 0;
ctx->state[13] = 0;
ctx->state[14] = GET_32BIT_MSB_FIRST(iv);
ctx->state[15] = GET_32BIT_MSB_FIRST(iv + 4);
/* New IV, dump context */
ctx->currentIndex = 64;
} | pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
andq $0x0, 0x30(%rdi)
movq %rsi, %rdi
callq 0x10c96
movl %eax, 0x38(%r14)
addq $0x4, %rbx
movq %rbx, %rdi
callq 0x10c96
movl %eax, 0x3c(%r14)
movl $0x40, 0x80(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
| /codexns[P]putty/crypto/chacha20-poly1305.c |
ccp_length_op | static void ccp_length_op(struct ccp_context *ctx, void *blk, int len,
unsigned long seq)
{
unsigned char iv[8];
/*
* According to RFC 4253 (section 6.4), the packet sequence number wraps
* at 2^32, so its 32 high-order bits will always be zero.
*/
PUT_32BIT_LSB_FIRS... | pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rax
movq %rsp, %rbx
andl $0x0, (%rbx)
movq %rdi, %r14
movb %al, 0x4(%rbx)
movb %ah, 0x5(%rsp)
movl %eax, %ecx
shrl $0x10, %ecx
movb %cl, 0x6(%rbx)
shrl $0x18, %eax
movb %al, 0x7(%rbx)
movq %rbx, %rsi
callq 0x109c2
leaq 0x84(%r14), %rdi
movq %rbx, %rsi
callq 0x109c2
incl 0xb4... | /codexns[P]putty/crypto/chacha20-poly1305.c |
des_cbc_encrypt | static void des_cbc_encrypt(ssh_cipher *ciph, void *vdata, int len)
{
struct des_cbc_ctx *ctx = container_of(ciph, struct des_cbc_ctx, ciph);
uint8_t *data = (uint8_t *)vdata;
for (; len > 0; len -= 8, data += 8) {
LR plaintext = des_load_lr(data);
LR cipher_in = des_xor_lr(plaintext, ctx->i... | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
leaq -0x88(%rdi), %r12
pushq $0x1
popq %r13
testl %ebx, %ebx
jle 0x10e5a
movq %r14, %rdi
callq 0x11498
xorq -0x8(%r15), %rax
movq %rax, %rdi
movq %r12, %rsi
xorl %edx, %edx
movq %r13, %rcx
callq ... | /codexns[P]putty/crypto/des.c |
des_cbc_decrypt | static void des_cbc_decrypt(ssh_cipher *ciph, void *vdata, int len)
{
struct des_cbc_ctx *ctx = container_of(ciph, struct des_cbc_ctx, ciph);
uint8_t *data = (uint8_t *)vdata;
for (; len > 0; len -= 8, data += 8) {
LR ciphertext = des_load_lr(data);
LR cipher_out = des_full_cipher(ciphertext... | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
leaq -0x88(%rdi), %r12
pushq $-0x1
popq %rbp
testl %ebx, %ebx
jle 0x10ec2
movq %r14, %rdi
callq 0x11498
movq %rax, %r13
movq %rax, %rdi
movq %r12, %rsi
pushq $0xf
popq %rdx
movq %rbp, %rcx
callq ... | /codexns[P]putty/crypto/des.c |
des3_sdctr_setiv | static void des3_sdctr_setiv(ssh_cipher *ciph, const void *viv)
{
struct des3_sdctr_ctx *ctx = container_of(
ciph, struct des3_sdctr_ctx, ciph);
const uint8_t *iv = (const uint8_t *)viv;
/* Import the initial counter value into the internal representation */
for (unsigned i = 0; i < SDCTR_WORDS... | pushq %rbx
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x1156a
movq %rax, -0x8(%rbx)
popq %rbx
retq
| /codexns[P]putty/crypto/des.c |
des_key_setup | static void des_key_setup(uint64_t key, des_keysched *sched)
{
static const int8_t PC1[] = {
7, 15, 23, 31, 39, 47, 55, 63, 6, 14, 22, 30, 38, 46,
54, 62, 5, 13, 21, 29, 37, 45, 53, 61, 4, 12, 20, 28,
-1, -1, -1, -1,
1, 9, 17, 25, 33, 41, 49, 57, 2, 10, 18, 26, 34, 42,
... | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
leaq 0x13c25(%rip), %rsi # 0x25100
pushq $0x3c
popq %rdx
callq 0x11571
movq %rax, %r14
xorl %ebp, %ebp
leaq 0x13c51(%rip), %r15 # 0x25140
pushq $0x20
popq %r12
leaq 0x13c66(%rip), %r13 # 0x25160
cmpq $0x40, %rbp
je ... | /codexns[P]putty/crypto/des.c |
des_store_lr | static inline void des_store_lr(void *vp, LR lr)
{
uint8_t *p = (uint8_t *)vp;
PUT_32BIT_MSB_FIRST(p, lr.L);
PUT_32BIT_MSB_FIRST(p+4, lr.R);
} | movq %rsi, %rax
shrq $0x20, %rax
movl %esi, %ecx
rolw $0x8, %cx
movw %cx, 0x2(%rdi)
movl %esi, %ecx
shrl $0x10, %ecx
movb %cl, 0x1(%rdi)
movl %esi, %ecx
shrl $0x18, %ecx
movb %cl, (%rdi)
movb %al, 0x7(%rdi)
movq %rsi, %rax
shrq $0x28, %rax
movb %al, 0x6(%rdi)
movq %rsi, %rax
shrq $0x30, %rax
movb %al, 0x5(%rdi)
shrq $0... | /codexns[P]putty/crypto/des.c |
des_inner_cipher | static inline LR des_inner_cipher(LR lr, const des_keysched *sched,
size_t start, size_t step)
{
lr = des_round(lr, sched, start+0x0*step);
lr = des_round(lr, sched, start+0x1*step);
lr = des_round(lr, sched, start+0x2*step);
lr = des_round(lr, sched, start+0x3*step);
... | pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %r15
movq %rdx, %r14
movq %rsi, %rbx
callq 0x1182a
leaq (%r15,%r14), %rdx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1182a
leaq (%r14,%r15,2), %rdx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1182a
leaq (%r15,%r15,2), %rdx
addq %r14, %rdx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1182... | /codexns[P]putty/crypto/des.c |
ecc_weierstrass_point_new_from_x | WeierstrassPoint *ecc_weierstrass_point_new_from_x(
WeierstrassCurve *wc, mp_int *xorig, unsigned desired_y_parity)
{
assert(wc->sc);
/*
* The curve equation is y^2 = x^3 + ax + b, which is already
* conveniently in a form where we can compute the RHS and take
* the square root of it to get ... | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, (%rsp)
cmpq $0x0, 0x10(%rdi)
je 0x11d4a
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x16438
movq %rax, %r14
movq 0x8(%rbx), %rdi
movq %rax, %rsi
movq %rax, %rdx
callq 0x16384
movq %rax, %r15
movq 0x8(%rbx), %rdi
movq 0x18(%rbx), %rdx... | /codexns[P]putty/crypto/ecc-arithmetic.c |
ecc_weierstrass_double | WeierstrassPoint *ecc_weierstrass_double(WeierstrassPoint *P)
{
WeierstrassCurve *wc = P->wc;
WeierstrassPoint *D = ecc_weierstrass_point_new_empty(wc);
mp_int *lambda_n, *lambda_d;
ecc_weierstrass_tangent_slope(P, &lambda_n, &lambda_d);
ecc_weierstrass_epilogue(P->X, P->X, P->Y, P->Z, lambda_n, la... | pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
movq 0x18(%rdi), %rdi
callq 0x11b55
movq %rax, %rbx
leaq 0x10(%rsp), %r15
leaq 0x8(%rsp), %r12
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x12227
movq (%r14), %rdi
movq 0x8(%r14), %rdx
movq 0x10(%r14), %rcx
movq (%r15), %r14
movq (%... | /codexns[P]putty/crypto/ecc-arithmetic.c |
ecc_weierstrass_get_affine | void ecc_weierstrass_get_affine(
WeierstrassPoint *wp, mp_int **x, mp_int **y)
{
WeierstrassCurve *wc = wp->wc;
ecc_weierstrass_normalise(wp);
if (x)
*x = monty_export(wc->mc, wp->X);
if (y)
*y = monty_export(wc->mc, wp->Y);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, (%rsp)
movq %rsi, %r15
movq %rdi, %r14
movq 0x10(%rdi), %rsi
movq 0x18(%rdi), %rbx
movq 0x8(%rbx), %rdi
callq 0x163ca
movq %rax, %r12
movq 0x8(%rbx), %rdi
movq %rax, %rsi
movq %rax, %rdx
callq 0x16384
movq %rax, %r13
movq 0x8(%rbx),... | /codexns[P]putty/crypto/ecc-arithmetic.c |
ecc_montgomery_diff_add | MontgomeryPoint *ecc_montgomery_diff_add(
MontgomeryPoint *P, MontgomeryPoint *Q, MontgomeryPoint *PminusQ)
{
MontgomeryCurve *mc = P->mc;
assert(Q->mc == mc);
assert(PminusQ->mc == mc);
/*
* Differential addition is achieved using the following formula
* that relates the affine x-coordin... | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq 0x10(%rdi), %r15
cmpq %r15, 0x10(%rsi)
jne 0x12cf6
movq %rdx, 0x40(%rsp)
cmpq %r15, 0x10(%rdx)
jne 0x12d15
movq %rsi, %rbx
movq %rdi, %r14
movq %r15, %rdi
callq 0x12a9b
movq %rax, 0x38(%rsp)
movq 0x8(%r15), %rdi
movq (%r14), %rsi
mo... | /codexns[P]putty/crypto/ecc-arithmetic.c |
ecc_edwards_point_copy | EdwardsPoint *ecc_edwards_point_copy(EdwardsPoint *orig)
{
EdwardsPoint *ep = ecc_edwards_point_new_empty(orig->ec);
ep->X = mp_copy(orig->X);
ep->Y = mp_copy(orig->Y);
ep->Z = mp_copy(orig->Z);
ep->T = mp_copy(orig->T);
return ep;
} | pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
callq 0x1327f
movq %rax, %r14
movq (%rbx), %rdi
callq 0x14990
movq %rax, (%r14)
movq 0x8(%rbx), %rdi
callq 0x14990
movq %rax, 0x8(%r14)
movq 0x10(%rbx), %rdi
callq 0x14990
movq %rax, 0x10(%r14)
movq 0x18(%rbx), %rdi
callq 0x14990
movq %rax, 0x18(%r1... | /codexns[P]putty/crypto/ecc-arithmetic.c |
projective_eq | static inline unsigned projective_eq(
MontyContext *mc, mp_int *An, mp_int *Ad,
mp_int *Bn, mp_int *Bd)
{
mp_int *AnBd = monty_mul(mc, An, Bd);
mp_int *BnAd = monty_mul(mc, Bn, Ad);
unsigned toret = mp_cmp_eq(AnBd, BnAd);
mp_free(AnBd);
mp_free(BnAd);
return toret;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rdi, %r15
movq %r8, %rdx
callq 0x16384
movq %rax, %r12
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x16384
movq %rax, %rbx
movq %r12, %rdi
movq %rax, %rsi
callq 0x1539e
movl %eax, %ebp
movq %r12, %rdi
callq 0x1452a
mo... | /codexns[P]putty/crypto/ecc-arithmetic.c |
hmac_free | static void hmac_free(ssh2_mac *mac)
{
struct hmac *ctx = container_of(mac, struct hmac, mac);
ssh_hash_free(ctx->h_outer);
ssh_hash_free(ctx->h_inner);
ssh_hash_free(ctx->h_live);
smemclr(ctx->digest, ctx->hashalg->hlen);
sfree(ctx->digest);
strbuf_free(ctx->text_name);
smemclr(ctx, s... | pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq -0x30(%rdi), %rbx
movq -0x28(%rdi), %rdi
movq (%rdi), %rax
callq *0x20(%rax)
movq -0x20(%r14), %rdi
movq (%rdi), %rax
callq *0x20(%rax)
movq -0x18(%r14), %rdi
movq (%rdi), %rax
callq *0x20(%rax)
movq -0x30(%r14), %rax
movq -0x10(%r14), %rdi
movq 0x28(%rax), %rsi
cal... | /codexns[P]putty/crypto/hmac.c |
hmac_key | static void hmac_key(ssh2_mac *mac, ptrlen key)
{
struct hmac *ctx = container_of(mac, struct hmac, mac);
const uint8_t *kp;
size_t klen;
strbuf *sb = NULL;
if (key.len > ctx->hashalg->blocklen) {
/*
* RFC 2104 section 2: if the key exceeds the block length of
* the under... | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
movq -0x30(%rdi), %rax
cmpq %rdx, 0x30(%rax)
jae 0x13c35
callq 0x20897
movq %rax, %r15
movq -0x30(%rbx), %rax
movq 0x28(%rax), %rsi
movq %r15, %rdi
callq 0x20744
movq -0x30(%rbx), %rdi
movq 0x8(%... | /codexns[P]putty/crypto/hmac.c |
mp_from_bytes_int | static mp_int *mp_from_bytes_int(ptrlen bytes, size_t m, size_t c)
{
size_t nw = (bytes.len + BIGNUM_INT_BYTES - 1) / BIGNUM_INT_BYTES;
nw = size_t_max(nw, 1);
mp_int *n = mp_make_sized(nw);
for (size_t i = 0; i < bytes.len; i++)
n->w[i / BIGNUM_INT_BYTES] |=
(BignumInt)(((const unsi... | pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r12
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x7(%rsi), %rdi
shrq $0x3, %rdi
cmpq $0x1, %rdi
adcq $0x0, %rdi
callq 0x14438
addq %r12, %r15
xorl %edx, %edx
xorl %esi, %esi
cmpq %rsi, %r14
je 0x1475f
movzbl (%r15), %edi
movl %edx, %ecx
andb $0... | /codexns[P]putty/crypto/mpint.c |
mp_get_nbits | size_t mp_get_nbits(mp_int *x)
{
/* Sentinel values in case there are no bits set at all: we
* imagine that there's a word at position -1 (i.e. the topmost
* fraction word) which is all 1s, because that way, we handle a
* zero input by considering its highest set bit to be the top one
* of that ... | pushq %r14
pushq %rbx
subq $0x18, %rsp
leaq 0x8(%rsp), %rsi
orq $-0x1, (%rsi)
leaq 0x10(%rsp), %rbx
orq $-0x1, (%rbx)
xorl %r14d, %r14d
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x14aa5
pushq $0x20
popq %rcx
movq (%rbx), %rax
testq %rcx, %rcx
je 0x14a8e
movq %rax, %rdx
shrq %cl, %rdx
testq %rdx, %rdx
cmovneq %rdx, %rax
cmo... | /codexns[P]putty/crypto/mpint.c |
BinarySource_get_mp_ssh2 | mp_int *BinarySource_get_mp_ssh2(BinarySource *src)
{
ptrlen bytes = get_string(src);
if (get_err(src)) {
return mp_from_integer(0);
} else {
const unsigned char *p = bytes.ptr;
if ((bytes.len > 0 &&
((p[0] & 0x80) ||
(p[0] == 0 && (bytes.len <= 1 || !(p[1]... | pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
callq 0x1fe57
movq 0x20(%rbx), %rcx
cmpl $0x0, 0x18(%rcx)
je 0x150bb
xorl %edi, %edi
popq %rbx
jmp 0x14547
testq %rdx, %rdx
je 0x150c7
cmpb $0x0, (%rax)
js 0x150df
je 0x150d3
movq %rax, %rdi
movq %rdx, %rsi
popq %rbx
jmp 0x1476b
cmpq $0x1, %rdx
je 0x150df
cmpb $0x0, 0x1(... | /codexns[P]putty/crypto/mpint.c |
mp_invert_mod_2to | mp_int *mp_invert_mod_2to(mp_int *x, size_t p)
{
/* Input checks: x must be coprime to the modulus, i.e. odd, and p
* can't be zero */
assert(x->nw > 0);
assert(x->w[0] & 1);
assert(p > 0);
size_t rw = (p + BIGNUM_INT_BITS - 1) / BIGNUM_INT_BITS;
rw = size_t_max(rw, 1);
mp_int *r = mp_... | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
cmpq $0x0, (%rdi)
je 0x15f3b
movq 0x8(%rdi), %rax
testb $0x1, (%rax)
je 0x15f5a
movq %rsi, %r12
movq %rdi, 0x18(%rsp)
testq %rsi, %rsi
je 0x15f79
leaq 0x3f(%r12), %rbx
shrq $0x6, %rbx
cmpq $0x1, %rbx
adcq $0x0, %rbx
movq %rbx, %rdi
callq... | /codexns[P]putty/crypto/mpint.c |
monty_mul_into | void monty_mul_into(MontyContext *mc, mp_int *r, mp_int *x, mp_int *y)
{
assert(x->nw <= mc->rw);
assert(y->nw <= mc->rw);
mp_int scratch = *mc->scratch;
mp_int tmp = mp_alloc_from_scratch(&scratch, 2*mc->rw);
mp_mul_into(&tmp, x, y);
mp_int reduced = monty_reduce_internal(mc, &tmp, scratch);
... | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r14
movq 0x10(%rdi), %rsi
cmpq %rsi, (%rdx)
ja 0x1622f
movq %rcx, %r15
cmpq %rsi, (%rcx)
ja 0x1624e
movq %rdx, %r12
movq %rdi, %rbx
movq 0x40(%rdi), %rax
movups (%rax), %xmm0
movq %rsp, %r13
movaps %xmm0, (%r13)
addq %rsi, %r... | /codexns[P]putty/crypto/mpint.c |
mp_mod_known_integer | uint32_t mp_mod_known_integer(mp_int *x, uint32_t m)
{
uint64_t reciprocal = ((uint64_t)1 << 48) / m;
uint64_t accumulator = 0;
for (size_t i = mp_max_bytes(x); i-- > 0 ;) {
accumulator = 0x100 * accumulator + mp_get_byte(x, i);
/*
* Let A be the value in 'accumulator' at this point... | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movl %esi, %r13d
xorl %ebp, %ebp
movabsq $0x1000000000000, %rax # imm = 0x1000000000000
xorl %edx, %edx
divq %r13
movq %rax, %r15
movq (%rdi), %rax
leaq -0x1(,%rax,8), %r12
cmpq $-0x1, %r12
je 0x172dc
shlq $0x8... | /codexns[P]putty/crypto/mpint.c |
modsqrt_free | void modsqrt_free(ModsqrtContext *sc)
{
monty_free(sc->mc);
mp_free(sc->p);
mp_free(sc->z);
mp_free(sc->k);
mp_free(sc->km1o2);
if (sc->zk)
mp_free(sc->zk);
sfree(sc);
} | pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x16139
movq (%rbx), %rdi
callq 0x1452a
movq 0x28(%rbx), %rdi
callq 0x1452a
movq 0x18(%rbx), %rdi
callq 0x1452a
movq 0x20(%rbx), %rdi
callq 0x1452a
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x17918
callq 0x1452a
movq %rbx, %rdi
popq %rbx
jmp 0x20165
| /codexns[P]putty/crypto/mpint.c |
ntru_ring_multiply | void ntru_ring_multiply(uint16_t *out, const uint16_t *a, const uint16_t *b,
unsigned p, unsigned q)
{
SETUP;
/*
* Strategy: just compute the full product with 2p coefficients,
* and then reduce it mod x^p-x-1 by working downwards from the
* top coefficient replacing x^{p... | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r8d, %ebp
movq %rdx, %r14
movq %rsi, 0x30(%rsp)
movq %rdi, 0x28(%rsp)
movzwl %bp, %r12d
movq %rcx, 0x18(%rsp)
leal (%rcx,%rcx), %edi
xorl %ebx, %ebx
pushq $0x4
popq %rsi
movq %rdi, 0x8(%rsp)
xorl %edx, %edx
callq 0x200f8
movq %rax,... | /codexns[P]putty/crypto/ntru.c |
ntru_encode_schedule | NTRUEncodeSchedule *ntru_encode_schedule(const uint16_t *ms_in, size_t n)
{
NTRUEncodeSchedule *sched = snew(NTRUEncodeSchedule);
sched->nvals = n;
sched->endpos = n-1;
sched->nops = sched->opsize = 0;
sched->ops = NULL;
assert(n != 0);
/*
* 'ms' is the list of (m_i) on input to the c... | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r15
movq %rdi, %r12
pushq $0x1
popq %rdi
pushq $0x28
popq %rsi
xorl %edx, %edx
callq 0x200f8
movq %rax, %rbx
movq %r15, (%rax)
andq $0x0, 0x20(%rax)
movq %r15, %rax
subq $0x1, %rax
movq %rax, 0x8(%rbx)
xorps %xmm0, %xmm0
movu... | /codexns[P]putty/crypto/ntru.c |
ntru_encode | void ntru_encode(NTRUEncodeSchedule *sched, const uint16_t *rs_in,
BinarySink *bs)
{
size_t n = sched->nvals;
uint32_t *rs = snewn(n, uint32_t);
for (size_t i = 0; i < n; i++)
rs[i] = rs_in[i];
/*
* The head and tail pointers of the queue are both 'full'. That
* is, r... | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, (%rsp)
movq %rsi, %r13
movq %rdi, %r12
movq (%rdi), %rbx
xorl %r15d, %r15d
pushq $0x4
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x200f8
movq %rax, %r14
cmpq %r15, %rbx
je 0x18778
movzwl (%r13,%r15,2), %eax
movl %eax, (%r14,%r1... | /codexns[P]putty/crypto/ntru.c |
ntru_encode_pubkey_schedule | static NTRUEncodeSchedule *ntru_encode_pubkey_schedule(unsigned p, unsigned q)
{
uint16_t *ms = snewn(p, uint16_t);
for (size_t i = 0; i < p; i++)
ms[i] = q;
NTRUEncodeSchedule *sched = ntru_encode_schedule(ms, p);
sfree(ms);
return sched;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movl %edi, %ebx
xorl %r15d, %r15d
pushq $0x2
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x200f8
movq %rax, %r14
cmpq %r15, %rbx
je 0x190fc
movw %bp, (%r14,%r15,2)
incq %r15
jmp 0x190ed
movq %r14, %rdi
movq %rbx, %rsi
callq 0x184d4
movq %rax, %r... | /codexns[P]putty/crypto/ntru.c |
ntru_encode_ciphertext | void ntru_encode_ciphertext(const uint16_t *ciphertext, unsigned p, unsigned q,
BinarySink *bs)
{
SETUP;
/*
* Bias the ciphertext, and scale down by 1/3, which we do by
* modular multiplication by the inverse of 3 mod q. (That only
* works if we know the inputs are al... | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, 0x10(%rsp)
movl %edx, %ebp
movl %esi, %ebx
movq %rdi, 0x8(%rsp)
movzwl %bp, %r12d
movabsq $0x1000000000000, %rax # imm = 0x1000000000000
xorl %edx, %edx
divq %r12
movq %rax, %r14
movl %esi, %edi
pushq $0x2
popq %rsi
xorl %edx... | /codexns[P]putty/crypto/ntru.c |
ntru_encode_plaintext | void ntru_encode_plaintext(const uint16_t *plaintext, unsigned p,
BinarySink *bs)
{
unsigned byte = 0, bitpos = 0;
for (size_t i = 0; i < p; i++) {
unsigned encoding = (plaintext[i] + 1) * iszero(plaintext[i] >> 1);
byte |= encoding << bitpos;
bitpos += 2;
... | pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
movl %esi, %r15d
leaq -0x1(%r15), %r12
xorl %ecx, %ecx
xorl %r13d, %r13d
xorl %edx, %edx
cmpq %r13, %r15
je 0x1941d
movzwl (%r14,%r13,2), %eax
leal 0x1(%rax), %esi
shrl %eax
addl $0xffff, %eax # imm = 0xFFFF
shrl $0x10, %ea... | /codexns[P]putty/crypto/ntru.c |
ssh_ntru_new | static ecdh_key *ssh_ntru_new(const ssh_kex *kex, bool is_server)
{
if (is_server)
return ssh_ntru_server_new();
else
return ssh_ntru_client_new();
} | pushq %r14
pushq %rbx
pushq %rax
pushq $0x1
popq %rdi
testl %esi, %esi
je 0x19698
pushq $0x28
popq %rsi
xorl %edx, %edx
callq 0x200f8
movq %rax, %r14
leaq 0x20(%rax), %rbx
leaq 0x1d6af(%rip), %rax # 0x36cf8
movq %rax, 0x20(%r14)
pushq $0x2
popq %rsi
movl $0x2f9, %edi # imm = 0x2F9
xorl %edx, %edx
callq 0... | /codexns[P]putty/crypto/ntru.c |
ssh_ntru_server_getpublic | static void ssh_ntru_server_getpublic(ecdh_key *dh, BinarySink *bs)
{
ntru_server_key *nk = container_of(dh, ntru_server_key, ek);
/*
* In the server, this function is called after getkey, so we
* already have all our pieces prepared. Just concatenate them all
* into the 'server's public data' s... | pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rsi), %rdi
movq -0x18(%r14), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
callq 0x1fa75
movq 0x10(%rbx), %rdi
movq -0x10(%r14), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
callq 0x1fa75
movq -0x8(%r14), %rdi
movq (%rdi), %rax
movq 0x10(%... | /codexns[P]putty/crypto/ntru.c |
ssh_ntru_client_getpublic | static void ssh_ntru_client_getpublic(ecdh_key *dh, BinarySink *bs)
{
ntru_client_key *nk = container_of(dh, ntru_client_key, ek);
/*
* The client's public information is a single SSH string
* containing the NTRU public key and the Curve25519 public point
* concatenated. So write both of those i... | pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq -0x10(%rdi), %rax
movq 0x10(%rax), %rdi
movl $0x2f9, %esi # imm = 0x2F9
movl $0x11ef, %edx # imm = 0x11EF
movq %rbx, %rcx
callq 0x19066
movq -0x8(%r14), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
movq %rbx, %rsi
addq $0x8, %rsp... | /codexns[P]putty/crypto/ntru.c |
sha256_select | static ssh_hash *sha256_select(const ssh_hashalg *alg)
{
static const ssh_hashalg *const real_algs[] = {
#if HAVE_SHA_NI
&ssh_sha256_ni,
#endif
#if HAVE_NEON_CRYPTO
&ssh_sha256_neon,
#endif
&ssh_sha256_sw,
NULL,
};
for (size_t i = 0; real_algs[i]; i++) {
const ssh_ha... | pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
xorl %r14d, %r14d
leaq 0x1d0f2(%rip), %r15 # 0x36db0
cmpq $0x10, %r14
je 0x19d1c
movq (%r14,%r15), %rbx
movq 0x50(%rbx), %r12
movq 0x8(%r12), %rax
cmpb $0x0, (%rax)
je 0x19cde
testb $0x1, 0x1(%rax)
je 0x19cf1
jmp 0x19cf7
callq *(%r12)
movq 0x8(%r12), %rcx
movb ... | /codexns[P]putty/crypto/sha256-select.c |
sha256_sw_write | static void sha256_sw_write(BinarySink *bs, const void *vp, size_t len)
{
sha256_sw *s = BinarySink_DOWNCAST(bs, sha256_sw);
while (len > 0)
if (sha256_block_write(&s->blk, &vp, &len))
sha256_sw_block(s->core, s->blk.block);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp # imm = 0x168
movq %rdi, %r14
leaq -0x50(%rdi), %rax
movq %rax, 0x58(%rsp)
movq %rdi, 0x20(%rsp)
testq %rdx, %rdx
je 0x1a209
movq -0x10(%r14), %rdi
pushq $0x40
popq %r14
subq %rdi, %r14
cmpq %r14, %rdx
cmovbq %rdx, %r14
addq ... | /codexns[P]putty/crypto/sha256-sw.c |
sha256_sw_round | static inline void sha256_sw_round(
unsigned round_index, const uint32_t *schedule,
uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d,
uint32_t *e, uint32_t *f, uint32_t *g, uint32_t *h)
{
uint32_t t1 = *h + Sigma_1(*e) + Ch(*e,*f,*g) +
sha256_round_constants[round_index] + schedule[round_index... | pushq %rbp
pushq %r14
pushq %rbx
movq 0x28(%rsp), %r10
movq 0x30(%rsp), %r11
movq 0x20(%rsp), %rax
movl (%rax), %ebx
movl %ebx, %ebp
movl %ebx, %eax
movl (%r11), %r14d
movl (%r10), %r11d
xorl %r14d, %r11d
andl %ebx, %r11d
roll $0x1a, %ebx
roll $0x15, %ebp
movq 0x38(%rsp), %r10
xorl %ebx, %ebp
roll $0x7, %eax
xorl %ebp,... | /codexns[P]putty/crypto/sha256-sw.c |
keccak_new | static ssh_hash *keccak_new(const ssh_hashalg *alg)
{
struct keccak_hash *kh = snew(struct keccak_hash);
kh->hash.vt = alg;
BinarySink_INIT(kh, keccak_BinarySink_write);
BinarySink_DELEGATE_INIT(&kh->hash, kh);
return ssh_hash_reset(&kh->hash);
} | pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x1
popq %rdi
movl $0x1d8, %esi # imm = 0x1D8
xorl %edx, %edx
callq 0x200f8
movq %rbx, 0x1b0(%rax)
leaq 0x185(%rip), %rcx # 0x1ab41
movq %rcx, 0x1c0(%rax)
andq $0x0, 0x1c8(%rax)
leaq 0x1b0(%rax), %r14
leaq 0x1c0(%rax), %rcx
movq %rcx, 0x1d0(%rax)
... | /codexns[P]putty/crypto/sha3.c |
aes_ni_setkey | static void aes_ni_setkey(ssh_cipher *ciph, const void *vkey)
{
aes_ni_context *ctx = container_of(ciph, aes_ni_context, ciph);
const unsigned char *key = (const unsigned char *)vkey;
aes_ni_key_expand(key, ctx->ciph.vt->real_keybits / 32,
ctx->keysched_e, ctx->keysched_d);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xf8, %rsp
movq %rdi, %rbx
leaq -0x1f8(%rdi), %r14
movq (%rdi), %rax
movl 0x4c(%rax), %ecx
pushq $0x20
popq %rdi
movl %ecx, %eax
cltd
idivl %edi
movslq %eax, %r15
andl $-0x20, %ecx
leaq (,%r15,4), %r8
movq %rsp, %r9
subq %r8, %r9
negq %r8
xorl %edi, %edi
leaq 0xb825(%ri... | /codexns[P]putty/crypto/aes-ni.c |
aes_sdctr_ni | static inline void aes_sdctr_ni(
ssh_cipher *ciph, void *vblk, int blklen, aes_ni_fn encrypt)
{
aes_ni_context *ctx = container_of(ciph, aes_ni_context, ciph);
for (uint8_t *blk = (uint8_t *)vblk, *finish = blk + blklen;
blk < finish; blk += 16) {
__m128i counter = aes_ni_sdctr_reverse(ctx... | pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq -0x1f8(%rdi), %r12
movslq %edx, %r13
addq %rsi, %r13
cmpq %r13, %r14
jae 0x1bac2
movdqa -0x18(%r15), %xmm0
pshufb 0xb016(%rip), %xmm0 # 0x26a90
movq %r12, %rdi
callq *%rbx
movdqu (%r14), %xmm1
pxor %xmm0, %xm... | /codexns[P]putty/crypto/aes-ni.c |
sha256_ni_reset | static void sha256_ni_reset(ssh_hash *hash)
{
sha256_ni *s = container_of(hash, sha256_ni, hash);
/* Initialise the core vectors in their storage order */
s->core[0] = _mm_set_epi64x(
0x6a09e667bb67ae85ULL, 0x510e527f9b05688cULL);
s->core[1] = _mm_set_epi64x(
0x3c6ef372a54ff53aULL, 0x1f... | movaps 0xb0d8(%rip), %xmm0 # 0x26c30
movaps %xmm0, -0x90(%rdi)
movaps 0xb0da(%rip), %xmm0 # 0x26c40
movaps %xmm0, -0x80(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, -0x30(%rdi)
retq
| /codexns[P]putty/crypto/sha256-ni.c |
sha1_ni_available | static bool sha1_ni_available(void)
{
unsigned int CPUInfo[4];
GET_CPU_ID_0(CPUInfo);
if (CPUInfo[0] < 7)
return false;
GET_CPU_ID_7(CPUInfo);
return CPUInfo[1] & (1 << 29); /* Check SHA */
} | xorl %esi, %esi
xorl %eax, %eax
xchgq %rbx, %rdi
cpuid
xchgq %rbx, %rdi
cmpl $0x7, %eax
jb 0x1c4ab
pushq $0x7
popq %rax
xorl %ecx, %ecx
xchgq %rbx, %rsi
cpuid
xchgq %rbx, %rsi
shrl $0x1d, %esi
andl $0x1, %esi
movl %esi, %eax
retq
nop
| /codexns[P]putty/crypto/sha1-ni.c |
Subsets and Splits
SQL Console for LLM4Binary/decompile-bench
Filters out entries with file names ending in .cpp, providing a basic subset of the dataset that excludes C++ files.