The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/contrib/openzfs/module/icp/algs/aes/aes_impl_x86-64.c

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*
    2  * CDDL HEADER START
    3  *
    4  * The contents of this file are subject to the terms of the
    5  * Common Development and Distribution License (the "License").
    6  * You may not use this file except in compliance with the License.
    7  *
    8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
    9  * or https://opensource.org/licenses/CDDL-1.0.
   10  * See the License for the specific language governing permissions
   11  * and limitations under the License.
   12  *
   13  * When distributing Covered Code, include this CDDL HEADER in each
   14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
   15  * If applicable, add the following below this CDDL HEADER, with the
   16  * fields enclosed by brackets "[]" replaced with your own identifying
   17  * information: Portions Copyright [yyyy] [name of copyright owner]
   18  *
   19  * CDDL HEADER END
   20  */
   21 /*
   22  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
   23  */
   24 
   25 #if defined(__x86_64)
   26 
   27 #include <sys/simd.h>
   28 #include <aes/aes_impl.h>
   29 
   30 /*
   31  * Expand the 32-bit AES cipher key array into the encryption and decryption
   32  * key schedules.
   33  *
   34  * Parameters:
   35  * key          AES key schedule to be initialized
   36  * keyarr32     User key
   37  * keyBits      AES key size (128, 192, or 256 bits)
   38  */
   39 static void
   40 aes_x86_64_generate(aes_key_t *key, const uint32_t *keyarr32, int keybits)
   41 {
   42         key->nr = rijndael_key_setup_enc_amd64(&(key->encr_ks.ks32[0]),
   43             keyarr32, keybits);
   44         key->nr = rijndael_key_setup_dec_amd64(&(key->decr_ks.ks32[0]),
   45             keyarr32, keybits);
   46 }
   47 
   48 static boolean_t
   49 aes_x86_64_will_work(void)
   50 {
   51         return (B_TRUE);
   52 }
   53 
   54 const aes_impl_ops_t aes_x86_64_impl = {
   55         .generate = &aes_x86_64_generate,
   56         .encrypt = &aes_encrypt_amd64,
   57         .decrypt = &aes_decrypt_amd64,
   58         .is_supported = &aes_x86_64_will_work,
   59         .needs_byteswap = B_FALSE,
   60         .name = "x86_64"
   61 };
   62 
   63 #endif /* defined(__x86_64) */

Cache object: f16d73d6ca1e89f58cd38f676a3b21d6


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.