/security/nss/lib/freebl/arcfive.c

http://github.com/zpao/v8monkey · C · 121 lines · 33 code · 8 blank · 80 comment · 0 complexity · 1ac5e0c4c63dd486442d744fe50f8f35 MD5 · raw file

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