~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/security/nss/lib/freebl/arcfive.c

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * arcfive.c - stubs for RC5 - NOT a working implementation!
 
3
 *
 
4
 * The contents of this file are subject to the Mozilla Public
 
5
 * License Version 1.1 (the "License"); you may not use this file
 
6
 * except in compliance with the License. You may obtain a copy of
 
7
 * the License at http://www.mozilla.org/MPL/
 
8
 * 
 
9
 * Software distributed under the License is distributed on an "AS
 
10
 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
 
11
 * implied. See the License for the specific language governing
 
12
 * rights and limitations under the License.
 
13
 * 
 
14
 * The Original Code is the Netscape security libraries.
 
15
 * 
 
16
 * The Initial Developer of the Original Code is Netscape
 
17
 * Communications Corporation.  Portions created by Netscape are 
 
18
 * Copyright (C) 2000 Netscape Communications Corporation.  All
 
19
 * Rights Reserved.
 
20
 * 
 
21
 * Contributor(s):
 
22
 * 
 
23
 * Alternatively, the contents of this file may be used under the
 
24
 * terms of the GNU General Public License Version 2 or later (the
 
25
 * "GPL"), in which case the provisions of the GPL are applicable 
 
26
 * instead of those above.  If you wish to allow use of your 
 
27
 * version of this file only under the terms of the GPL and not to
 
28
 * allow others to use your version of this file under the MPL,
 
29
 * indicate your decision by deleting the provisions above and
 
30
 * replace them with the notice and other provisions required by
 
31
 * the GPL.  If you do not delete the provisions above, a recipient
 
32
 * may use your version of this file under either the MPL or the
 
33
 * GPL.
 
34
 *
 
35
 * $Id: arcfive.c,v 1.3 2002/11/16 06:09:57 nelsonb%netscape.com Exp $
 
36
 */
 
37
 
 
38
#include "blapi.h"
 
39
#include "prerror.h"
 
40
 
 
41
/******************************************/
 
42
/*
 
43
** RC5 symmetric block cypher -- 64-bit block size
 
44
*/
 
45
 
 
46
/*
 
47
** Create a new RC5 context suitable for RC5 encryption/decryption.
 
48
**      "key" raw key data
 
49
**      "len" the number of bytes of key data
 
50
**      "iv" is the CBC initialization vector (if mode is NSS_RC5_CBC)
 
51
**      "mode" one of NSS_RC5 or NSS_RC5_CBC
 
52
**
 
53
** When mode is set to NSS_RC5_CBC the RC5 cipher is run in "cipher block
 
54
** chaining" mode.
 
55
*/
 
56
RC5Context *
 
57
RC5_CreateContext(const SECItem *key, unsigned int rounds,
 
58
                  unsigned int wordSize, const unsigned char *iv, int mode)
 
59
{
 
60
    PORT_SetError(PR_NOT_IMPLEMENTED_ERROR);
 
61
    return NULL;
 
62
}
 
63
 
 
64
/*
 
65
** Destroy an RC5 encryption/decryption context.
 
66
**      "cx" the context
 
67
**      "freeit" if PR_TRUE then free the object as well as its sub-objects
 
68
*/
 
69
void 
 
70
RC5_DestroyContext(RC5Context *cx, PRBool freeit) 
 
71
{
 
72
    PORT_SetError(PR_NOT_IMPLEMENTED_ERROR);
 
73
}
 
74
 
 
75
/*
 
76
** Perform RC5 encryption.
 
77
**      "cx" the context
 
78
**      "output" the output buffer to store the encrypted data.
 
79
**      "outputLen" how much data is stored in "output". Set by the routine
 
80
**         after some data is stored in output.
 
81
**      "maxOutputLen" the maximum amount of data that can ever be
 
82
**         stored in "output"
 
83
**      "input" the input data
 
84
**      "inputLen" the amount of input data
 
85
*/
 
86
SECStatus 
 
87
RC5_Encrypt(RC5Context *cx, unsigned char *output, unsigned int *outputLen, 
 
88
            unsigned int maxOutputLen, 
 
89
            const unsigned char *input, unsigned int inputLen)
 
90
{
 
91
    PORT_SetError(PR_NOT_IMPLEMENTED_ERROR);
 
92
    return SECFailure;
 
93
}
 
94
 
 
95
/*
 
96
** Perform RC5 decryption.
 
97
**      "cx" the context
 
98
**      "output" the output buffer to store the decrypted data.
 
99
**      "outputLen" how much data is stored in "output". Set by the routine
 
100
**         after some data is stored in output.
 
101
**      "maxOutputLen" the maximum amount of data that can ever be
 
102
**         stored in "output"
 
103
**      "input" the input data
 
104
**      "inputLen" the amount of input data
 
105
*/
 
106
SECStatus 
 
107
RC5_Decrypt(RC5Context *cx, unsigned char *output, unsigned int *outputLen, 
 
108
            unsigned int maxOutputLen,
 
109
            const unsigned char *input, unsigned int inputLen)
 
110
{
 
111
    PORT_SetError(PR_NOT_IMPLEMENTED_ERROR);
 
112
    return SECFailure;
 
113
}
 
114