00001 /* 00002 * Copyright 2003 Michael A. Marsh, Cornell University. All rights reserved. 00003 * This software is released under the modified BSD license. 00004 * See the file LICENSE in the top-level directory for details. 00005 */ 00006 // 00007 // $Id: ModExpFunctional.h,v 1.4 2005/01/21 19:44:18 mmarsh Exp $ 00008 // 00009 // $Log: ModExpFunctional.h,v $ 00010 // Revision 1.4 2005/01/21 19:44:18 mmarsh 00011 // Updated for compatibility with Doxygen 1.4.1 00012 // 00013 // Revision 1.3 2004/05/19 15:57:00 mmarsh 00014 // *** empty log message *** 00015 // 00016 // Revision 1.2 2003/11/04 22:31:52 mmarsh 00017 // *** empty log message *** 00018 // 00019 // 00020 00021 #ifndef __CODEX_VSS_MODEXPFUNCTIONAL_H__ 00022 #define __CODEX_VSS_MODEXPFUNCTIONAL_H__ 00023 00024 #include "ShareFunctional.h" 00025 #include "CODEX_ASN1/Base.h" 00026 00027 namespace CODEX_VSS 00028 { 00033 class ModExpFunctionalArgs : public CODEX_ASN1::Base 00034 { 00035 public : 00037 ModExpFunctionalArgs(); 00038 00040 ModExpFunctionalArgs( const CODEX_ASN1::BigNumber& base, 00041 const CODEX_ASN1::BigNumber& modulus ); 00042 00044 ModExpFunctionalArgs( const ModExpFunctionalArgs& aOther ); 00045 00047 virtual ~ModExpFunctionalArgs(); 00048 00050 void operator=( const ModExpFunctionalArgs& aOther ); 00051 00053 const CODEX_ASN1::BigNumber& base() const { return m_base; } 00054 00056 const CODEX_ASN1::BigNumber& modulus() const { return m_modulus; } 00057 00058 int marshal( unsigned char ** pp ) const; 00059 void* unmarshal( void* bogus, unsigned char** pp, long length ); 00060 00061 private : 00062 CODEX_ASN1::BigNumber m_base; 00063 CODEX_ASN1::BigNumber m_modulus; 00064 }; 00065 00070 class ModExpFunctional : public ShareFunctional 00071 { 00072 public : 00074 typedef CODEX_ASN1::BigNumber ArgType; 00075 00077 typedef ModExpFunctionalArgs CtorArgs; 00078 00080 ModExpFunctional( const ArgType& base, const ArgType& modulus ); 00081 00083 ModExpFunctional( const CtorArgs& args ); 00084 00086 virtual ~ModExpFunctional(); 00087 00094 void operator()( const CODEX_ASN1::SecureBigNumber& operand, 00095 CODEX_ASN1::BigNumber& result ) const; 00096 00098 const ArgType& base() const { return m_base; } 00099 00101 const ArgType& modulus() const { return m_modulus; } 00102 00103 private : 00104 ArgType m_base; 00105 ArgType m_modulus; 00106 }; 00107 00108 } 00109 00110 #endif /* __CODEX_VSS_MODEXPFUNCTIONAL_H__ */
1.4.1