Skip to content
Snippets Groups Projects
Select Git revision
  • c7b493d4060d332abb02b5ffdb6d81099b08d449
  • master default protected
  • 9.0
  • 8.0
  • 7.8
  • 7.6
  • 7.4
  • 7.2
  • 7.0
  • 0.6
  • rosuav/latex-markdown-renderer
  • rxnpatch/rxnpatch
  • marcus/gobject-introspection
  • rxnpatch/8.0
  • rosuav/pre-listening-ports
  • nt-tools
  • rosuav/async-annotations
  • rosuav/pgsql-ssl
  • rxnpatch/rxnpatch-broken/2023-10-06T094250
  • grubba/fdlib
  • grubba/wip/sakura/8.0
  • v8.0.2000
  • v8.0.1998
  • v8.0.1996
  • v8.0.1994
  • v8.0.1992
  • v8.0.1990
  • v8.0.1988
  • v8.0.1986
  • rxnpatch/clusters/8.0/2025-04-29T124414
  • rxnpatch/2025-04-29T124414
  • v8.0.1984
  • v8.0.1982
  • v8.0.1980
  • v8.0.1978
  • v8.0.1976
  • v8.0.1974
  • v8.0.1972
  • v8.0.1970
  • v8.0.1968
  • v8.0.1966
41 results

sybase.pike

Blame
  • desQuick.c 1.03 KiB
    /*
     *	des - fast & portable DES encryption & decryption.
     *	Copyright (C) 1992  Dana L. How
     *	Please see the file `descore.README' for the complete copyright notice.
     *
     * Slightly edited by Niels Mller, 1997
     */
    
    #include "des.h"
    
    #include "RCSID.h"
    RCSID2(desQuick_cRcs, "$Id$");
    
    extern UINT32 des_keymap[];
    
    
    /* static information */
    
    static int depth = 0;		/* keep track of the request depth */
    UINT32 des_bigmap[0x4000];	/* big lookup table */
    
    /* fill in the 64k table used by the `quick' option */
    
    void
    DesQuickInit(void)
    {
    	int s1, s3, x;
    	UINT32 * t0, * t1, * t2, * t3;
    
    	if ( depth++ )
    		return;
    
    	t0 = des_bigmap;
    	t1 = t0 + 64;
    	t2 = t1 + 64;
    	t3 = t2 + 64;
    
    	for ( s3 = 63; s3 >= 0; s3-- ) {
    		for ( s1 = 63; s1 >= 0; s1-- ) {
    			x = (s3 << 8) | s1;
    			t0[x] = des_keymap[s3+128] ^ des_keymap[s1+192];
    			t1[x] = des_keymap[s3    ] ^ des_keymap[s1+ 64];
    			t2[x] = des_keymap[s3+384] ^ des_keymap[s1+448];
    			t3[x] = des_keymap[s3+256] ^ des_keymap[s1+320];
    		}
    	}
    }
    
    /* free the 64k table, if necessary */
    
    void
    DesQuickDone(void)
    {
    }