00001 /* arc4.hpp 00002 * 00003 * Copyright (C) 2003 Sawtooth Consulting Ltd. 00004 * 00005 * This file is part of yaSSL. 00006 * 00007 * yaSSL is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 2 of the License, or 00010 * (at your option) any later version. 00011 * 00012 * There are special exceptions to the terms and conditions of the GPL as it 00013 * is applied to yaSSL. View the full text of the exception in the file 00014 * FLOSS-EXCEPTIONS in the directory of this software distribution. 00015 * 00016 * yaSSL is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU General Public License 00022 * along with this program; if not, write to the Free Software 00023 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 00024 */ 00025 00026 /* arc4.hpp defines ARC4 00027 */ 00028 00029 00030 #ifndef TAO_CRYPT_ARC4_HPP 00031 #define TAO_CRYPT_ARC4_HPP 00032 00033 #include "misc.hpp" 00034 00035 namespace TaoCrypt { 00036 00037 00038 // ARC4 encryption and decryption 00039 class ARC4 { 00040 public: 00041 enum { STATE_SIZE = 256 }; 00042 00043 typedef ARC4 Encryption; 00044 typedef ARC4 Decryption; 00045 00046 ARC4() {} 00047 00048 void Process(byte*, const byte*, word32); 00049 void AsmProcess(byte*, const byte*, word32); 00050 void SetKey(const byte*, word32); 00051 private: 00052 byte x_; 00053 byte y_; 00054 byte state_[STATE_SIZE]; 00055 00056 ARC4(const ARC4&); // hide copy 00057 const ARC4 operator=(const ARC4&); // and assign 00058 }; 00059 00060 } // namespace 00061 00062 00063 #endif // TAO_CRYPT_ARC4_HPP 00064
1.4.7

