|
iPXE
|
Big integer support. More...
#include <stdint.h>Go to the source code of this file.
Typedefs | |
| typedef uint32_t | bigint_element_t |
| Element of a big integer. | |
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| FILE_SECBOOT (PERMITTED) | |
| static | __attribute__ ((always_inline)) int bigint_add_raw(const uint32_t *addend0 |
| Add big integers. | |
| __asm__ | __volatile__ ("xor %0, %0\n\t" "\n1:\n\t" "lodsl\n\t" "adcl %%eax, (%5,%0,4)\n\t" "inc %0\n\t" "loop 1b\n\t" :"=&r"(index), "=&S"(discard_S), "=&c"(discard_c), "=@ccc"(carry), "+m"(*value) :"r"(value0), "1"(addend0), "2"(size) :"eax") |
| __asm__ | __volatile__ ("xor %0, %0\n\t" "\n1:\n\t" "lodsl\n\t" "sbbl %%eax, (%5,%0,4)\n\t" "inc %0\n\t" "loop 1b\n\t" :"=&r"(index), "=&S"(discard_S), "=&c"(discard_c), "=@ccc"(borrow), "+m"(*value) :"r"(value0), "1"(subtrahend0), "2"(size) :"eax") |
| __asm__ | __volatile__ ("xor %0, %0\n\t" "\n1:\n\t" "rcll $1, (%4,%0,4)\n\t" "inc %0\n\t" "loop 1b\n\t" :"=&r"(index), "=&c"(discard_c), "=@ccc"(out), "+m"(*value) :"r"(value0), "1"(size)) |
| __asm__ | __volatile__ ("clc\n\t" "\n1:\n\t" "rcrl $1, -4(%3,%0,4)\n\t" "loop 1b\n\t" :"=&c"(discard_c), "=@ccc"(out), "+m"(*value) :"r"(value0), "0"(size)) |
| __asm__ | __volatile__ ("rep movsl\n\t" "xorl %%eax, %%eax\n\t" "mov %4, %2\n\t" "rep stosl\n\t" :"=&D"(discard_D), "=&S"(discard_S), "=&c"(discard_c), "+m"(*dest) :"g"(pad_size), "0"(dest0), "1"(source0), "2"(source_size) :"eax") |
| __asm__ | __volatile__ ("rep movsl\n\t" :"=&D"(discard_D), "=&S"(discard_S), "=&c"(discard_c), "+m"(*dest) :"0"(dest0), "1"(source0), "2"(dest_size) :"eax") |
| __asm__ | __volatile__ ("mull %3\n\t" "addl %5, %0\n\t" "adcl $0, %1\n\t" "addl %0, %2\n\t" "adcl $0, %1\n\t" :"=&a"(discard_a), "=&d"(*carry), "+m"(*result) :"g"(multiplicand), "0"(multiplier), "r"(*carry)) |
Variables | |
| static uint32_t * | value0 |
| static uint32_t unsigned int | size |
| long | index = ( bit / ( 8 * sizeof ( value->element[0] ) ) ) |
| void * | discard_S |
| long | discard_c |
| int | carry |
| int | borrow |
| int | out |
| static unsigned int | source_size |
| static unsigned int uint32_t * | dest0 |
| static unsigned int uint32_t unsigned int | dest_size |
| long | pad_size = ( dest_size - source_size ) |
| void * | discard_D |
| static unsigned int source_size | __unused |
| static const uint32_t | multiplier |
| Port multiplier number. | |
| static const uint32_t uint32_t * | result |
Big integer support.
Definition in file bigint.h.
| typedef uint32_t bigint_element_t |
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
| FILE_SECBOOT | ( | PERMITTED | ) |
|
inlinestatic |
Add big integers.
Multiply big integer elements.
Shrink big integer.
Grow big integer.
Shift big integer right.
Shift big integer left.
Subtract big integers.
| addend0 | Element 0 of big integer to add |
| value0 | Element 0 of big integer to be added to |
| size | Number of elements |
| carry | Carry flag |
| subtrahend0 | Element 0 of big integer to subtract |
| value0 | Element 0 of big integer to be subtracted from |
| size | Number of elements |
| borrow | Borrow flag |
| out | Bit shifted out |
| source0 | Element 0 of source big integer |
| source_size | Number of elements in source big integer |
| dest0 | Element 0 of destination big integer |
| dest_size | Number of elements in destination big integer |
| multiplicand | Multiplicand element |
| multiplier | Multiplier element |
| result | Result element |
| carry | Carry element |
| __asm__ __volatile__ | ( | "xor % | 0, |
| %0\n\t" "\n1:\n\t" "lodsl\n\t" "adcl %% | eax ) |
| __asm__ __volatile__ | ( | "xor % | 0, |
| %0\n\t" "\n1:\n\t" "lodsl\n\t" "sbbl %% | eax ) |
| __asm__ __volatile__ | ( | "xor % | 0, |
| %0\n\t" "\n1:\n\t" "rcll | $1 ) |
| __asm__ __volatile__ | ( | "clc\n\t" "\n1:\n\t" "rcrl | $1 | ) |
| __asm__ __volatile__ | ( | "rep movsl\n\t" "xorl %% | eax, |
| %%eax\n\t" "mov % | 4 ) |
| __asm__ __volatile__ | ( | ) |
| __asm__ __volatile__ | ( | "mull %3\n\t" "addl % | 5, |
| %0\n\t" "adcl | $0, | ||
| %1\n\t" "addl % | 0, | ||
| %2\n\t" "adcl | $0 ) |
References __asm__(), carry, multiplier, and result.
| uint32_t * value0 |
Definition at line 26 of file bigint.h.
Referenced by __volatile__(), __volatile__(), __volatile__(), __volatile__(), bigint_add_raw(), bigint_add_sample(), bigint_bit_is_set_raw(), bigint_bit_is_set_sample(), bigint_done_raw(), bigint_done_sample(), bigint_init_raw(), bigint_init_sample(), bigint_is_geq_raw(), bigint_is_geq_sample(), bigint_is_zero_raw(), bigint_is_zero_sample(), bigint_max_set_bit_raw(), bigint_max_set_bit_sample(), bigint_montgomery_raw(), bigint_montgomery_relaxed_raw(), bigint_montgomery_sample(), bigint_multiply_one(), bigint_ntoa_raw(), bigint_shl_raw(), bigint_shl_sample(), bigint_shr_raw(), bigint_shr_sample(), bigint_subtract_raw(), and bigint_subtract_sample().
| unsigned int size |
Definition at line 30 of file bigint.h.
Referenced by __volatile__(), __volatile__(), __volatile__(), _tg3_flag(), _tg3_flag_clear(), _tg3_flag_set(), a3c90x_prepare_rx_desc(), acpi_find(), acpi_find(), acpi_find_rsdt(), acpi_find_via_rsdt(), acpi_table(), acpi_test_find(), amd8111e_poll(), amd8111e_transmit(), amd8111e_wait_tx_ring(), arbel_cmd_hw2sw_eq(), arbel_cmd_read_mgm(), arbel_cmd_sw2hw_eq(), arbel_cmd_sw2hw_mpt(), arbel_cmd_write_mgm(), arbel_mcast_attach(), arbel_mcast_detach(), ath5k_hw_rfb_op(), atl1e_clean_tx_ring(), b44_cam_write(), b44_cam_write(), b44_populate_rx_descriptor(), bitmap_set(), bitmap_test(), cpio_header(), deflate_inflate(), deflate_length(), deflate_set_length(), des_generate(), dns_send_packet(), draw_menu_item(), dt_ioremap(), dynui_item(), dynui_shortcut(), ecam_find(), ecam_read(), ecam_write(), efi_block_boot(), efi_entropy_tick(), efi_file_read_dir(), efi_null_usb_get_endpoint_descriptor(), efi_null_usb_get_string_descriptor(), efi_usb_async_start(), efi_usb_async_stop(), efi_usb_close(), efi_usb_control_transfer(), efi_usb_get_endpoint_descriptor(), efi_usb_get_string_descriptor(), efi_usb_is_open(), efi_usb_open(), efi_usb_sync_transfer(), efi_wait_for_event_wrapper(), efifb_draw(), efifb_draw_unknown(), efifb_dynamic(), efifb_glyph(), efipci_discover_any(), efipci_discover_one(), ehci_dequeue(), ehci_endpoint_poll(), ehci_enqueue(), ena_admin(), ena_admin_req(), ena_poll_rx(), ena_poll_tx(), ena_refill_rx(), ena_transmit(), exanic_expired(), exanic_poll_rx(), exanic_probe_port(), exanic_remove_port(), falcon_read_sram(), falcon_write_sram(), fbcon_cell(), fdt_cells(), fdt_reg_address(), fdt_reg_size(), fdtmem_update_node(), find_smbios(), gve_admin(), gve_admin_command(), gve_poll_rx(), gve_poll_tx(), gve_refill_rx(), gve_transmit(), hermon_cmd_hw2sw_eq(), hermon_cmd_hw2sw_mpt(), hermon_cmd_query_eq(), hermon_cmd_read_mcg(), hermon_cmd_sw2hw_eq(), hermon_cmd_sw2hw_mpt(), hermon_cmd_write_mcg(), hermon_mcast_attach(), hermon_mcast_detach(), hkdf_expand(), igbvf_rar_set_vf(), intelxl_admin_command(), intelxl_admin_event_init(), intelxl_context(), intelxl_context_dump(), intelxl_context_line(), intelxlvf_admin_event(), isapnp_read_iobase(), isapnp_read_irqno(), jump_scroll(), memmap_settings_fetch(), nodnic_port_add_mac_filter(), nodnic_port_recv_db_dma(), nodnic_port_remove_mac_filter(), nodnic_port_send_db_dma(), nodnic_port_update_ring_doorbell(), nvconfig_get_tlv_type_and_class(), nvconfig_nvdata_access(), nvconfig_nvdata_default_access(), nvconfig_read_rom_ini_values(), nvconfig_set_fw_reset_level(), pcicloud_find(), pcnet32_dwio_read_bcr(), pcnet32_dwio_read_csr(), pcnet32_dwio_write_bcr(), pcnet32_dwio_write_csr(), pcnet32_wio_read_bcr(), pcnet32_wio_read_csr(), pcnet32_wio_write_bcr(), pcnet32_wio_write_csr(), peerdist_info_block(), peerdist_info_segment(), peerdist_info_v1_block_offset(), peerdist_info_v1_segment(), peerdist_info_v2_segment(), phantom_clp_cmd(), phantom_refill_rx_ring(), phantom_transmit(), phantom_update_macaddr(), pnm_bitmap(), pnm_data(), pnm_greymap(), pnm_pixmap(), pxe_menu_draw_item(), qib7322_send_buffer_offset(), return(), ring_next(), select_setting_row(), sign_extend32(), slirp_add_poll(), slirp_get_revents(), smbios_string(), smscusb_get_statistics(), uart_find(), uhci_dequeue(), uhci_endpoint_poll(), uhci_enqueue(), usb_autoconfigure(), usb_clear_feature(), usb_config_descriptor(), usb_control(), usb_endpoint_described(), usb_endpoint_descriptor(), usb_get_config_descriptor(), usb_get_descriptor(), usb_get_status(), usb_get_string_descriptor(), usb_hub_clear_port_feature(), usb_hub_set_port_feature(), usb_message(), usb_set_configuration(), usb_set_feature(), usb_settings_fetch(), usbio_bulk_in_poll(), usbio_bulk_out_poll(), usbio_control_poll(), usbio_endpoint_close(), usbio_endpoint_enqueue(), usbio_interrupt_callback(), usbio_interrupt_poll(), vesafb_glyph(), virtio_net_complete(), virtio_net_enable(), virtio_net_queue_init(), virtio_net_submit(), virtio_queue_init(), virtio_submit(), xen_hvm_get_param(), xhci_dequeue(), xhci_enqueue(), xhci_ring_consumed(), and xhci_set_tr_dequeue_pointer().
| void * discard_S |
Definition at line 31 of file bigint.h.
Referenced by __volatile__(), __volatile__(), __volatile__(), __volatile__(), copy_from_real_libkir(), copy_to_real_libkir(), nbi_boot16(), nbi_boot32(), and tcpip_continue_chksum().
| long discard_c |
Definition at line 32 of file bigint.h.
Referenced by __volatile__(), __volatile__(), __volatile__(), __volatile__(), __volatile__(), __volatile__(), __volatile__(), bios_putchar(), copy_from_real_libkir(), copy_to_real_libkir(), cpuid_supported(), int13_load_mbr(), int13con_init(), pcibios_write(), pxe_start_nbp(), rdrand_get_noise(), rdtsc_probe(), tcpip_continue_chksum(), and ucode_exec().
Definition at line 33 of file bigint.h.
Referenced by __volatile__(), __volatile__(), apm_poweroff(), bigint_add_okx(), bigint_montgomery_relaxed_raw(), bigint_multiply_one(), bigint_reduce_raw(), and gcm_multiply_x().
| return borrow |
Definition at line 65 of file bigint.h.
Referenced by __volatile__(), and bigint_subtract_okx().
| unsigned int source_size |
Definition at line 141 of file bigint.h.
Referenced by __volatile__(), bigint_grow_raw(), bigint_grow_sample(), bigint_shrink_raw(), bigint_shrink_sample(), and efi_load_image_wrapper().
| unsigned int source_size uint32_t * dest0 |
Definition at line 142 of file bigint.h.
Referenced by __volatile__(), __volatile__(), bigint_copy_sample(), bigint_grow_raw(), bigint_grow_sample(), bigint_shrink_raw(), and bigint_shrink_sample().
| unsigned int source_size uint32_t unsigned int dest_size |
Definition at line 142 of file bigint.h.
Referenced by __volatile__(), bigint_grow_raw(), bigint_grow_sample(), bigint_shrink_raw(), and bigint_shrink_sample().
| long pad_size = ( dest_size - source_size ) |
Definition at line 145 of file bigint.h.
Referenced by __volatile__().
| void * discard_D |
Definition at line 146 of file bigint.h.
Referenced by __volatile__(), __volatile__(), __volatile__(), call_bootsector(), copy_from_real_libkir(), copy_to_real_libkir(), meme820(), nbi_boot16(), nbi_boot32(), pcibios_discover(), pcibios_read(), pcibios_write(), pxe_start_nbp(), and undinet_call().
| unsigned int source_size __unused |
| uint8_t multiplier |
Port multiplier number.
Definition at line 195 of file bigint.h.
Referenced by __volatile__(), bigint_mod_exp_ladder(), bigint_multiply_okx(), bigint_multiply_one(), bigint_multiply_raw(), bigint_multiply_sample(), x25519_multiply(), and x25519_multiply_okx().