39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59 #include "des_locl.h"
60 #include "spr.h"
61
62 void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc)
63 {
64 register DES_LONG l,r,t,u;
65 #ifdef DES_PTR
66 register const unsigned char *des_SP=(const unsigned char *)DES_SPtrans;
67 #endif
68 #ifndef DES_UNROLL
69 register int i;
70 #endif
71 register DES_LONG *s;
72
73 r=data[0];
74 l=data[1];
75
76 IP(r,l);
77 /* Things have been modified so that the initial rotate is
78 * done outside the loop. This required the
79 * DES_SPtrans values in sp.h to be rotated 1 bit to the right.
80 * One perl script later and things have a 5% speed up on a sparc2.
|
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59 #include <des_locl.h>
60 #include <spr.h>
61
62 void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc)
63 {
64 register DES_LONG l,r,t,u;
65 #ifdef DES_PTR
66 register const unsigned char *des_SP=(const unsigned char *)DES_SPtrans;
67 #endif
68 #ifndef DES_UNROLL
69 register int i;
70 #endif
71 register DES_LONG *s;
72
73 r=data[0];
74 l=data[1];
75
76 IP(r,l);
77 /* Things have been modified so that the initial rotate is
78 * done outside the loop. This required the
79 * DES_SPtrans values in sp.h to be rotated 1 bit to the right.
80 * One perl script later and things have a 5% speed up on a sparc2.
|