Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
arch/x86/boot/string.c
int bcmp(const void *s1, const void *s2, size_t len) { return memcmp(s1, s2, len); }
[ 0, 0 ]
Linux Kernel
arch/x86/boot/string.c
unsigned long long simple_strtoull(const char *cp, char **endp, unsigned int base) { unsigned long long result = 0; if (!base) base = simple_guess_base(cp); if (base == 16 && cp[0] == '0' && TOLOWER(cp[1]) == 'x') cp += 2; while (isxdigit(*cp)) { unsigned int va...
[ 1, 0 ]
Linux Kernel
arch/x86/boot/string.c
char *strstr(const char *s1, const char *s2) { size_t l1, l2; l2 = strlen(s2); if (!l2) return (char *)s1; l1 = strlen(s1); while (l1 >= l2) { l1--; if (!memcmp(s1, s2, l2)) return (char *)s1; s1++; } return NULL; }
[ 0, 0 ]
Linux Kernel
arch/x86/boot/string.c
int boot_kstrtoul(const char *s, unsigned int base, unsigned long *res) { if (sizeof(unsigned long) == sizeof(unsigned long long) && __alignof__(unsigned long) == __alignof__(unsigned long long)) return kstrtoull(s, base, (unsigned long long *)res); else return _kstrtoul(s, base, res); }
[ 1, 0 ]
Linux Kernel
arch/x86/boot/tools/build.c
static void usage(void) { die("Usage: build setup system zoffset.h image"); } #ifdef CONFIG_EFI_STUB
[ 0, 0 ]
Linux Kernel
arch/x86/boot/tools/build.c
static void update_pecoff_section_header(char *section_name, u32 offset, u32 size) { update_pecoff_section_header_fields(section_name, offset, size, size, offset); }
[ 0, 0 ]
Linux Kernel
arch/x86/boot/tools/build.c
static void update_pecoff_setup_and_reloc(unsigned int size) { u32 setup_offset = 0x200; u32 reloc_offset = size - PECOFF_RELOC_RESERVE - PECOFF_COMPAT_RESERVE; #ifdef CONFIG_EFI_MIXED u32 compat_offset = reloc_offset + PECOFF_RELOC_RESERVE; #endif u32 setup_size = reloc_offset - setup_offset; update_pecoff_...
[ 1, 0 ]
Linux Kernel
arch/x86/boot/tools/build.c
static int reserve_pecoff_reloc_section(int c) { memset(buf + c, 0, PECOFF_RELOC_RESERVE); return PECOFF_RELOC_RESERVE; }
[ 1, 0 ]
Linux Kernel
arch/x86/boot/tools/build.c
static inline void update_pecoff_text(unsigned int text_start, unsigned int file_sz, unsigned int init_sz) {}
[ 0, 0 ]
Linux Kernel
arch/x86/boot/tools/build.c
static inline void efi_stub_entry_update(void) {}
[ 0, 0 ]
Linux Kernel
arch/x86/boot/tools/build.c
static inline int reserve_pecoff_reloc_section(int c) { return 0; } #endif
[ 0, 0 ]
Linux Kernel
arch/x86/boot/tty.c
int getchar(void) { struct biosregs ireg, oreg; initregs(&ireg); intcall(0x16, &ireg, &oreg); return oreg.al; }
[ 0, 0 ]
Linux Kernel
arch/x86/boot/tty.c
static int kbd_pending(void) { struct biosregs ireg, oreg; initregs(&ireg); ireg.ah = 0x01; intcall(0x16, &ireg, &oreg); return !(oreg.eflags & X86_EFLAGS_ZF); }
[ 1, 0 ]
Linux Kernel
arch/x86/boot/tty.c
void kbd_flush(void) { for (;;) { if (!kbd_pending()) break; getchar(); } }
[ 0, 0 ]
Linux Kernel
arch/x86/boot/video-bios.c
static int bios_set_mode(struct mode_info *mi) { return set_bios_mode(mi->mode - VIDEO_FIRST_BIOS); }
[ 0, 0 ]
Linux Kernel
arch/x86/boot/video-mode.c
static void vga_recalc_vertical(void) { unsigned int font_size, rows; u16 crtc; u8 pt, ov; set_fs(0); font_size = rdfs8(0x485); rows = force_y ? force_y : rdfs8(0x484) + 1; /* Text rows */ rows *= font_size; /* Visible scan lines */ rows--; /* ... minus one */ crtc = vga_crtc(); pt = ...
[ 1, 1 ]
Linux Kernel
arch/x86/boot/video-vesa.c
static int vesa_set_mode(struct mode_info *mode) { struct biosregs ireg, oreg; int is_graphic; u16 vesa_mode = mode->mode - VIDEO_FIRST_VESA; memset(&vminfo, 0, sizeof(vminfo)); initregs(&ireg); ireg.ax = 0x4f01; ireg.cx = vesa_mode; ireg.di = (size_t)&vminfo; intcall(0x10, &ireg, &oreg); if (ore...
[ 1, 0 ]
Linux Kernel
arch/x86/boot/video-vga.c
static void vga_set_8font(void) { struct biosregs ireg; initregs(&ireg); /* Set 8x8 font */ ireg.ax = 0x1112; /* ireg.bl = 0; */ intcall(0x10, &ireg, NULL); /* Use alternate print screen */ ireg.ax = 0x1200; ireg.bl = 0x20; intcall(0x10, &ireg, NULL); /* Turn off cursor emulation */ ireg.ax...
[ 1, 0 ]
Linux Kernel
arch/x86/boot/video-vga.c
static void vga_set_14font(void) { struct biosregs ireg; initregs(&ireg); /* Set 9x14 font */ ireg.ax = 0x1111; /* ireg.bl = 0; */ intcall(0x10, &ireg, NULL); /* Turn off cursor emulation */ ireg.ax = 0x1201; ireg.bl = 0x34; intcall(0x10, &ireg, NULL); /* Cursor is scan lines 11-12 */ ireg....
[ 1, 0 ]
Linux Kernel
arch/x86/boot/video-vga.c
static void vga_set_80x43(void) { struct biosregs ireg; initregs(&ireg); /* Set 350 scans */ ireg.ax = 0x1201; ireg.bl = 0x30; intcall(0x10, &ireg, NULL); /* Reset video mode */ ireg.ax = 0x0003; intcall(0x10, &ireg, NULL); vga_set_8font(); }
[ 1, 0 ]
Linux Kernel
arch/x86/boot/video-vga.c
static void vga_set_80x34(void) { vga_set_480_scanlines(); vga_set_14font(); vga_set_vertical_end(34 * 14); }
[ 0, 0 ]
Linux Kernel
arch/x86/boot/video.c
static void store_cursor_position(void) { struct biosregs ireg, oreg; initregs(&ireg); ireg.ah = 0x03; intcall(0x10, &ireg, &oreg); boot_params.screen_info.orig_x = oreg.dl; boot_params.screen_info.orig_y = oreg.dh; if (oreg.ch & 0x20) boot_params.screen_info.flags |= VIDEO_FLAGS_NOCURSOR; if (...
[ 1, 0 ]
Linux Kernel
arch/x86/boot/video.c
static void store_mode_params(void) { u16 font_size; int x, y; if (graphic_mode) return; store_cursor_position(); store_video_mode(); if (boot_params.screen_info.orig_video_mode == 0x07) { /* MDA, HGC, or VGA in monochrome mode */ video_segment = 0xb000; } else { /* CGA, EGA, VGA and so...
[ 1, 0 ]
Linux Kernel
arch/x86/boot/video.c
static unsigned int get_entry(void) { char entry_buf[4]; int i, len = 0; int key; unsigned int v; do { key = getchar(); if (key == '\b') { if (len > 0) { puts("\b \b"); len--; } } else if ((key >= '0' && key <= '9') || (key >= 'A' && key <= 'Z') || (key...
[ 1, 0 ]
Linux Kernel
arch/x86/boot/video.c
static void save_screen(void) { saved.x = boot_params.screen_info.orig_video_cols; saved.y = boot_params.screen_info.orig_video_lines; saved.curx = boot_params.screen_info.orig_x; saved.cury = boot_params.screen_info.orig_y; if (!heap_free(saved.x * saved.y * sizeof(u16) + 512)) return; /* Not enough he...
[ 0, 0 ]
Linux Kernel
arch/x86/boot/video.h
static inline u8 in_idx(u16 port, u8 index) { outb(index, port); return inb(port + 1); }
[ 0, 0 ]
Linux Kernel
arch/x86/coco/core.c
static bool intel_cc_platform_has(enum cc_attr attr) { switch (attr) { case CC_ATTR_GUEST_UNROLL_STRING_IO: case CC_ATTR_HOTPLUG_DISABLED: case CC_ATTR_GUEST_MEM_ENCRYPT: case CC_ATTR_MEM_ENCRYPT: return true; default: return false; } }
[ 0, 0 ]
Linux Kernel
arch/x86/coco/core.c
__init void cc_set_mask(u64 mask) { cc_mask = mask; }
[ 0, 0 ]
Linux Kernel
arch/x86/coco/tdx/tdx.c
static inline u64 _tdx_hypercall(u64 fn, u64 r12, u64 r13, u64 r14, u64 r15) { struct tdx_hypercall_args args = { .r10 = TDX_HYPERCALL_STANDARD, .r11 = fn, .r12 = r12, .r13 = r13, .r14 = r14, .r15 = r15, }; return __tdx_hypercall(&args, 0); }
[ 0, 0 ]
Linux Kernel
arch/x86/coco/tdx/tdx.c
static u64 hcall_func(u64 exit_reason) { return exit_reason; }
[ 0, 0 ]
Linux Kernel
arch/x86/coco/tdx/tdx.c
long tdx_kvm_hypercall(unsigned int nr, unsigned long p1, unsigned long p2, unsigned long p3, unsigned long p4) { struct tdx_hypercall_args args = { .r10 = nr, .r11 = p1, .r12 = p2, .r13 = p3, .r14 = p4, }; return __tdx_hypercall(&args, 0); }
[ 0, 0 ]
Linux Kernel
arch/x86/coco/tdx/tdx.c
static int handle_halt(struct ve_info *ve) { const bool irq_disabled = irqs_disabled(); const bool do_sti = false; if (__halt(irq_disabled, do_sti)) return -EIO; return ve_instr_len(ve); }
[ 0, 0 ]
Linux Kernel
arch/x86/coco/tdx/tdx.c
static bool mmio_read(int size, unsigned long addr, unsigned long *val) { struct tdx_hypercall_args args = { .r10 = TDX_HYPERCALL_STANDARD, .r11 = hcall_func(EXIT_REASON_EPT_VIOLATION), .r12 = size, .r13 = EPT_READ, .r14 = addr, .r15 = *val, }; if (__tdx_hypercall(&args, TDX_...
[ 0, 0 ]
Linux Kernel
arch/x86/coco/tdx/tdx.c
static bool mmio_write(int size, unsigned long addr, unsigned long val) { return !_tdx_hypercall(hcall_func(EXIT_REASON_EPT_VIOLATION), size, EPT_WRITE, addr, val); }
[ 0, 0 ]
Linux Kernel
arch/x86/coco/tdx/tdx.c
static bool handle_out(struct pt_regs *regs, int size, int port) { u64 mask = GENMASK(BITS_PER_BYTE * size, 0); return !_tdx_hypercall(hcall_func(EXIT_REASON_IO_INSTRUCTION), size, PORT_WRITE, port, regs->ax & mask); }
[ 0, 0 ]
Linux Kernel
arch/x86/coco/tdx/tdx.c
static int virt_exception_user(struct pt_regs *regs, struct ve_info *ve) { switch (ve->exit_reason) { case EXIT_REASON_CPUID: return handle_cpuid(regs, ve); default: pr_warn("Unexpected #VE: %lld\n", ve->exit_reason); return -EIO; } }
[ 0, 0 ]
Linux Kernel
arch/x86/coco/tdx/tdx.c
static bool tdx_tlb_flush_required(bool private) { return !private; }
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/aegis128-aesni-glue.c
static struct aegis_ctx *crypto_aegis128_aesni_ctx(struct crypto_aead *aead) { u8 *ctx = crypto_aead_ctx(aead); ctx = PTR_ALIGN(ctx, __alignof__(struct aegis_ctx)); return (void *)ctx; }
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/aegis128-aesni-glue.c
static int crypto_aegis128_aesni_setkey(struct crypto_aead *aead, const u8 *key, unsigned int keylen) { struct aegis_ctx *ctx = crypto_aegis128_aesni_ctx(aead); if (keylen != AEGIS128_KEY_SIZE) return -EINVAL; memcpy(ctx->key.bytes, key, AEGIS128_KEY_SIZE); return...
[ 1, 0 ]
Linux Kernel
arch/x86/crypto/aegis128-aesni-glue.c
static int crypto_aegis128_aesni_setauthsize(struct crypto_aead *tfm, unsigned int authsize) { if (authsize > AEGIS128_MAX_AUTH_SIZE) return -EINVAL; if (authsize < AEGIS128_MIN_AUTH_SIZE) return -EINVAL; return 0; }
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/aesni-intel_glue.c
static inline struct generic_gcmaes_ctx * generic_gcmaes_ctx_get(struct crypto_aead *tfm) { unsigned long align = AESNI_ALIGN; if (align <= crypto_tfm_ctx_alignment()) align = 1; return PTR_ALIGN(crypto_aead_ctx(tfm), align); } #endif
[ 1, 0 ]
Linux Kernel
arch/x86/crypto/aesni-intel_glue.c
static void aesni_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) { struct crypto_aes_ctx *ctx = aes_ctx(crypto_tfm_ctx(tfm)); if (!crypto_simd_usable()) { aes_encrypt(ctx, dst, src); } else { kernel_fpu_begin(); aesni_enc(ctx, dst, src); kernel_fpu_end(); } }
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/aesni-intel_glue.c
static void aesni_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) { struct crypto_aes_ctx *ctx = aes_ctx(crypto_tfm_ctx(tfm)); if (!crypto_simd_usable()) { aes_decrypt(ctx, dst, src); } else { kernel_fpu_begin(); aesni_dec(ctx, dst, src); kernel_fpu_end(); } }
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/aesni-intel_glue.c
static int ecb_encrypt(struct skcipher_request *req) { struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); struct crypto_aes_ctx *ctx = aes_ctx(crypto_skcipher_ctx(tfm)); struct skcipher_walk walk; unsigned int nbytes; int err; err = skcipher_walk_virt(&walk, req, false); while ((nbytes = walk.n...
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/aesni-intel_glue.c
static int cts_cbc_encrypt(struct skcipher_request *req) { struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); struct crypto_aes_ctx *ctx = aes_ctx(crypto_skcipher_ctx(tfm)); int cbc_blocks = DIV_ROUND_UP(req->cryptlen, AES_BLOCK_SIZE) - 2; struct scatterlist *src = req->src, *dst = req->dst; struct sc...
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/aesni-intel_glue.c
static void aesni_ctr_enc_avx_tfm(struct crypto_aes_ctx *ctx, u8 *out, const u8 *in, unsigned int len, u8 *iv) { if (ctx->key_length == AES_KEYSIZE_128) aes_ctr_enc_128_avx_by8(in, iv, (void *)ctx, out, len); else if (ctx->key_length == AES_KEYSIZE_192) aes_ctr_enc_192_avx...
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/aesni-intel_glue.c
static int ctr_crypt(struct skcipher_request *req) { struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); struct crypto_aes_ctx *ctx = aes_ctx(crypto_skcipher_ctx(tfm)); u8 keystream[AES_BLOCK_SIZE]; struct skcipher_walk walk; unsigned int nbytes; int err; err = skcipher_walk_virt(&walk, req, fals...
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/aesni-intel_glue.c
static int xctr_crypt(struct skcipher_request *req) { struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); struct crypto_aes_ctx *ctx = aes_ctx(crypto_skcipher_ctx(tfm)); u8 keystream[AES_BLOCK_SIZE]; struct skcipher_walk walk; unsigned int nbytes; unsigned int byte_ctr = 0; int err; __le32 block...
[ 1, 0 ]
Linux Kernel
arch/x86/crypto/aesni-intel_glue.c
static int common_rfc4106_set_authsize(struct crypto_aead *aead, unsigned int authsize) { switch (authsize) { case 8: case 12: case 16: break; default: return -EINVAL; } return 0; }
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/aesni-intel_glue.c
static int gcmaes_decrypt(struct aead_request *req, unsigned int assoclen, u8 *hash_subkey, u8 *iv, void *aes_ctx) { struct crypto_aead *tfm = crypto_aead_reqtfm(req); unsigned long auth_tag_len = crypto_aead_authsize(tfm); u8 auth_tag_msg[16]; u8 auth_tag[16]; int err; err = gcma...
[ 1, 0 ]
Linux Kernel
arch/x86/crypto/aesni-intel_glue.c
static int xts_aesni_setkey(struct crypto_skcipher *tfm, const u8 *key, unsigned int keylen) { struct aesni_xts_ctx *ctx = crypto_skcipher_ctx(tfm); int err; err = xts_verify_key(tfm, key, keylen); if (err) return err; keylen /= 2; err = aes_set_key_common(crypto_skcipher_...
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/aria_aesni_avx_glue.c
static int __init aria_avx_init(void) { const char *feature_name; if (!boot_cpu_has(X86_FEATURE_AVX) || !boot_cpu_has(X86_FEATURE_AES) || !boot_cpu_has(X86_FEATURE_OSXSAVE)) { pr_info("AVX or AES-NI instructions are not detected.\n"); return -ENODEV; } if (!cpu_has_xfeatures(XFEATURE_MASK_SSE |...
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/blake2s-glue.c
void blake2s_compress(struct blake2s_state *state, const u8 *block, size_t nblocks, const u32 inc) { BUILD_BUG_ON(SZ_4K / BLAKE2S_BLOCK_SIZE < 8); if (!static_branch_likely(&blake2s_use_ssse3) || !may_use_simd()) { blake2s_compress_generic(state, block, nblocks, inc); return; } ...
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/blowfish_glue.c
static inline void blowfish_enc_blk(struct bf_ctx *ctx, u8 *dst, const u8 *src) { __blowfish_enc_blk(ctx, dst, src, false); }
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/blowfish_glue.c
static void blowfish_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) { blowfish_dec_blk(crypto_tfm_ctx(tfm), dst, src); }
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/blowfish_glue.c
static int ecb_crypt(struct skcipher_request *req, void (*fn)(struct bf_ctx *, u8 *, const u8 *), void (*fn_4way)(struct bf_ctx *, u8 *, const u8 *)) { unsigned int bsize = BF_BLOCK_SIZE; struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); struct bf_ctx *ctx = cryp...
[ 1, 0 ]
Linux Kernel
arch/x86/crypto/blowfish_glue.c
static unsigned int __cbc_decrypt(struct bf_ctx *ctx, struct skcipher_walk *walk) { unsigned int bsize = BF_BLOCK_SIZE; unsigned int nbytes = walk->nbytes; u64 *src = (u64 *)walk->src.virt.addr; u64 *dst = (u64 *)walk->dst.virt.addr; u64 ivs[4 - 1]; u64 last_iv; src += n...
[ 1, 0 ]
Linux Kernel
arch/x86/crypto/blowfish_glue.c
static bool is_blacklisted_cpu(void) { if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL) return false; if (boot_cpu_data.x86 == 0x0f) { return true; } return false; }
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/blowfish_glue.c
static void __exit blowfish_fini(void) { crypto_unregister_alg(&bf_cipher_alg); crypto_unregister_skciphers(bf_skcipher_algs, ARRAY_SIZE(bf_skcipher_algs)); }
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/camellia_aesni_avx2_glue.c
static int camellia_setkey(struct crypto_skcipher *tfm, const u8 *key, unsigned int keylen) { return __camellia_setkey(crypto_skcipher_ctx(tfm), key, keylen); }
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/camellia_aesni_avx2_glue.c
static int cbc_encrypt(struct skcipher_request *req) { CBC_WALK_START(req, CAMELLIA_BLOCK_SIZE, -1); CBC_ENC_BLOCK(camellia_enc_blk); CBC_WALK_END(); }
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/camellia_aesni_avx2_glue.c
static int cbc_decrypt(struct skcipher_request *req) { CBC_WALK_START(req, CAMELLIA_BLOCK_SIZE, CAMELLIA_AESNI_PARALLEL_BLOCKS); CBC_DEC_BLOCK(CAMELLIA_AESNI_AVX2_PARALLEL_BLOCKS, camellia_cbc_dec_32way); CBC_DEC_BLOCK(CAMELLIA_AESNI_PARALLEL_BLOCKS, camellia_cbc_dec_16way); CBC_DEC_BLOCK(2, camellia_decrypt_c...
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/camellia_aesni_avx2_glue.c
static int __init camellia_aesni_init(void) { const char *feature_name; if (!boot_cpu_has(X86_FEATURE_AVX) || !boot_cpu_has(X86_FEATURE_AVX2) || !boot_cpu_has(X86_FEATURE_AES) || !boot_cpu_has(X86_FEATURE_OSXSAVE)) { pr_info("AVX2 or AES-NI instructions are not detected.\n"); return -ENODEV; } ...
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/camellia_aesni_avx_glue.c
static int ecb_encrypt(struct skcipher_request *req) { ECB_WALK_START(req, CAMELLIA_BLOCK_SIZE, CAMELLIA_AESNI_PARALLEL_BLOCKS); ECB_BLOCK(CAMELLIA_AESNI_PARALLEL_BLOCKS, camellia_ecb_enc_16way); ECB_BLOCK(2, camellia_enc_blk_2way); ECB_BLOCK(1, camellia_enc_blk); ECB_WALK_END(); }
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/camellia_glue.c
int __camellia_setkey(struct camellia_ctx *cctx, const unsigned char *key, unsigned int key_len) { if (key_len != 16 && key_len != 24 && key_len != 32) return -EINVAL; cctx->key_length = key_len; switch (key_len) { case 16: camellia_setup128(key, cctx->key_table); break; c...
[ 1, 0 ]
Linux Kernel
arch/x86/crypto/camellia_glue.c
void camellia_decrypt_cbc_2way(const void *ctx, u8 *dst, const u8 *src) { u8 buf[CAMELLIA_BLOCK_SIZE]; const u8 *iv = src; if (dst == src) iv = memcpy(buf, iv, sizeof(buf)); camellia_dec_blk_2way(ctx, dst, src); crypto_xor(dst + CAMELLIA_BLOCK_SIZE, iv, CAMELLIA_BLOCK_SIZE); }
[ 1, 0 ]
Linux Kernel
arch/x86/crypto/camellia_glue.c
static int ecb_encrypt(struct skcipher_request *req) { ECB_WALK_START(req, CAMELLIA_BLOCK_SIZE, -1); ECB_BLOCK(2, camellia_enc_blk_2way); ECB_BLOCK(1, camellia_enc_blk); ECB_WALK_END(); }
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/camellia_glue.c
static int ecb_decrypt(struct skcipher_request *req) { ECB_WALK_START(req, CAMELLIA_BLOCK_SIZE, -1); ECB_BLOCK(2, camellia_dec_blk_2way); ECB_BLOCK(1, camellia_dec_blk); ECB_WALK_END(); }
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/camellia_glue.c
static void __exit camellia_fini(void) { crypto_unregister_alg(&camellia_cipher_alg); crypto_unregister_skciphers(camellia_skcipher_algs, ARRAY_SIZE(camellia_skcipher_algs)); }
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/cast5_avx_glue.c
static int cast5_setkey_skcipher(struct crypto_skcipher *tfm, const u8 *key, unsigned int keylen) { return cast5_setkey(&tfm->base, key, keylen); }
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/cast5_avx_glue.c
static int cbc_encrypt(struct skcipher_request *req) { CBC_WALK_START(req, CAST5_BLOCK_SIZE, -1); CBC_ENC_BLOCK(__cast5_encrypt); CBC_WALK_END(); }
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/cast5_avx_glue.c
static int cbc_decrypt(struct skcipher_request *req) { CBC_WALK_START(req, CAST5_BLOCK_SIZE, CAST5_PARALLEL_BLOCKS); CBC_DEC_BLOCK(CAST5_PARALLEL_BLOCKS, cast5_cbc_dec_16way); CBC_DEC_BLOCK(1, __cast5_decrypt); CBC_WALK_END(); }
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/chacha_glue.c
void chacha_crypt_arch(u32 *state, u8 *dst, const u8 *src, unsigned int bytes, int nrounds) { if (!static_branch_likely(&chacha_use_simd) || !crypto_simd_usable() || bytes <= CHACHA_BLOCK_SIZE) return chacha_crypt_generic(state, dst, src, bytes, nrounds); do { unsigned int tod...
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/chacha_glue.c
static int __init chacha_simd_mod_init(void) { if (!boot_cpu_has(X86_FEATURE_SSSE3)) return 0; static_branch_enable(&chacha_use_simd); if (boot_cpu_has(X86_FEATURE_AVX) && boot_cpu_has(X86_FEATURE_AVX2) && cpu_has_xfeatures(XFEATURE_MASK_SSE | XFEATURE_MASK_YMM, NULL)) { static_branch_enable(&chac...
[ 1, 0 ]
Linux Kernel
arch/x86/crypto/chacha_glue.c
static void __exit chacha_simd_mod_fini(void) { if (IS_REACHABLE(CONFIG_CRYPTO_SKCIPHER) && boot_cpu_has(X86_FEATURE_SSSE3)) crypto_unregister_skciphers(algs, ARRAY_SIZE(algs)); }
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/crc32-pclmul_glue.c
static int crc32_pclmul_digest(struct shash_desc *desc, const u8 *data, unsigned int len, u8 *out) { return __crc32_pclmul_finup(crypto_shash_ctx(desc->tfm), data, len, out); }
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/crc32c-intel_glue.c
static int crc32c_intel_update(struct shash_desc *desc, const u8 *data, unsigned int len) { u32 *crcp = shash_desc_ctx(desc); *crcp = crc32c_intel_le_hw(*crcp, data, len); return 0; }
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/crc32c-intel_glue.c
static int crc32c_intel_final(struct shash_desc *desc, u8 *out) { u32 *crcp = shash_desc_ctx(desc); *(__le32 *)out = ~cpu_to_le32p(crcp); return 0; }
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/crc32c-intel_glue.c
static int __crc32c_pcl_intel_finup(u32 *crcp, const u8 *data, unsigned int len, u8 *out) { if (len >= CRC32C_PCL_BREAKEVEN && crypto_simd_usable()) { kernel_fpu_begin(); *(__le32 *)out = ~cpu_to_le32(crc_pcl(data, len, *crcp)); kernel_fpu_end(); } else *(__le32 ...
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/crc32c-intel_glue.c
static int crc32c_pcl_intel_digest(struct shash_desc *desc, const u8 *data, unsigned int len, u8 *out) { return __crc32c_pcl_intel_finup(crypto_shash_ctx(desc->tfm), data, len, out); } #endif
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/crc32c-intel_glue.c
static int __init crc32c_intel_mod_init(void) { if (!x86_match_cpu(crc32c_cpu_id)) return -ENODEV; #ifdef CONFIG_X86_64 if (boot_cpu_has(X86_FEATURE_PCLMULQDQ)) { alg.update = crc32c_pcl_intel_update; alg.finup = crc32c_pcl_intel_finup; alg.digest = crc32c_pcl_intel_digest; } #endif return cryp...
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/crct10dif-pclmul_glue.c
static int __chksum_finup(__u16 crc, const u8 *data, unsigned int len, u8 *out) { if (len >= 16 && crypto_simd_usable()) { kernel_fpu_begin(); *(__u16 *)out = crc_t10dif_pcl(crc, data, len); kernel_fpu_end(); } else *(__u16 *)out = crc_t10dif_generic(crc, data, len); ret...
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/crct10dif-pclmul_glue.c
static void __exit crct10dif_intel_mod_fini(void) { crypto_unregister_shash(&alg); }
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/curve25519-x86_64.c
static __always_inline u64 gte_mask(u64 a, u64 b) { u64 x = a; u64 y = b; u64 x_xor_y = x ^ y; u64 x_sub_y = x - y; u64 x_sub_y_xor_y = x_sub_y ^ y; u64 q = x_xor_y | x_sub_y_xor_y; u64 x_xor_q = x ^ q; u64 x_xor_q_ = x_xor_q >> (u32)63U; return x_xor_q_ - (u64)1U; }
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/curve25519-x86_64.c
void curve25519_arch(u8 mypublic[CURVE25519_KEY_SIZE], const u8 secret[CURVE25519_KEY_SIZE], const u8 basepoint[CURVE25519_KEY_SIZE]) { if (static_branch_likely(&curve25519_use_bmi2_adx)) curve25519_ever64(mypublic, secret, basepoint); else curve25519_generic(mypub...
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/curve25519-x86_64.c
void curve25519_base_arch(u8 pub[CURVE25519_KEY_SIZE], const u8 secret[CURVE25519_KEY_SIZE]) { if (static_branch_likely(&curve25519_use_bmi2_adx)) curve25519_ever64_base(pub, secret); else curve25519_generic(pub, secret, curve25519_base_point); }
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/curve25519-x86_64.c
static int curve25519_set_secret(struct crypto_kpp *tfm, const void *buf, unsigned int len) { u8 *secret = kpp_tfm_ctx(tfm); if (!len) curve25519_generate_secret(secret); else if (len == CURVE25519_KEY_SIZE && crypto_memneq(buf, curve25519_null_point, CURVE25519_K...
[ 1, 0 ]
Linux Kernel
arch/x86/crypto/curve25519-x86_64.c
static int curve25519_compute_shared_secret(struct kpp_request *req) { struct crypto_kpp *tfm = crypto_kpp_reqtfm(req); const u8 *secret = kpp_tfm_ctx(tfm); u8 public_key[CURVE25519_KEY_SIZE]; u8 buf[CURVE25519_KEY_SIZE]; int copied, nbytes; if (!req->src) return -EINVAL; copied = sg_copy_to_buffer(...
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/curve25519-x86_64.c
static void __exit curve25519_mod_exit(void) { if (IS_REACHABLE(CONFIG_CRYPTO_KPP) && static_branch_likely(&curve25519_use_bmi2_adx)) crypto_unregister_kpp(&curve25519_alg); }
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/des3_ede_glue.c
static int ecb_crypt(struct skcipher_request *req, const u32 *expkey) { const unsigned int bsize = DES3_EDE_BLOCK_SIZE; struct skcipher_walk walk; unsigned int nbytes; int err; err = skcipher_walk_virt(&walk, req, false); while ((nbytes = walk.nbytes)) { u8 *wsrc = walk.src.virt.addr; u8 *wdst = w...
[ 1, 0 ]
Linux Kernel
arch/x86/crypto/des3_ede_glue.c
static int ecb_encrypt(struct skcipher_request *req) { struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); struct des3_ede_x86_ctx *ctx = crypto_skcipher_ctx(tfm); return ecb_crypt(req, ctx->enc.expkey); }
[ 0, 0 ]
Linux Kernel
arch/x86/crypto/des3_ede_glue.c
static unsigned int __cbc_decrypt(struct des3_ede_x86_ctx *ctx, struct skcipher_walk *walk) { unsigned int bsize = DES3_EDE_BLOCK_SIZE; unsigned int nbytes = walk->nbytes; u64 *src = (u64 *)walk->src.virt.addr; u64 *dst = (u64 *)walk->dst.virt.addr; u64 ivs[3 - 1]; u64 last...
[ 1, 0 ]
Linux Kernel
arch/x86/crypto/des3_ede_glue.c
static int des3_ede_x86_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) { struct des3_ede_x86_ctx *ctx = crypto_tfm_ctx(tfm); u32 i, j, tmp; int err; err = des3_ede_expand_key(&ctx->enc, key, keylen); if (err == -ENOKEY) { if (crypto_tfm_get_flags(tfm) & ...
[ 1, 0 ]
Linux Kernel
arch/x86/crypto/ghash-clmulni-intel_glue.c
static int ghash_init(struct shash_desc *desc) { struct ghash_desc_ctx *dctx = shash_desc_ctx(desc); memset(dctx, 0, sizeof(*dctx)); return 0; }
[ 1, 0 ]
Linux Kernel
arch/x86/crypto/ghash-clmulni-intel_glue.c
static int ghash_update(struct shash_desc *desc, const u8 *src, unsigned int srclen) { struct ghash_desc_ctx *dctx = shash_desc_ctx(desc); struct ghash_ctx *ctx = crypto_shash_ctx(desc->tfm); u8 *dst = dctx->buffer; kernel_fpu_begin(); if (dctx->bytes) { int n = min(srclen, dctx-...
[ 1, 0 ]
Linux Kernel
arch/x86/crypto/ghash-clmulni-intel_glue.c
static int ghash_async_update(struct ahash_request *req) { struct ahash_request *cryptd_req = ahash_request_ctx(req); struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); struct ghash_async_ctx *ctx = crypto_ahash_ctx(tfm); struct cryptd_ahash *cryptd_tfm = ctx->cryptd_tfm; if (!crypto_simd_usable() || ...
[ 1, 0 ]
Linux Kernel
arch/x86/crypto/ghash-clmulni-intel_glue.c
static int ghash_async_final(struct ahash_request *req) { struct ahash_request *cryptd_req = ahash_request_ctx(req); struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); struct ghash_async_ctx *ctx = crypto_ahash_ctx(tfm); struct cryptd_ahash *cryptd_tfm = ctx->cryptd_tfm; if (!crypto_simd_usable() || ...
[ 1, 0 ]
Linux Kernel
arch/x86/crypto/ghash-clmulni-intel_glue.c
static int ghash_async_import(struct ahash_request *req, const void *in) { struct ahash_request *cryptd_req = ahash_request_ctx(req); struct shash_desc *desc = cryptd_shash_desc(cryptd_req); struct ghash_desc_ctx *dctx = shash_desc_ctx(desc); ghash_async_init(req); memcpy(dctx, in, sizeof(*dctx)); return ...
[ 1, 0 ]
Linux Kernel
arch/x86/crypto/ghash-clmulni-intel_glue.c
static int ghash_async_export(struct ahash_request *req, void *out) { struct ahash_request *cryptd_req = ahash_request_ctx(req); struct shash_desc *desc = cryptd_shash_desc(cryptd_req); struct ghash_desc_ctx *dctx = shash_desc_ctx(desc); memcpy(out, dctx, sizeof(*dctx)); return 0; }
[ 1, 0 ]
Linux Kernel
arch/x86/crypto/ghash-clmulni-intel_glue.c
static int ghash_async_setkey(struct crypto_ahash *tfm, const u8 *key, unsigned int keylen) { struct ghash_async_ctx *ctx = crypto_ahash_ctx(tfm); struct crypto_ahash *child = &ctx->cryptd_tfm->base; crypto_ahash_clear_flags(child, CRYPTO_TFM_REQ_MASK); crypto_ahash_set_flags(chi...
[ 0, 0 ]