Print this page
6189743 Need an ARCFOUR implementation optimized for AMD64

*** 1,12 **** /* * CDDL HEADER START * * The contents of this file are subject to the terms of the ! * Common Development and Distribution License, Version 1.0 only ! * (the "License"). You may not use this file except in compliance ! * with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. --- 1,11 ---- /* * CDDL HEADER START * * The contents of this file are subject to the terms of the ! * Common Development and Distribution License (the "License"). ! * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License.
*** 18,35 **** * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* ! * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ ! #pragma ident "@(#)arcfour_crypt.c 1.5 05/08/23 SMI" #include "arcfour.h" /* Initialize the key stream 'key' using the key value */ void arcfour_key_init(ARCFour_key *key, uchar_t *keyval, int keyvallen) { /* EXPORT DELETE START */ --- 17,42 ---- * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* ! * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ ! #pragma ident "@(#)arcfour_crypt.c 1.6 08/01/02 SMI" #include "arcfour.h" + #if defined(__amd64) + /* + * Use hand-tuned, processor-specific assembly version of arcfour_crypt() + * for 64-bit x86: + */ + #define USE_PSR_VERSION_OF_ARCFOUR_CRYPT + #endif /* __amd64 */ + /* Initialize the key stream 'key' using the key value */ void arcfour_key_init(ARCFour_key *key, uchar_t *keyval, int keyvallen) { /* EXPORT DELETE START */
*** 59,70 **** /* EXPORT DELETE END */ } /* ! * Encipher 'in' using 'key. * in and out can point to the same location */ void arcfour_crypt(ARCFour_key *key, uchar_t *in, uchar_t *out, size_t len) { --- 66,78 ---- /* EXPORT DELETE END */ } + #if !defined(USE_PSR_VERSION_OF_ARCFOUR_CRYPT) /* ! * Encipher 'in' using 'key'. * in and out can point to the same location */ void arcfour_crypt(ARCFour_key *key, uchar_t *in, uchar_t *out, size_t len) {
*** 128,132 **** --- 136,141 ---- } #endif /* sun4u */ /* EXPORT DELETE END */ } + #endif /* !USE_PSR_VERSION_OF_ARCFOUR_CRYPT */