Skip to content
Snippets Groups Projects
Select Git revision
  • 70e256905b51ccb6c9d72c1e1b83bafddcd477d3
  • master default protected
  • siv-mode
  • delete-des-compat
  • delete-rsa_blind
  • aes-struct-layout
  • master-updates
  • release-3.4-fixes
  • struct-layout
  • attribute-deprecated
  • rename-data-symbols
  • x86_64-sha_ni-sha256
  • ecc-params-tweak
  • delete-old-aes
  • cmac-support
  • x86_64-sha_ni-sha1
  • gcm-ctr-opt
  • ctr-opt
  • skein
  • api-opaque-fix
  • curve448
  • nettle_3.4.1_release_20181204
  • nettle_3.4.1rc1
  • nettle_3.4_release_20171119
  • nettle_3.4rc2
  • nettle_3.4rc1
  • nettle_3.3_release_20161001
  • nettle_3.2_release_20160128
  • nettle_3.1.1_release_20150424
  • nettle_3.1_release_20150407
  • nettle_3.1rc3
  • nettle_3.1rc2
  • nettle_3.1rc1
  • nettle_3.0_release_20140607
  • nettle_2.7.1_release_20130528
  • nettle_2.7_release_20130424
  • nettle_2.6_release_20130116
  • nettle_2.5_release_20120707
  • converted-master-branch-to-git
  • nettle_2.4_release_20110903
  • nettle_2.3_release_20110902
41 results

aes-encrypt-table.c

  • Forked from Nettle / nettle
    Source project has a limited visibility.
    • Niels Möller's avatar
      bc527459
      * aes-internal.h (struct aes_table): sparc_idx[0] should now · bc527459
      Niels Möller authored
      contain index values shifted by the size of a word, and with 2
      added. This saves some additions in the sparc assembler code.
      Updates aes-encrypt-table.c and aes-decrypt-table.c.
      
      * aes-internal.h (struct aes_table): Renamed the shift_idx field
      to sparc_idx, as it will be tweaked to improve the sparc code.
      Also reduced its size to [2][4].
      (IDX_FACTOR): Deleted constant.
      * aes-encrypt-table.c (_aes_encrypt_table): Adapted initializer of
      sparc_idx.
      * aes-decrypt-table.c (_aes_decrypt_table): Likewise.
      * asm.m4: Deleted AES_SIDX2, to match struct aes_table.
      
      Rev: src/nettle/aes-decrypt-table.c:1.3
      Rev: src/nettle/aes-encrypt-table.c:1.3
      Rev: src/nettle/aes-internal.h:1.8
      bc527459
      History
      * aes-internal.h (struct aes_table): sparc_idx[0] should now
      Niels Möller authored
      contain index values shifted by the size of a word, and with 2
      added. This saves some additions in the sparc assembler code.
      Updates aes-encrypt-table.c and aes-decrypt-table.c.
      
      * aes-internal.h (struct aes_table): Renamed the shift_idx field
      to sparc_idx, as it will be tweaked to improve the sparc code.
      Also reduced its size to [2][4].
      (IDX_FACTOR): Deleted constant.
      * aes-encrypt-table.c (_aes_encrypt_table): Adapted initializer of
      sparc_idx.
      * aes-decrypt-table.c (_aes_decrypt_table): Likewise.
      * asm.m4: Deleted AES_SIDX2, to match struct aes_table.
      
      Rev: src/nettle/aes-decrypt-table.c:1.3
      Rev: src/nettle/aes-encrypt-table.c:1.3
      Rev: src/nettle/aes-internal.h:1.8
    desCode.h 10.96 KiB
    /* desCode.h
     *
     * $Id$ */
    
    /*	des - fast & portable DES encryption & decryption.
     *	Copyright (C) 1992  Dana L. How
     *	Please see the file `descore.README' for the complete copyright notice.
     */
    
    #include "des.h"
    
    extern const uint32_t des_keymap[];
    extern const uint32_t des_bigmap[];
    
    /* optional customization:
     * the idea here is to alter the code so it will still run correctly
     * on any machine,  but the quickest on the specific machine in mind.
     * note that these silly tweaks can give you a 15%-20% speed improvement
     * on the sparc -- it's probably even more significant on the 68000. */
    
    /* take care of machines with incredibly few registers */
    #if	defined(i386)
    #define	REGISTER		/* only x, y, z will be declared register */
    #else
    #define	REGISTER	register
    #endif	/* i386 */
    
    /* is auto inc/dec faster than 7bit unsigned indexing? */
    #if	defined(vax) || defined(mc68000)
    #define	FIXR		r += 32;
    #define	FIXS		s +=  8;
    #define	PREV(v,o)	*--v
    #define	NEXT(v,o)	*v++
    #else
    #define	FIXR
    #define	FIXS
    #define	PREV(v,o)	v[o]
    #define	NEXT(v,o)	v[o]
    #endif
    
    /* if no machine type, default is indexing, 6 registers and cheap literals */
    #if	!defined(i386) && !defined(vax) && !defined(mc68000) && !defined(sparc)
    #define	vax
    #endif
    
    
    /* handle a compiler which can't reallocate registers */
    /* The BYTE type is used as parameter for the encrypt/decrypt functions.
     * It's pretty bad to have the function prototypes depend on
     * a macro definition that the users of the function doesn't
     * know about. /Niels */
    #if	0			/* didn't feel like deleting */
    #define	SREGFREE	; s = (uint8_t *) D
    #define	DEST		s
    #define	D		m0
    #define	BYTE		uint32_t
    #else
    #define	SREGFREE
    #define	DEST		d
    #define	D		d
    #define	BYTE		uint8_t
    #endif
    
    /* handle constants in the optimal way for 386 & vax */
    /* 386: we declare 3 register variables (see above) and use 3 more variables;
     * vax: we use 6 variables, all declared register;
     * we assume address literals are cheap & unrestricted;
     * we assume immediate constants are cheap & unrestricted. */
    #if	defined(i386) || defined(vax)
    #define	MQ0	 des_bigmap