security/nss/lib/freebl/des.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /*
     2  *  des.h
     3  *
     4  *  header file for DES-150 library
     5  *
     6  * This Source Code Form is subject to the terms of the Mozilla Public
     7  * License, v. 2.0. If a copy of the MPL was not distributed with this
     8  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
    10 #ifndef _DES_H_
    11 #define _DES_H_ 1
    13 #include "blapi.h"
    15 typedef unsigned char BYTE;
    16 typedef unsigned int  HALF;
    18 #define HALFPTR(x) ((HALF *)(x))
    19 #define SHORTPTR(x) ((unsigned short *)(x))
    20 #define BYTEPTR(x) ((BYTE *)(x))
    22 typedef enum {
    23     DES_ENCRYPT = 0x5555,
    24     DES_DECRYPT = 0xAAAA
    25 } DESDirection;
    27 typedef void DESFunc(struct DESContextStr *cx, BYTE *out, const BYTE *in, 
    28                      unsigned int len);
    30 struct DESContextStr {
    31     /* key schedule, 16 internal keys, each with 8 6-bit parts */
    32     HALF ks0 [32];
    33     HALF ks1 [32];
    34     HALF ks2 [32];
    35     HALF iv  [2];
    36     DESDirection direction;
    37     DESFunc  *worker;
    38 };
    40 void DES_MakeSchedule( HALF * ks, const BYTE * key,   DESDirection direction);
    41 void DES_Do1Block(     HALF * ks, const BYTE * inbuf, BYTE * outbuf);
    43 #endif

mercurial