"Fossies" - the Fresh Open Source Software Archive

Member "john-1.9.0/src/common.h" (1 Apr 2017, 1691 Bytes) of package /linux/privat/john-1.9.0.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "common.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 1.8.0_vs_1.9.0.

    1 /*
    2  * This file is part of John the Ripper password cracker,
    3  * Copyright (c) 1996-99,2005,2009,2011,2013,2015 by Solar Designer
    4  *
    5  * Redistribution and use in source and binary forms, with or without
    6  * modification, are permitted.
    7  *
    8  * There's ABSOLUTELY NO WARRANTY, express or implied.
    9  */
   10 
   11 /*
   12  * Things common to many ciphertext formats.
   13  */
   14 
   15 #ifndef _JOHN_COMMON_H
   16 #define _JOHN_COMMON_H
   17 
   18 #include "arch.h"
   19 #include "memory.h"
   20 
   21 #ifdef __GNUC__
   22 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
   23 #define MAYBE_INLINE __attribute__((always_inline)) __inline__
   24 #else
   25 #define MAYBE_INLINE __inline__
   26 #endif
   27 #elif __STDC_VERSION__ >= 199901L
   28 #define MAYBE_INLINE inline
   29 #else
   30 #define MAYBE_INLINE
   31 #endif
   32 
   33 #if ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 2)
   34 #define CC_CACHE_ALIGN \
   35     __attribute__ ((aligned (MEM_ALIGN_CACHE)))
   36 #else
   37 #define CC_CACHE_ALIGN          /* nothing */
   38 #endif
   39 
   40 /*
   41  * This "shift" is the number of bytes that may be inserted between arrays the
   42  * size of which would be a multiple of cache line size (some power of two) and
   43  * that might be accessed simultaneously.  The purpose of the shift is to avoid
   44  * cache bank conflicts with such accesses, actually allowing them to proceed
   45  * simultaneously.  This number should be a multiple of the machine's word size
   46  * but smaller than cache line size.
   47  */
   48 #define CACHE_BANK_SHIFT        ARCH_SIZE
   49 
   50 /*
   51  * ASCII <-> binary conversion tables.
   52  */
   53 extern const char itoa64[64]; /* crypt(3) base64 - not MIME Base64! */
   54 extern unsigned char atoi64[0x100];
   55 extern const char itoa16[16];
   56 extern unsigned char atoi16[0x100], atoi16l[0x100];
   57 
   58 /*
   59  * Initializes the tables.
   60  */
   61 extern void common_init(void);
   62 
   63 #endif