mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-08-07 21:53:41 +08:00
quantum init
This commit is contained in:
@@ -1,16 +1,6 @@
|
||||
#! /usr/bin/env perl
|
||||
# Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (the "License"). You may not use
|
||||
# this file except in compliance with the License. You can obtain a copy
|
||||
# in the file LICENSE in the source distribution or at
|
||||
# https://www.openssl.org/source/license.html
|
||||
#!/usr/local/bin/perl
|
||||
|
||||
|
||||
# This flag makes the inner loop one cycle longer, but generates
|
||||
# code that runs %30 faster on the pentium pro/II, 44% faster
|
||||
# of PIII, while only %7 slower on the pentium.
|
||||
# By default, this flag is on.
|
||||
# define for pentium pro friendly version
|
||||
$ppro=1;
|
||||
|
||||
$0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
|
||||
@@ -18,9 +8,6 @@ push(@INC,"${dir}","${dir}../../perlasm");
|
||||
require "x86asm.pl";
|
||||
require "cbc.pl";
|
||||
|
||||
$output=pop;
|
||||
open STDOUT,">$output";
|
||||
|
||||
&asm_init($ARGV[0],"cast-586.pl",$ARGV[$#ARGV] eq "386");
|
||||
|
||||
$CAST_ROUNDS=16;
|
||||
@@ -46,8 +33,6 @@ $S4="CAST_S_table3";
|
||||
|
||||
&asm_finish();
|
||||
|
||||
close STDOUT;
|
||||
|
||||
sub CAST_encrypt {
|
||||
local($name,$enc)=@_;
|
||||
|
||||
@@ -155,11 +140,11 @@ sub E_CAST {
|
||||
&rotl( $tmp4, &LB($tmp1));
|
||||
|
||||
if ($ppro) {
|
||||
&mov( $tmp2, $tmp4); # B
|
||||
&xor( $tmp1, $tmp1);
|
||||
&mov( $tmp2, 0xff);
|
||||
|
||||
&movb( &LB($tmp1), &HB($tmp4)); # A
|
||||
&and( $tmp2, $tmp4);
|
||||
&and( $tmp2, 0xff);
|
||||
|
||||
&shr( $tmp4, 16); #
|
||||
&xor( $tmp3, $tmp3);
|
||||
|
||||
7
crypto/cast/asm/readme
Normal file
7
crypto/cast/asm/readme
Normal file
@@ -0,0 +1,7 @@
|
||||
There is a ppro flag in cast-586 which turns on/off
|
||||
generation of pentium pro/II friendly code
|
||||
|
||||
This flag makes the inner loop one cycle longer, but generates
|
||||
code that runs %30 faster on the pentium pro/II, while only %7 slower
|
||||
on the pentium. By default, this flag is on.
|
||||
|
||||
Reference in New Issue
Block a user